35 namespace pointMeshMovers
49 void Foam::pointMeshMovers::multiSolidBody::updateZonePointIndices()
51 forAll(zoneIndices_, zonei)
53 const cellZone& zoneCells =
poly().
cellZones()[zoneIndices_[zonei]];
57 forAll(zoneCells, zoneCelli)
59 const cell&
c =
poly().
cells()[zoneCells[zoneCelli]];
65 pointInZone[
f[fpi]] =
true;
75 if (pointInZone[celli])
77 zonePoints.append(celli);
81 zonePoints_[zonei].
transfer(zonePoints);
86 forAll(zoneIndices_, zonei)
88 forAll(zonePoints_[zonei], zonePointi)
90 const label pointi = zonePoints_[zonei][zonePointi];
92 pointZone[pointi] == -1 || pointZone[pointi] == zonei
105 if (errorPointi != -1)
108 <<
"Point " << errorPointi <<
" at " <<
poly().
points()[errorPointi]
109 <<
" is in multiple moving zones. This is not allowed."
126 SBMFs_.setSize(
dict.size());
130 if (!iter().isDict())
continue;
134 if (zoneIndices_[zonei] == -1)
137 <<
"Cannot find cellZone named " << iter().keyword()
153 SBMFs_.setSize(zonei);
156 updateZonePointIndices();
158 transforms_.setSize(zonei);
159 forAll(zoneIndices_, zonei)
161 transforms_[zonei] = SBMFs_[zonei].transformation();
164 forAll(zoneIndices_, zonei)
166 Info<<
"Applying solid-body motion " << SBMFs_[zonei].type()
186 forAll(zoneIndices_, zonei)
188 transforms_[zonei] = SBMFs_[zonei].transformation();
198 return ttransformedPts;
207 updateZonePointIndices();
215 forAll(zoneIndices_, zonei)
217 forAll(zonePoints_[zonei], zonePointi)
219 const label pointi = zonePoints_[zonei][zonePointi];
226 <<
"Cannot determine co-ordinates of introduced points."
227 <<
" New point " << pointi <<
" at " <<
points[pointi]
233 newPoints0[pointi] = points0_[oldPointi];
238 transforms_[zonei].invTransformPoint(
points[pointi]);
243 twoDCorrectPoints(newPoints0);
246 points0_.transfer(newPoints0);
248 points0_.instance() = poly().time().name();
259 updateZonePointIndices();
267 updateZonePointIndices();
271 forAll(zoneIndices_, zonei)
273 forAll(zonePoints_[zonei], zonePointi)
275 const label pointi = zonePoints_[zonei][zonePointi];
278 transforms_[zonei].invTransformPoint(points0[pointi]);
282 twoDCorrectPoints(points0);
285 points0_.instance() = poly().time().name();
#define forAll(list, i)
Loop across all elements in list.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
Macros for easy insertion into run-time selection tables.
wordList toc() const
Return the table of contents.
const word & name() const
Return name.
void transfer(List< T > &)
Transfer the contents of the argument List into this list.
void setSize(const label)
Reset size of List.
label findIndex(const word &key) const
Return the index of the given the key or -1 if not found.
A List with indirect addressing.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
const Time & time() const
Return the top-level database.
Abstract base class for pointMesh movers.
const polyMesh & poly() const
Return reference to mesh.
virtual void distribute(const polyDistributionMap &)
Update corresponding to the given distribution map.
virtual void mapMesh(const polyMeshMap &)=0
Update from another mesh using the given map.
Solid-body motion of the mesh parts specified by a run-time selectable motion functions.
virtual void topoChange(const polyTopoChangeMap &)
Update local data for topology changes.
virtual void distribute(const polyDistributionMap &)
Update corresponding to the given distribution map.
virtual tmp< pointField > newPoints()
Return point location obtained from the current motion field.
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
~multiSolidBody()
Destructor.
multiSolidBody(const polyMesh &, const dictionary &)
Construct from mesh and dictionary.
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
Class containing mesh-to-mesh mapping information.
Mesh consisting of general polyhedral cells.
const cellZoneList & cellZones() const
Return cell zones.
virtual const faceList & faces() const
Return raw faces.
virtual const pointField & points() const
Return raw points.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
const labelList & reversePointMap() const
Reverse point map.
const labelList & pointMap() const
Old point map.
const cellList & cells() const
static autoPtr< solidBodyMotionFunction > New(const dictionary &SBMFCoeffs, const Time &runTime, const word &name="solidBodyMotionFunction")
Select constructed from the SBMFCoeffs dictionary and Time.
A class for managing temporary objects.
T & ref() const
Return non-const reference or generate a fatal error.
Template function which returns the un-mangled name of a given type. Useful for types which do not ha...
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const dimensionedScalar c
Speed of light in a vacuum.
addToRunTimeSelectionTable(pointMeshMover, externalDisplacement, dictionary)
defineTypeNameAndDebug(externalDisplacement, 0)
errorManipArg< error, int > exit(error &err, const int errNo=1)
List< label > labelList
A List of labels.
void transformPoints(vectorField &, const spatialTransform &, const vectorField &)
Transform given vectorField of coordinates with the given spatialTransform.
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.
vectorField pointField
pointField is a vectorField.
List< bool > boolList
Bool container classes.
label findIndex(const ListType &, typename ListType::const_reference, const label start=0)
Find first occurrence of given element and return index,.