Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
99401a4d
Commit
99401a4d
authored
Nov 13, 2013
by
mattijs
Browse files
ENH: cyclic: added patchGroup coupling
parent
40df4488
Changes
11
Hide whitespace changes
Inline
Side-by-side
src/OpenFOAM/Make/files
View file @
99401a4d
...
...
@@ -387,6 +387,7 @@ $(cellShape)/cellShapeIO.C
$(cellShape)/cellShapeIOList.C
meshes/Identifiers/patch/patchIdentifier.C
meshes/Identifiers/patch/coupleGroupIdentifier.C
meshes/MeshObject/meshObject.C
...
...
src/
meshTools/mappedPatches/mappedPolyP
atch/coupleGroupIdentifier.C
→
src/
OpenFOAM/meshes/Identifiers/p
atch/coupleGroupIdentifier.C
View file @
99401a4d
File moved
src/
meshTools/mappedPatches/mappedPolyP
atch/coupleGroupIdentifier.H
→
src/
OpenFOAM/meshes/Identifiers/p
atch/coupleGroupIdentifier.H
View file @
99401a4d
File moved
src/
meshTools/mappedPatches/mappedPolyP
atch/coupleGroupIdentifierI.H
→
src/
OpenFOAM/meshes/Identifiers/p
atch/coupleGroupIdentifierI.H
View file @
99401a4d
File moved
src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C
View file @
99401a4d
...
...
@@ -171,7 +171,7 @@ void Foam::cyclicPolyPatch::calcTransforms
"cyclicPolyPatch::calcTransforms()"
)
<<
"Patch "
<<
name
()
<<
" has transform type "
<<
transformTypeNames
[
transform
()]
<<
", neighbour patch "
<<
neighbPatchName
_
<<
", neighbour patch "
<<
neighbPatchName
()
<<
" has transform type "
<<
neighbPatch
().
transformTypeNames
[
neighbPatch
().
transform
()]
<<
exit
(
FatalError
);
...
...
@@ -350,7 +350,7 @@ void Foam::cyclicPolyPatch::calcTransforms
<<
neighbPatch
().
separationVector_
<<
" by more than tolerance "
<<
avgTol
<<
endl
<<
"patch:"
<<
name
()
<<
" neighbour:"
<<
neighbPatchName
_
<<
" neighbour:"
<<
neighbPatchName
()
<<
endl
;
}
...
...
@@ -374,7 +374,7 @@ void Foam::cyclicPolyPatch::calcTransforms
<<
"Continuing with specified separation vector "
<<
separationVector_
<<
endl
<<
"patch:"
<<
name
()
<<
" neighbour:"
<<
neighbPatchName
_
<<
" neighbour:"
<<
neighbPatchName
()
<<
endl
;
}
...
...
@@ -658,6 +658,7 @@ Foam::cyclicPolyPatch::cyclicPolyPatch
:
coupledPolyPatch
(
name
,
dict
,
index
,
bm
,
patchType
),
neighbPatchName_
(
dict
.
lookupOrDefault
(
"neighbourPatch"
,
word
::
null
)),
coupleGroup_
(
dict
),
neighbPatchID_
(
-
1
),
rotationAxis_
(
vector
::
zero
),
rotationCentre_
(
point
::
zero
),
...
...
@@ -665,7 +666,7 @@ Foam::cyclicPolyPatch::cyclicPolyPatch
coupledPointsPtr_
(
NULL
),
coupledEdgesPtr_
(
NULL
)
{
if
(
neighbPatchName_
==
word
::
null
)
if
(
neighbPatchName_
==
word
::
null
&&
!
coupleGroup_
.
valid
()
)
{
FatalIOErrorIn
(
...
...
@@ -733,7 +734,8 @@ Foam::cyclicPolyPatch::cyclicPolyPatch
)
:
coupledPolyPatch
(
pp
,
bm
),
neighbPatchName_
(
pp
.
neighbPatchName
()),
neighbPatchName_
(
pp
.
neighbPatchName_
),
coupleGroup_
(
pp
.
coupleGroup_
),
neighbPatchID_
(
-
1
),
rotationAxis_
(
pp
.
rotationAxis_
),
rotationCentre_
(
pp
.
rotationCentre_
),
...
...
@@ -753,11 +755,12 @@ Foam::cyclicPolyPatch::cyclicPolyPatch
const
label
index
,
const
label
newSize
,
const
label
newStart
,
const
word
&
neighb
Patch
Name
const
word
&
neighbName
)
:
coupledPolyPatch
(
pp
,
bm
,
index
,
newSize
,
newStart
),
neighbPatchName_
(
neighbPatchName
),
neighbPatchName_
(
neighbName
),
coupleGroup_
(
pp
.
coupleGroup_
),
neighbPatchID_
(
-
1
),
rotationAxis_
(
pp
.
rotationAxis_
),
rotationCentre_
(
pp
.
rotationCentre_
),
...
...
@@ -765,10 +768,10 @@ Foam::cyclicPolyPatch::cyclicPolyPatch
coupledPointsPtr_
(
NULL
),
coupledEdgesPtr_
(
NULL
)
{
if
(
neighb
Patch
Name
_
==
name
())
if
(
neighbName
==
name
())
{
FatalErrorIn
(
"cyclicPolyPatch::cyclicPolyPatch(..)"
)
<<
"Neighbour patch name "
<<
neighb
Patch
Name
_
<<
"Neighbour patch name "
<<
neighbName
<<
" cannot be the same as this patch "
<<
name
()
<<
exit
(
FatalError
);
}
...
...
@@ -789,6 +792,7 @@ Foam::cyclicPolyPatch::cyclicPolyPatch
:
coupledPolyPatch
(
pp
,
bm
,
index
,
mapAddressing
,
newStart
),
neighbPatchName_
(
pp
.
neighbPatchName_
),
coupleGroup_
(
pp
.
coupleGroup_
),
neighbPatchID_
(
-
1
),
rotationAxis_
(
pp
.
rotationAxis_
),
rotationCentre_
(
pp
.
rotationCentre_
),
...
...
@@ -809,16 +813,29 @@ Foam::cyclicPolyPatch::~cyclicPolyPatch()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
const
Foam
::
word
&
Foam
::
cyclicPolyPatch
::
neighbPatchName
()
const
{
if
(
neighbPatchName_
.
empty
())
{
// Try and use patchGroup to find samplePatch and sampleRegion
label
patchID
=
coupleGroup_
.
findOtherPatchID
(
*
this
);
neighbPatchName_
=
boundaryMesh
()[
patchID
].
name
();
}
return
neighbPatchName_
;
}
Foam
::
label
Foam
::
cyclicPolyPatch
::
neighbPatchID
()
const
{
if
(
neighbPatchID_
==
-
1
)
{
neighbPatchID_
=
this
->
boundaryMesh
().
findPatchID
(
neighbPatchName
_
);
neighbPatchID_
=
this
->
boundaryMesh
().
findPatchID
(
neighbPatchName
()
);
if
(
neighbPatchID_
==
-
1
)
{
FatalErrorIn
(
"cyclicPolyPatch::neighbPatchID() const"
)
<<
"Illegal neighbourPatch name "
<<
neighbPatchName
_
<<
"Illegal neighbourPatch name "
<<
neighbPatchName
()
<<
endl
<<
"Valid patch names are "
<<
this
->
boundaryMesh
().
names
()
<<
exit
(
FatalError
);
...
...
@@ -1256,7 +1273,7 @@ bool Foam::cyclicPolyPatch::order
{
Pout
<<
"order : of "
<<
pp
.
size
()
<<
" faces of patch:"
<<
name
()
<<
" neighbour:"
<<
neighbPatchName
_
<<
" neighbour:"
<<
neighbPatchName
()
<<
endl
;
}
faceMap
.
setSize
(
pp
.
size
());
...
...
@@ -1444,8 +1461,12 @@ bool Foam::cyclicPolyPatch::order
void
Foam
::
cyclicPolyPatch
::
write
(
Ostream
&
os
)
const
{
coupledPolyPatch
::
write
(
os
);
os
.
writeKeyword
(
"neighbourPatch"
)
<<
neighbPatchName_
<<
token
::
END_STATEMENT
<<
nl
;
if
(
!
neighbPatchName_
.
empty
())
{
os
.
writeKeyword
(
"neighbourPatch"
)
<<
neighbPatchName_
<<
token
::
END_STATEMENT
<<
nl
;
}
coupleGroup_
.
write
(
os
);
switch
(
transform
())
{
case
ROTATIONAL
:
...
...
src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.H
View file @
99401a4d
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-201
2
OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-201
3
OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
@@ -50,6 +50,7 @@ SourceFiles
#include
"edgeList.H"
#include
"polyBoundaryMesh.H"
#include
"diagTensorField.H"
#include
"coupleGroupIdentifier.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
...
...
@@ -67,7 +68,10 @@ class cyclicPolyPatch
// Private data
//- Name of other half
const
word
neighbPatchName_
;
mutable
word
neighbPatchName_
;
//- Optional patchGroup to find neighbPatch
const
coupleGroupIdentifier
coupleGroup_
;
//- Index of other half
mutable
label
neighbPatchID_
;
...
...
@@ -306,12 +310,10 @@ public:
// Member Functions
const
word
&
neighbPatchName
()
const
{
return
neighbPatchName_
;
}
//- Neighbour patch name
const
word
&
neighbPatchName
()
const
;
//- Neighbour patchID
.
//- Neighbour patchID
virtual
label
neighbPatchID
()
const
;
virtual
bool
owner
()
const
...
...
src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPolyPatch/cyclicAMIPolyPatch.C
View file @
99401a4d
...
...
@@ -125,7 +125,7 @@ void Foam::cyclicAMIPolyPatch::calcTransforms
FatalErrorIn
(
"cyclicAMIPolyPatch::calcTransforms()"
)
<<
"Patch "
<<
name
()
<<
" has transform type "
<<
transformTypeNames
[
transform
()]
<<
", neighbour patch "
<<
nb
r
PatchName
_
<<
", neighbour patch "
<<
n
eigh
bPatchName
()
<<
" has transform type "
<<
neighbPatch
().
transformTypeNames
[
neighbPatch
().
transform
()]
<<
exit
(
FatalError
);
...
...
@@ -416,7 +416,8 @@ Foam::cyclicAMIPolyPatch::cyclicAMIPolyPatch
)
:
coupledPolyPatch
(
name
,
dict
,
index
,
bm
,
patchType
),
nbrPatchName_
(
dict
.
lookup
(
"neighbourPatch"
)),
nbrPatchName_
(
dict
.
lookupOrDefault
<
word
>
(
"neighbourPatch"
,
""
)),
coupleGroup_
(
dict
),
nbrPatchID_
(
-
1
),
rotationAxis_
(
vector
::
zero
),
rotationCentre_
(
point
::
zero
),
...
...
@@ -426,6 +427,22 @@ Foam::cyclicAMIPolyPatch::cyclicAMIPolyPatch
surfPtr_
(
NULL
),
surfDict_
(
dict
.
subOrEmptyDict
(
"surface"
))
{
if
(
nbrPatchName_
==
word
::
null
&&
!
coupleGroup_
.
valid
())
{
FatalIOErrorIn
(
"cyclicAMIPolyPatch::cyclicAMIPolyPatch"
"("
"const word&, "
"const dictionary&, "
"const label, "
"const polyBoundaryMesh&"
")"
,
dict
)
<<
"No
\"
neighbourPatch
\"
or
\"
coupleGroup
\"
provided."
<<
exit
(
FatalIOError
);
}
if
(
nbrPatchName_
==
name
)
{
FatalIOErrorIn
...
...
@@ -495,6 +512,7 @@ Foam::cyclicAMIPolyPatch::cyclicAMIPolyPatch
:
coupledPolyPatch
(
pp
,
bm
),
nbrPatchName_
(
pp
.
nbrPatchName_
),
coupleGroup_
(
pp
.
coupleGroup_
),
nbrPatchID_
(
-
1
),
rotationAxis_
(
pp
.
rotationAxis_
),
rotationCentre_
(
pp
.
rotationCentre_
),
...
...
@@ -521,6 +539,7 @@ Foam::cyclicAMIPolyPatch::cyclicAMIPolyPatch
:
coupledPolyPatch
(
pp
,
bm
,
index
,
newSize
,
newStart
),
nbrPatchName_
(
nbrPatchName
),
coupleGroup_
(
pp
.
coupleGroup_
),
nbrPatchID_
(
-
1
),
rotationAxis_
(
pp
.
rotationAxis_
),
rotationCentre_
(
pp
.
rotationCentre_
),
...
...
@@ -561,6 +580,7 @@ Foam::cyclicAMIPolyPatch::cyclicAMIPolyPatch
:
coupledPolyPatch
(
pp
,
bm
,
index
,
mapAddressing
,
newStart
),
nbrPatchName_
(
pp
.
nbrPatchName_
),
coupleGroup_
(
pp
.
coupleGroup_
),
nbrPatchID_
(
-
1
),
rotationAxis_
(
pp
.
rotationAxis_
),
rotationCentre_
(
pp
.
rotationCentre_
),
...
...
@@ -584,12 +604,12 @@ Foam::label Foam::cyclicAMIPolyPatch::neighbPatchID() const
{
if
(
nbrPatchID_
==
-
1
)
{
nbrPatchID_
=
this
->
boundaryMesh
().
findPatchID
(
nb
r
PatchName
_
);
nbrPatchID_
=
this
->
boundaryMesh
().
findPatchID
(
n
eigh
bPatchName
()
);
if
(
nbrPatchID_
==
-
1
)
{
FatalErrorIn
(
"cyclicPolyAMIPatch::neighbPatchID() const"
)
<<
"Illegal neighbourPatch name "
<<
nb
r
PatchName
_
<<
"Illegal neighbourPatch name "
<<
n
eigh
bPatchName
()
<<
nl
<<
"Valid patch names are "
<<
this
->
boundaryMesh
().
names
()
<<
exit
(
FatalError
);
...
...
@@ -832,8 +852,12 @@ Foam::label Foam::cyclicAMIPolyPatch::pointFace
void
Foam
::
cyclicAMIPolyPatch
::
write
(
Ostream
&
os
)
const
{
coupledPolyPatch
::
write
(
os
);
os
.
writeKeyword
(
"neighbourPatch"
)
<<
nbrPatchName_
<<
token
::
END_STATEMENT
<<
nl
;
if
(
!
nbrPatchName_
.
empty
())
{
os
.
writeKeyword
(
"neighbourPatch"
)
<<
nbrPatchName_
<<
token
::
END_STATEMENT
<<
nl
;
}
coupleGroup_
.
write
(
os
);
switch
(
transform
())
{
...
...
src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPolyPatch/cyclicAMIPolyPatch.H
View file @
99401a4d
...
...
@@ -38,6 +38,7 @@ SourceFiles
#include
"coupledPolyPatch.H"
#include
"AMIPatchToPatchInterpolation.H"
#include
"polyBoundaryMesh.H"
#include
"coupleGroupIdentifier.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
...
...
@@ -58,7 +59,10 @@ private:
// Private data
//- Name of other half
const
word
nbrPatchName_
;
mutable
word
nbrPatchName_
;
//- Optional patchGroup to find neighbPatch
const
coupleGroupIdentifier
coupleGroup_
;
//- Index of other half
mutable
label
nbrPatchID_
;
...
...
src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPolyPatch/cyclicAMIPolyPatchI.H
View file @
99401a4d
...
...
@@ -27,6 +27,13 @@ License
inline
const
Foam
::
word
&
Foam
::
cyclicAMIPolyPatch
::
neighbPatchName
()
const
{
if
(
nbrPatchName_
.
empty
())
{
// Try and use patchGroup to find samplePatch and sampleRegion
label
patchID
=
coupleGroup_
.
findOtherPatchID
(
*
this
);
nbrPatchName_
=
boundaryMesh
()[
patchID
].
name
();
}
return
nbrPatchName_
;
}
...
...
src/meshTools/Make/files
View file @
99401a4d
...
...
@@ -199,7 +199,6 @@ mappedPatches/mappedPolyPatch/mappedPatchBase.C
mappedPatches/mappedPolyPatch/mappedPolyPatch.C
mappedPatches/mappedPolyPatch/mappedWallPolyPatch.C
mappedPatches/mappedPolyPatch/mappedVariableThicknessWallPolyPatch.C
mappedPatches/mappedPolyPatch/coupleGroupIdentifier.C
mappedPatches/mappedPointPatch/mappedPointPatch.C
mappedPatches/mappedPointPatch/mappedWallPointPatch.C
...
...
src/meshTools/mappedPatches/mappedPolyPatch/mappedPatchBase.C
View file @
99401a4d
...
...
@@ -1402,10 +1402,16 @@ void Foam::mappedPatchBase::write(Ostream& os) const
{
os
.
writeKeyword
(
"sampleMode"
)
<<
sampleModeNames_
[
mode_
]
<<
token
::
END_STATEMENT
<<
nl
;
os
.
writeKeyword
(
"sampleRegion"
)
<<
sampleRegion
()
<<
token
::
END_STATEMENT
<<
nl
;
os
.
writeKeyword
(
"samplePatch"
)
<<
samplePatch
()
<<
token
::
END_STATEMENT
<<
nl
;
if
(
!
sampleRegion_
.
empty
())
{
os
.
writeKeyword
(
"sampleRegion"
)
<<
sampleRegion_
<<
token
::
END_STATEMENT
<<
nl
;
}
if
(
!
samplePatch_
.
empty
())
{
os
.
writeKeyword
(
"samplePatch"
)
<<
samplePatch_
<<
token
::
END_STATEMENT
<<
nl
;
}
coupleGroup_
.
write
(
os
);
if
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment