Go to the documentation of this file.
52 typedef std::map<label, std::pair<vector, label> > mapType;
53 mapType centreSum, normalSum;
57 if( boundaries[patchI].patchType() ==
"symmetryPlane" )
59 std::pair<vector, label>& cs = centreSum[patchI];
62 std::pair<vector, label>& ns = normalSum[patchI];
65 const label start = boundaries[patchI].patchStart();
66 const label end = start + boundaries[patchI].patchSize();
67 for(
label faceI=start;faceI<end;++faceI)
70 ns.first += faces[faceI].normal(
points);
73 cs.second = ns.second = boundaries[patchI].patchSize();
83 std::pair<vector, label>& cs = pIter->second;
87 std::pair<vector, label>& ns = normalSum[pIter->first];
89 ns.second = cs.second;
96 const point c = it->second.first / it->second.second;
98 const std::pair<vector, label>& ns = normalSum[it->first];
99 const point n = ns.first / ns.second;
114 forAll(boundaries, patchI)
116 if( boundaries[patchI].patchType() ==
"symmetryPlane" )
118 const label start = boundaries[patchI].patchStart();
119 const label end = start + boundaries[patchI].patchSize();
120 for(
label faceI=start;faceI<end;++faceI)
122 const face&
f = faces[faceI];
138 std::map<label, labelLongList> exchangeData;
140 exchangeData[neiProcs[i]].clear();
144 const label pointI = it();
151 const label neiProc = pointAtProcs(pointI, i);
158 dataToSend.
append(it.key());
168 for(
label counter=0;counter<receivedData.
size();)
170 const label pointI = globalToLocal[receivedData[counter++]];
172 const label size = receivedData[counter++];
173 for(
label i=0;i<size;++i)
174 pointInPlanes.appendIfNotIn(pointI, receivedData[counter++]);
203 forAll(pointInPlane, pointI)
211 "void symmetryPlaneOptimisation::optimizeSymmetryPlanes()"
212 ) <<
"Point " << pointI <<
" is in more than three symmetry"
213 <<
" planes. Cannot move it" <<
endl;
218 for(
label plI=0;plI<nPlanes;++plI)
221 std::map<label, plane>::const_iterator it =
224 const point newP = it->second.nearestPoint(
points[pointI]);
234 if( badFaces.
size() )
238 "void symmetryPlaneOptimisation::optimizeSymmetryPlanes()"
239 ) <<
"Bad quality or inverted faces found in the mesh" <<
endl;
const polyMeshGenAddressing & addressingData() const
addressing which may be needed
void append(const T &e)
Append an element at the end of the list.
#define forAllIter(Container, container, iter)
Iterate across all elements in the container object of type.
#define forAll(list, i)
Loop across all elements in list.
const Map< label > & globalToLocalPointAddressing() const
Template functions to aid in the implementation of demand driven data.
std::map< label, plane > symmetryPlanes_
symmetry planes in the mesh
static bool & parRun()
Is this a parallel run?
label addFaceSubset(const word &)
~symmetryPlaneOptimisation()
void pointInPlanes(VRWGraph &) const
point-planes addressing
Ostream & endl(Ostream &os)
Add newline and flush stream.
const pointFieldPMG & points() const
access to points
label size() const
Size of the active part of the list.
const faceListPMG & faces() const
access to faces
const VRWGraph & pointAtProcs() const
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
Geometric class that creates a 2D plane and can return the intersection point between a line and the ...
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const DynList< label > & pointNeiProcs() const
void optimizeSymmetryPlanes()
move vertices to the symmetry planes
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
#define forAllRow(graph, rowI, index)
label sizeOfRow(const label rowI) const
Returns the number of elements in the given row.
label size() const
Return number of elements in table.
symmetryPlaneOptimisation(polyMeshGen &mesh)
Construct from mesh.
polyMeshGen & mesh_
reference to the mesh
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
bool checkFacePyramids(const polyMeshGen &, const bool report=false, const scalar minPyrVol=-SMALL, labelHashSet *setPtr=NULL, const boolList *changedFacePtr=NULL)
Check face pyramid volume.
void detectSymmetryPlanes()
detect symmetry planes
T & first()
Return reference to the first element of the list.
const PtrList< boundaryPatch > & boundaries() const
ordinary boundaries
void exchangeMap(const std::map< label, ListType > &m, LongList< T > &data, const Pstream::commsTypes commsType)
const dimensionedScalar c
Speed of light in a vacuum.
void addFaceToSubset(const label, const label)
A face is a list of labels corresponding to mesh vertices.
#define WarningIn(functionName)
Report a warning using Foam::Warning.