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
e44359e1
Commit
e44359e1
authored
Oct 22, 2010
by
mattijs
Browse files
BUG: cyclics in mesh conversion : have 'old' style cyclics
parent
a0517f0e
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L
View file @
e44359e1
...
...
@@ -43,7 +43,7 @@ Description
#include "polyMeshZipUpCells.H"
#include "wallPolyPatch.H"
#include "symmetryPolyPatch.H"
#include "
c
yclicPolyPatch.H"
#include "
oldC
yclicPolyPatch.H"
#include "Swap.H"
#include "IFstream.H"
#include "readHexLabel.H"
...
...
@@ -900,7 +900,7 @@ int main(int argc, char *argv[])
fluentToFoamType.insert("interface", polyPatch::typeName);
fluentToFoamType.insert("internal", polyPatch::typeName);
fluentToFoamType.insert("solid", polyPatch::typeName);
fluentToFoamType.insert("fan",
c
yclicPolyPatch::typeName);
fluentToFoamType.insert("fan",
oldC
yclicPolyPatch::typeName);
fluentToFoamType.insert("radiator", polyPatch::typeName);
fluentToFoamType.insert("porous-jump", polyPatch::typeName);
...
...
applications/utilities/mesh/conversion/kivaToFoam/kivaToFoam.C
View file @
e44359e1
...
...
@@ -41,7 +41,7 @@ Description
#include
"wallPolyPatch.H"
#include
"symmetryPolyPatch.H"
#include
"wedgePolyPatch.H"
#include
"
c
yclicPolyPatch.H"
#include
"
oldC
yclicPolyPatch.H"
#include
"unitConversion.H"
using
namespace
Foam
;
...
...
applications/utilities/mesh/conversion/kivaToFoam/readKivaGrid.H
View file @
e44359e1
...
...
@@ -196,7 +196,7 @@ const word* kivaPatchTypes[nBCs] =
&
polyPatch
::
typeName
,
&
polyPatch
::
typeName
,
&
symmetryPolyPatch
::
typeName
,
&
c
yclicPolyPatch
::
typeName
&
oldC
yclicPolyPatch
::
typeName
};
enum
patchTypeNames
...
...
applications/utilities/mesh/conversion/sammToFoam/readBoundary.C
View file @
e44359e1
...
...
@@ -29,7 +29,7 @@ Description
#include
"sammMesh.H"
#include
"Time.H"
#include
"wallPolyPatch.H"
#include
"
c
yclicPolyPatch.H"
#include
"
oldC
yclicPolyPatch.H"
#include
"symmetryPolyPatch.H"
#include
"preservePatchTypes.H"
#include
"IFstream.H"
...
...
@@ -208,7 +208,7 @@ void sammMesh::readBoundary()
{
// incorrect. should be cyclicPatch but this
// requires info on connected faces.
patchTypes_
[
patchLabel
]
=
c
yclicPolyPatch
::
typeName
;
patchTypes_
[
patchLabel
]
=
oldC
yclicPolyPatch
::
typeName
;
}
else
{
...
...
applications/utilities/mesh/conversion/star3ToFoam/readBoundary.C
View file @
e44359e1
...
...
@@ -29,7 +29,7 @@ Description
#include
"starMesh.H"
#include
"Time.H"
#include
"wallPolyPatch.H"
#include
"
c
yclicPolyPatch.H"
#include
"
oldC
yclicPolyPatch.H"
#include
"symmetryPolyPatch.H"
#include
"preservePatchTypes.H"
#include
"IFstream.H"
...
...
@@ -206,7 +206,7 @@ void starMesh::readBoundary()
{
// incorrect. should be cyclicPatch but this
// requires info on connected faces.
patchTypes_
[
patchLabel
]
=
c
yclicPolyPatch
::
typeName
;
patchTypes_
[
patchLabel
]
=
oldC
yclicPolyPatch
::
typeName
;
}
else
{
...
...
src/OpenFOAM/Make/files
View file @
e44359e1
...
...
@@ -346,6 +346,7 @@ $(basicPolyPatches)/generic/genericPolyPatch.C
constraintPolyPatches = $(polyPatches)/constraint
$(constraintPolyPatches)/cyclic/cyclicPolyPatch.C
$(constraintPolyPatches)/cyclicSlip/cyclicSlipPolyPatch.C
$(constraintPolyPatches)/oldCyclic/oldCyclicPolyPatch.C
$(constraintPolyPatches)/empty/emptyPolyPatch.C
$(constraintPolyPatches)/nonuniformTransformCyclic/nonuniformTransformCyclicPolyPatch.C
$(constraintPolyPatches)/processorCyclic/processorCyclicPolyPatch.C
...
...
src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/oldCyclic/oldCyclicPolyPatch.C
0 → 100644
View file @
e44359e1
This diff is collapsed.
Click to expand it.
src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/oldCyclic/oldCyclicPolyPatch.H
0 → 100644
View file @
e44359e1
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::oldCyclicPolyPatch
Description
'old' style cyclic polyPatch with all faces in single patch. Does ordering
but cannot be used to run. Writes 'type cyclic' so foamUpgradeCyclics
can be run afterwards.
Used to get cyclics from mesh converters that assume cyclics in single
patch (e.g. fluent3DMeshToFoam)
SourceFiles
oldCyclicPolyPatch.C
\*---------------------------------------------------------------------------*/
#ifndef oldCyclicPolyPatch_H
#define oldCyclicPolyPatch_H
#include
"coupledPolyPatch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace
Foam
{
/*---------------------------------------------------------------------------*\
Class oldCyclicPolyPatch Declaration
\*---------------------------------------------------------------------------*/
class
oldCyclicPolyPatch
:
public
coupledPolyPatch
{
public:
enum
transformType
{
UNKNOWN
,
ROTATIONAL
,
TRANSLATIONAL
};
static
const
NamedEnum
<
transformType
,
3
>
transformTypeNames
;
private:
// Private data
//- Morph:angle between normals of neighbouring faces.
// Used to split cyclic into halves.
scalar
featureCos_
;
//- Type of transformation - rotational or translational
transformType
transform_
;
// For rotation
//- Axis of rotation for rotational cyclics
vector
rotationAxis_
;
//- point on axis of rotation for rotational cyclics
point
rotationCentre_
;
// For translation
//- Translation vector
vector
separationVector_
;
// Private member functions
//- Find amongst selected faces the one with the largest area
static
label
findMaxArea
(
const
pointField
&
,
const
faceList
&
);
void
calcTransforms
();
//- Calculate face centres
static
pointField
calcFaceCentres
(
const
UList
<
face
>&
,
const
pointField
&
);
//- Get f[0] for all faces
static
pointField
getAnchorPoints
(
const
UList
<
face
>&
,
const
pointField
&
);
// Face ordering
//- Find the two parts of the faces of pp using feature edges.
// Returns true if successfull.
bool
getGeometricHalves
(
const
primitivePatch
&
,
labelList
&
,
labelList
&
)
const
;
//- Calculate geometric factors of the two halves.
void
getCentresAndAnchors
(
const
primitivePatch
&
,
const
faceList
&
half0Faces
,
const
faceList
&
half1Faces
,
pointField
&
ppPoints
,
pointField
&
half0Ctrs
,
pointField
&
half1Ctrs
,
pointField
&
anchors0
,
scalarField
&
tols
)
const
;
//- Given matched faces matches the anchor point. Sets faceMap,
// rotation. Returns true if all matched.
bool
matchAnchors
(
const
bool
report
,
const
primitivePatch
&
,
const
labelList
&
,
const
pointField
&
,
const
labelList
&
,
const
faceList
&
,
const
labelList
&
,
const
scalarField
&
,
labelList
&
faceMap
,
labelList
&
rotation
)
const
;
//- For rotational cases, try to find a unique face on each side
// of the cyclic.
label
getConsistentRotationFace
(
const
pointField
&
faceCentres
)
const
;
protected:
// Protected Member functions
//- Initialise the calculation of the patch geometry
virtual
void
initGeometry
(
PstreamBuffers
&
);
//- Calculate the patch geometry
virtual
void
calcGeometry
(
PstreamBuffers
&
);
//- Initialise the patches for moving points
virtual
void
initMovePoints
(
PstreamBuffers
&
,
const
pointField
&
);
//- Correct patches after moving points
virtual
void
movePoints
(
PstreamBuffers
&
,
const
pointField
&
);
//- Initialise the update of the patch topology
virtual
void
initUpdateMesh
(
PstreamBuffers
&
);
//- Update of the patch topology
virtual
void
updateMesh
(
PstreamBuffers
&
);
public:
//- Runtime type information
TypeName
(
"oldCyclic"
);
// Constructors
//- Construct from components
oldCyclicPolyPatch
(
const
word
&
name
,
const
label
size
,
const
label
start
,
const
label
index
,
const
polyBoundaryMesh
&
bm
);
//- Construct from dictionary
oldCyclicPolyPatch
(
const
word
&
name
,
const
dictionary
&
dict
,
const
label
index
,
const
polyBoundaryMesh
&
bm
);
//- Construct as copy, resetting the boundary mesh
oldCyclicPolyPatch
(
const
oldCyclicPolyPatch
&
,
const
polyBoundaryMesh
&
);
//- Construct given the original patch and resetting the
// face list and boundary mesh information
oldCyclicPolyPatch
(
const
oldCyclicPolyPatch
&
pp
,
const
polyBoundaryMesh
&
bm
,
const
label
index
,
const
label
newSize
,
const
label
newStart
);
//- Construct and return a clone, resetting the boundary mesh
virtual
autoPtr
<
polyPatch
>
clone
(
const
polyBoundaryMesh
&
bm
)
const
{
return
autoPtr
<
polyPatch
>
(
new
oldCyclicPolyPatch
(
*
this
,
bm
));
}
//- Construct and return a clone, resetting the face list
// and boundary mesh
virtual
autoPtr
<
polyPatch
>
clone
(
const
polyBoundaryMesh
&
bm
,
const
label
index
,
const
label
newSize
,
const
label
newStart
)
const
{
return
autoPtr
<
polyPatch
>
(
new
oldCyclicPolyPatch
(
*
this
,
bm
,
index
,
newSize
,
newStart
)
);
}
// Destructor
virtual
~
oldCyclicPolyPatch
();
// Member Functions
// Access
//- Does this side own the patch ?
virtual
bool
owner
()
const
{
notImplemented
(
"oldCyclicPolyPatch::owner()"
);
return
true
;
}
//- Transform a patch-based position from other side to this side
virtual
void
transformPosition
(
pointField
&
l
)
const
{
notImplemented
(
"transformPosition(pointField&)"
);
}
//- Calculate the patch geometry
virtual
void
calcGeometry
(
const
primitivePatch
&
referPatch
,
const
UList
<
point
>&
thisCtrs
,
const
UList
<
point
>&
thisAreas
,
const
UList
<
point
>&
thisCc
,
const
UList
<
point
>&
nbrCtrs
,
const
UList
<
point
>&
nbrAreas
,
const
UList
<
point
>&
nbrCc
);
//- Initialize ordering for primitivePatch. Does not
// refer to *this (except for name() and type() etc.)
virtual
void
initOrder
(
PstreamBuffers
&
,
const
primitivePatch
&
)
const
;
//- Return new ordering for primitivePatch.
// Ordering is -faceMap: for every face
// index of the new face -rotation:for every new face the clockwise
// shift of the original face. Return false if nothing changes
// (faceMap is identity, rotation is 0), true otherwise.
virtual
bool
order
(
PstreamBuffers
&
,
const
primitivePatch
&
,
labelList
&
faceMap
,
labelList
&
rotation
)
const
;
//- Write the polyPatch data as a dictionary
virtual
void
write
(
Ostream
&
)
const
;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
}
// End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //
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