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);
94 patchPatchPointConstraints_ = pointConstraint();
97 labelList patchPatchPoints(nPatchPatchPoints);
103 if (!isA<emptyPointPatch>(pbm[patchi]) && !pbm[patchi].coupled())
110 label ppp = meshPoints[bp[pointi]];
114 label constraintI = -1;
116 if (iter == patchPatchPointSet.end())
118 patchPatchPointSet.insert(ppp, pppi);
119 patchPatchPoints[pppi] = ppp;
120 constraintI = pppi++;
124 constraintI = iter();
128 pbm[
patchi].applyConstraint
131 patchPatchPointConstraints_[constraintI]
139 Pout<<
indent <<
"Have (local) constrained points:" 140 << nPatchPatchPoints <<
endl;
148 const globalMeshData& gd = mesh.globalData();
149 const labelListList& globalPointSlaves = gd.globalPointSlaves();
150 const mapDistribute& globalPointSlavesMap = gd.globalPointSlavesMap();
151 const Map<label>& cpPointMap = gd.coupledPatch().meshPointMap();
152 const labelList& cpMeshPoints = gd.coupledPatch().meshPoints();
155 List<pointConstraint> constraints
157 globalPointSlavesMap.constructSize()
163 if (!isA<emptyPointPatch>(pbm[patchi]) && !pbm[patchi].coupled())
170 label ppp = meshPoints[bp[pointi]];
173 if (fnd != cpPointMap.end())
177 constraints[fnd()] = patchPatchPointConstraints_
179 patchPatchPointSet[ppp]
187 globalPointSlavesMap.distribute(constraints);
190 forAll(globalPointSlaves, pointi)
192 const labelList& slaves = globalPointSlaves[pointi];
197 constraints[pointi].combine(constraints[slaves[i]]);
202 constraints[slaves[i]] = constraints[pointi];
207 globalPointSlavesMap.reverseDistribute
214 forAll(constraints, coupledPointi)
216 if (constraints[coupledPointi].first() != 0)
218 label meshPointi = cpMeshPoints[coupledPointi];
222 label constraintI = -1;
224 if (iter == patchPatchPointSet.end())
234 if (patchPatchPoints.size() <= pppi)
236 patchPatchPoints.setSize(pppi+100);
238 patchPatchPointSet.insert(meshPointi, pppi);
239 patchPatchPoints[pppi] = meshPointi;
240 constraintI = pppi++;
251 constraintI = iter();
256 patchPatchPointConstraints_[constraintI].combine
258 constraints[coupledPointi]
266 nPatchPatchPoints = pppi;
267 patchPatchPoints.setSize(nPatchPatchPoints);
268 patchPatchPointConstraints_.setSize(nPatchPatchPoints);
273 Pout<<
indent <<
"Have (global) constrained points:" 274 << nPatchPatchPoints <<
endl;
281 patchPatchPointConstraintPoints_.setSize(nPatchPatchPoints);
282 patchPatchPointConstraintTensors_.setSize(nPatchPatchPoints);
284 label nConstraints = 0;
286 forAll(patchPatchPointConstraints_, i)
291 if (patchPatchPointConstraints_[i].first() != 0)
293 patchPatchPointConstraintPoints_[nConstraints] =
296 patchPatchPointConstraintTensors_[nConstraints] =
297 patchPatchPointConstraints_[i].constraintTransformation();
305 Pout<<
indent <<
"Have non-trivial constrained points:" 306 << nConstraints <<
endl;
309 patchPatchPointConstraints_.setSize(nConstraints);
310 patchPatchPointConstraintPoints_.setSize(nConstraints);
311 patchPatchPointConstraintTensors_.setSize(nConstraints);
317 <<
"pointConstraints::makePatchPatchAddressing() : " 318 <<
"finished constructing boundary addressing" 332 Pout<<
"pointConstraints::pointConstraints(const pointMesh&): " 333 <<
"Constructing from pointMesh " << pm.
name()
337 makePatchPatchAddressing();
347 Pout<<
"pointConstraints::~pointConstraints()" <<
endl;
356 makePatchPatchAddressing();
369 const bool overrideFixedValue
396 if (overrideFixedValue)
404 void Foam::pointConstraints::constrainCorners<Foam::scalar>
406 GeometricField<scalar, pointPatchField, pointMesh>& pf
412 void Foam::pointConstraints::constrainCorners<Foam::label>
414 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.
static const twoDPointCorrector & New(const polyMesh &mesh)
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)
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.