44 void Foam::pointConstraints::makePatchPatchAddressing()
48 Pout<<
"pointConstraints::makePatchPatchAddressing() : "
49 <<
"constructing boundary addressing"
53 const pointMesh& pMesh =
mesh();
54 const polyMesh&
mesh = pMesh();
56 const pointBoundaryMesh& pbm = pMesh.boundary();
57 const polyBoundaryMesh& bm =
mesh.boundaryMesh();
62 label nPatchPatchPoints = 0;
68 !isA<emptyPointPatch>(pbm[
patchi])
69 && !isA<wedgePointPatch>(pbm[
patchi])
75 nPatchPatchPoints += bp.
size();
80 <<
" nBoundaryPoints:" << bp.size() <<
endl;
87 Pout<<
indent <<
"Found nPatchPatchPoints:" << nPatchPatchPoints
96 Map<label> patchPatchPointSet(2*nPatchPatchPoints);
99 patchPatchPointConstraints_.setSize(nPatchPatchPoints, pointConstraint());
102 labelList patchPatchPoints(nPatchPatchPoints);
110 !isA<emptyPointPatch>(pbm[
patchi])
111 && !isA<wedgePointPatch>(pbm[
patchi])
120 label ppp = meshPoints[bp[pointi]];
124 label constraintI = -1;
126 if (iter == patchPatchPointSet.end())
128 patchPatchPointSet.insert(ppp, pppi);
129 patchPatchPoints[pppi] = ppp;
130 constraintI = pppi++;
134 constraintI = iter();
138 pbm[
patchi].applyConstraint
141 patchPatchPointConstraints_[constraintI]
149 Pout<<
indent <<
"Have (local) constrained points:"
150 << nPatchPatchPoints <<
endl;
159 const labelListList& globalPointSlaves = gd.globalPointSlaves();
160 const distributionMap& globalPointSlavesMap = gd.globalPointSlavesMap();
161 const Map<label>& cpPointMap = gd.coupledPatch().meshPointMap();
162 const labelList& cpMeshPoints = gd.coupledPatch().meshPoints();
165 List<pointConstraint> constraints
167 globalPointSlavesMap.constructSize()
175 !isA<emptyPointPatch>(pbm[
patchi])
176 && !isA<wedgePointPatch>(pbm[
patchi])
185 label ppp = meshPoints[bp[pointi]];
188 if (fnd != cpPointMap.end())
192 constraints[fnd()] = patchPatchPointConstraints_
194 patchPatchPointSet[ppp]
202 globalPointSlavesMap.distribute(constraints);
205 forAll(globalPointSlaves, pointi)
207 const labelList& slaves = globalPointSlaves[pointi];
212 constraints[pointi].combine(constraints[slaves[i]]);
217 constraints[slaves[i]] = constraints[pointi];
222 globalPointSlavesMap.reverseDistribute
229 forAll(constraints, coupledPointi)
231 if (constraints[coupledPointi].
first() != 0)
233 label meshPointi = cpMeshPoints[coupledPointi];
237 label constraintI = -1;
239 if (iter == patchPatchPointSet.end())
249 if (patchPatchPoints.size() <= pppi)
251 patchPatchPoints.setSize(pppi+100);
253 patchPatchPointSet.insert(meshPointi, pppi);
254 patchPatchPoints[pppi] = meshPointi;
255 constraintI = pppi++;
266 constraintI = iter();
270 if (patchPatchPointConstraints_.size() <= constraintI)
272 patchPatchPointConstraints_.setSize
281 patchPatchPointConstraints_[constraintI].combine
283 constraints[coupledPointi]
290 nPatchPatchPoints = pppi;
291 patchPatchPoints.setSize(nPatchPatchPoints);
292 patchPatchPointConstraints_.setSize(nPatchPatchPoints);
297 Pout<<
indent <<
"Have (global) constrained points:"
298 << nPatchPatchPoints <<
endl;
305 patchPatchPointConstraintPoints_.
setSize(nPatchPatchPoints);
306 patchPatchPointConstraintTensors_.
setSize(nPatchPatchPoints);
308 label nConstraints = 0;
310 forAll(patchPatchPointConstraints_, i)
315 if (patchPatchPointConstraints_[i].
first() != 0)
317 patchPatchPointConstraintPoints_[nConstraints] =
320 patchPatchPointConstraintTensors_[nConstraints] =
321 patchPatchPointConstraints_[i].constraintTransformation();
329 Pout<<
indent <<
"Have non-trivial constrained points:"
330 << nConstraints <<
endl;
333 patchPatchPointConstraints_.setSize(nConstraints);
334 patchPatchPointConstraintPoints_.
setSize(nConstraints);
335 patchPatchPointConstraintTensors_.
setSize(nConstraints);
341 <<
"pointConstraints::makePatchPatchAddressing() : "
342 <<
"finished constructing boundary addressing"
361 Pout<<
"pointConstraints::pointConstraints(const pointMesh&): "
362 <<
"Constructing from pointMesh " << pm.
name()
366 makePatchPatchAddressing();
376 Pout<<
"pointConstraints::~pointConstraints()" <<
endl;
391 makePatchPatchAddressing();
397 makePatchPatchAddressing();
404 makePatchPatchAddressing();
411 const bool overrideFixedValue
420 syncUntransformedData
428 constrainCorners(pf);
438 if (overrideFixedValue)
446 void Foam::pointConstraints::constrainCorners<Foam::scalar>
448 PointField<scalar>& pf
454 void Foam::pointConstraints::constrainCorners<Foam::label>
456 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.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
#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.