43 void Foam::pointConstraints::makePatchPatchAddressing()
47 Pout<<
"pointConstraints::makePatchPatchAddressing() : " 48 <<
"constructing boundary addressing" 52 const pointMesh& pMesh =
mesh();
53 const polyMesh& mesh = pMesh();
55 const pointBoundaryMesh& pbm = pMesh.boundary();
56 const polyBoundaryMesh& bm = mesh.boundaryMesh();
61 label nPatchPatchPoints = 0;
65 if (!isA<emptyPointPatch>(pbm[patchi]) && !pbm[patchi].coupled())
69 nPatchPatchPoints += bp.
size();
74 <<
" nBoundaryPoints:" << bp.size() <<
endl;
81 Pout<<
indent <<
"Found nPatchPatchPoints:" << nPatchPatchPoints
90 Map<label> patchPatchPointSet(2*nPatchPatchPoints);
93 patchPatchPointConstraints_.setSize(nPatchPatchPoints, pointConstraint());
96 labelList patchPatchPoints(nPatchPatchPoints);
102 if (!isA<emptyPointPatch>(pbm[patchi]) && !pbm[patchi].coupled())
109 label ppp = meshPoints[bp[pointi]];
113 label constraintI = -1;
115 if (iter == patchPatchPointSet.end())
117 patchPatchPointSet.insert(ppp, pppi);
118 patchPatchPoints[pppi] = ppp;
119 constraintI = pppi++;
123 constraintI = iter();
127 pbm[
patchi].applyConstraint
130 patchPatchPointConstraints_[constraintI]
138 Pout<<
indent <<
"Have (local) constrained points:" 139 << nPatchPatchPoints <<
endl;
147 const globalMeshData& gd = mesh.globalData();
148 const labelListList& globalPointSlaves = gd.globalPointSlaves();
149 const mapDistribute& globalPointSlavesMap = gd.globalPointSlavesMap();
150 const Map<label>& cpPointMap = gd.coupledPatch().meshPointMap();
151 const labelList& cpMeshPoints = gd.coupledPatch().meshPoints();
154 List<pointConstraint> constraints
156 globalPointSlavesMap.constructSize()
162 if (!isA<emptyPointPatch>(pbm[patchi]) && !pbm[patchi].coupled())
169 label ppp = meshPoints[bp[pointi]];
172 if (fnd != cpPointMap.end())
176 constraints[fnd()] = patchPatchPointConstraints_
178 patchPatchPointSet[ppp]
186 globalPointSlavesMap.distribute(constraints);
189 forAll(globalPointSlaves, pointi)
191 const labelList& slaves = globalPointSlaves[pointi];
196 constraints[pointi].combine(constraints[slaves[i]]);
201 constraints[slaves[i]] = constraints[pointi];
206 globalPointSlavesMap.reverseDistribute
213 forAll(constraints, coupledPointi)
215 if (constraints[coupledPointi].first() != 0)
217 label meshPointi = cpMeshPoints[coupledPointi];
221 label constraintI = -1;
223 if (iter == patchPatchPointSet.end())
233 if (patchPatchPoints.size() <= pppi)
235 patchPatchPoints.setSize(pppi+100);
237 patchPatchPointSet.insert(meshPointi, pppi);
238 patchPatchPoints[pppi] = meshPointi;
239 constraintI = pppi++;
250 constraintI = iter();
254 if (patchPatchPointConstraints_.size() <= constraintI)
256 patchPatchPointConstraints_.setSize
265 patchPatchPointConstraints_[constraintI].combine
267 constraints[coupledPointi]
274 nPatchPatchPoints = pppi;
275 patchPatchPoints.setSize(nPatchPatchPoints);
276 patchPatchPointConstraints_.setSize(nPatchPatchPoints);
281 Pout<<
indent <<
"Have (global) constrained points:" 282 << nPatchPatchPoints <<
endl;
289 patchPatchPointConstraintPoints_.setSize(nPatchPatchPoints);
290 patchPatchPointConstraintTensors_.setSize(nPatchPatchPoints);
292 label nConstraints = 0;
294 forAll(patchPatchPointConstraints_, i)
299 if (patchPatchPointConstraints_[i].first() != 0)
301 patchPatchPointConstraintPoints_[nConstraints] =
304 patchPatchPointConstraintTensors_[nConstraints] =
305 patchPatchPointConstraints_[i].constraintTransformation();
313 Pout<<
indent <<
"Have non-trivial constrained points:" 314 << nConstraints <<
endl;
317 patchPatchPointConstraints_.setSize(nConstraints);
318 patchPatchPointConstraintPoints_.setSize(nConstraints);
319 patchPatchPointConstraintTensors_.setSize(nConstraints);
325 <<
"pointConstraints::makePatchPatchAddressing() : " 326 <<
"finished constructing boundary addressing" 340 Pout<<
"pointConstraints::pointConstraints(const pointMesh&): " 341 <<
"Constructing from pointMesh " << pm.
name()
345 makePatchPatchAddressing();
355 Pout<<
"pointConstraints::~pointConstraints()" <<
endl;
364 makePatchPatchAddressing();
377 const bool overrideFixedValue
404 if (overrideFixedValue)
412 void Foam::pointConstraints::constrainCorners<Foam::scalar>
414 GeometricField<scalar, pointPatchField, pointMesh>& pf
420 void Foam::pointConstraints::constrainCorners<Foam::label>
422 GeometricField<label, pointPatchField, pointMesh>& pf
List< labelList > labelListList
A List of labelList.
#define forAll(list, i)
Loop across all elements in list.
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 word & name() const
Return name.
Ostream & indent(Ostream &os)
Indent stream.
HashTable< label, label, Hash< label > >::iterator iterator
void size(const label)
Override size to be inconsistent with allocated storage.
void constrainDisplacement(pointVectorField &displacement, const bool overrideValue=false) const
Apply boundary conditions (single-patch constraints),.
bool movePoints()
Correct weighting factors for moving mesh.
Ostream & endl(Ostream &os)
Add newline and flush stream.
HashTable< label, label, Hash< label > >::const_iterator const_iterator
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
pointConstraints(const pointMesh &)
Constructor from pointMesh.
Mesh representing a set of points created from polyMesh.
Application of (multi-)patch point constraints.
Templated abstract base-class for optional mesh objects used to automate their allocation to the mesh...
void correctDisplacement(const pointField &p, vectorField &disp) const
Correct motion displacements.
static void syncUntransformedData(const polyMesh &mesh, List< Type > &pointData, const CombineOp &cop)
Helper: sync data on collocated points only.
void constrainCorners(GeometricField< Type, pointPatchField, pointMesh > &pf) const
Apply patch-patch constraints only.
virtual const fileName & name() const
Return the name of the stream.
static void setPatchFields(GeometricField< Type, pointPatchField, pointMesh > &)
Helper: set patchField values from internal values (on.
List< label > labelList
A List of labels.
Internal::FieldType & primitiveFieldRef()
Return a reference to the internal field.
const Mesh & mesh() const
Return mesh.
defineTypeNameAndDebug(combustionModel, 0)
static twoDPointCorrector & New(polyMesh &mesh)
Ostream & decrIndent(Ostream &os)
Decrement the indent level.
const pointMesh & mesh() const
void updateMesh(const mapPolyMesh &)
Update mesh topology using the morph engine.
prefixOSstream Pout(cout, "Pout")
void correctBoundaryConditions()
Correct boundary field.
Ostream & incrIndent(Ostream &os)
Increment the indent level.
~pointConstraints()
Destructor.