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;
148 const labelListList& globalPointSlaves = gd.globalPointSlaves();
149 const distributionMap& 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"
345 Pout<<
"pointConstraints::pointConstraints(const pointMesh&): "
346 <<
"Constructing from pointMesh " << pm.
name()
350 makePatchPatchAddressing();
360 Pout<<
"pointConstraints::~pointConstraints()" <<
endl;
375 makePatchPatchAddressing();
381 makePatchPatchAddressing();
388 makePatchPatchAddressing();
395 const bool overrideFixedValue
404 syncUntransformedData
412 constrainCorners(pf);
422 if (overrideFixedValue)
430 void Foam::pointConstraints::constrainCorners<Foam::scalar>
432 PointField<scalar>& pf
438 void Foam::pointConstraints::constrainCorners<Foam::label>
440 PointField<label>& pf
#define forAll(list, i)
Loop across all elements in list.
Templated abstract base-class for demand-driven mesh objects used to automate their allocation to the...
const pointMesh & mesh() const
static twoDPointCorrector & New(const word &name, const polyMesh &mesh)
Construct and return the named DemandDrivenMeshObject.
const Mesh & mesh() const
Return mesh.
Internal::FieldType & primitiveFieldRef()
Return a reference to the primitive field.
void correctBoundaryConditions()
Correct boundary field.
friend class iterator
Declare friendship with the iterator.
friend class const_iterator
Declare friendship with the const_iterator.
const word & name() const
Return name.
virtual const fileName & name() const
Return the name of the stream.
void size(const label)
Override size to be inconsistent with allocated storage.
void setSize(const label)
Reset size of List.
Application of (multi-)patch point constraints.
virtual bool movePoints()
Correct weighting factors for moving mesh.
pointConstraints(const pointMesh &)
Constructor from pointMesh.
virtual void topoChange(const polyTopoChangeMap &)
Update mesh topology using the morph engine.
virtual void distribute(const polyDistributionMap &)
Update corresponding to the given distribution map.
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
~pointConstraints()
Destructor.
void constrainDisplacement(pointVectorField &displacement, const bool overrideValue=false) const
Apply boundary conditions (single-patch constraints),.
Mesh representing a set of points created from polyMesh.
const globalMeshData & globalData() const
Return parallel info.
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
Class containing mesh-to-mesh mapping information.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
void correctDisplacement(const pointField &p, vectorField &disp) const
Correct motion displacements.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Ostream & decrIndent(Ostream &os)
Decrement the indent level.
List< label > labelList
A List of labels.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
errorManip< error > abort(error &err)
Ostream & incrIndent(Ostream &os)
Increment the indent level.
labelList first(const UList< labelPair > &p)
List< labelList > labelListList
A List of labelList.
defineTypeNameAndDebug(combustionModel, 0)
prefixOSstream Pout(cout, "Pout")
Ostream & indent(Ostream &os)
Indent stream.