45bool Foam::polyTopoChanger::readIOcontents()
49 PtrList<polyMeshModifier>& modifiers = *
this;
54 PtrList<entry> entries(is);
55 modifiers.resize_null(entries.size());
57 forAll(modifiers, modifieri)
64 entries[modifieri].keyword(),
65 entries[modifieri].
dict(),
83Foam::polyTopoChanger::polyTopoChanger
100Foam::polyTopoChanger::polyTopoChanger
111 mesh.time().findInstance
155 bool triggerChange =
false;
157 forAll(topoChanges, morphI)
159 if (topoChanges[morphI].active())
161 bool curTriggerChange = topoChanges[morphI].changeTopology();
165 Info<<
"Modifier " << morphI <<
" named "
166 << topoChanges[morphI].name();
168 if (curTriggerChange)
178 triggerChange = triggerChange || curTriggerChange;
184 Info<<
"Modifier " << morphI <<
" named "
185 << topoChanges[morphI].name() <<
" inactive" <<
endl;
191 return triggerChange;
199 const PtrList<polyMeshModifier>& topoChanges = *
this;
202 polyTopoChange&
ref = ptr.ref();
204 forAll(topoChanges, morphI)
206 if (topoChanges[morphI].active())
208 topoChanges[morphI].setRefinement(
ref);
220 forAll(topoChanges, morphI)
222 if (topoChanges[morphI].active())
224 topoChanges[morphI].modifyMotionPoints(
p);
235 forAll(topoChanges, morphI)
237 topoChanges[morphI].updateMesh(m);
251 const bool syncParallel,
252 const bool orderCells,
253 const bool orderPoints
256 if (changeTopology())
270 mesh_.updateMesh(topoChangeMap());
271 return topoChangeMap;
274 mesh_.topoChanging(
false);
281 const List<polyMeshModifier*>& tm
289 if (tm[tmI]->topoChanger() != *
this)
292 <<
"Mesh modifier created with different mesh reference."
307 const PtrList<polyMeshModifier>& topoChanges = *
this;
309 forAll(topoChanges, morphI)
311 if (topoChanges[morphI].
name() == modName)
321 <<
"List of available modifier names: " <<
names() <<
endl;
358 mme[mmeI].writeDict(
os);
Functions to operate on Pointer Lists.
A simple container of IOobject preferences. Can also be used for general handling of read/no-read/rea...
bool isReadOptional() const noexcept
True if (LAZY_READ) bits are set [same as READ_IF_PRESENT].
bool isReadRequired() const noexcept
True if (MUST_READ | READ_MODIFIED) bits are set.
writeOption writeOpt() const noexcept
Get the write option.
readOption
Enumeration defining read preferences.
@ NO_READ
Nothing to be read.
@ READ_IF_PRESENT
Reading is optional [identical to LAZY_READ].
@ LAZY_READ
Reading is optional [identical to READ_IF_PRESENT].
@ NO_WRITE
Ignore writing from objectRegistry::writeObject().
@ AUTO_WRITE
Automatically write from objectRegistry::writeObject().
Defines the attributes of an object for which implicit objectRegistry management is supported,...
const Time & time() const noexcept
Return Time associated with the objectRegistry.
void warnNoRereading() const
Helper: warn that type does not support re-reading.
const fileName & instance() const noexcept
Read access to instance path component.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
const polyMeshModifier * set(const label i) const
constexpr PtrList() noexcept
void size(const label n)
Older name for setAddressableSize.
label size() const noexcept
The number of entries in the list.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
static autoPtr< T > New(Args &&... args)
Construct autoPtr with forwarding arguments.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Virtual base class for mesh modifiers.
static autoPtr< polyMeshModifier > New(const word &name, const dictionary &dict, const label index, const polyTopoChanger &mme)
Select constructed from dictionary.
Mesh consisting of general polyhedral cells.
Direct mesh changes based on v1.3 polyTopoChange syntax.
List of mesh modifiers defining the mesh dynamics.
bool operator==(const polyTopoChanger &) const
bool writeData(Ostream &) const
writeData member function required by regIOobject
label findModifierID(const word &modName) const
Find modifier given a name.
autoPtr< polyTopoChange > topoChangeRequest() const
Return topology change request.
const polyMesh & mesh() const
Return the mesh reference.
void addTopologyModifiers(const List< polyMeshModifier * > &tm)
Add given set of topology modifiers to the topoChanger.
wordList types() const
Return a list of patch types.
polyMesh & mesh_
Reference to mesh.
bool changeTopology() const
Is topology change required.
autoPtr< mapPolyMesh > changeMesh(const bool inflate, const bool syncParallel=true, const bool orderCells=false, const bool orderPoints=false)
bool operator!=(const polyTopoChanger &) const
void update(const mapPolyMesh &m)
Force recalculation of locally stored data on topological change.
wordList names() const
Return a list of patch names.
void modifyMotionPoints(pointField &) const
Modify point motion.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
void close()
Close Istream.
regIOobject(const IOobject &io, const bool isTimeObject=false)
Construct from IOobject. The optional flag adds special handling if the object is the top-level regIO...
bool headerOk()
Read and check header info. Does not check the headerClassName.
@ BEGIN_LIST
Begin list [isseparator].
@ END_LIST
End list [isseparator].
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
OBJstream os(runTime.globalPath()/outputName)
#define WarningInFunction
Report a warning using Foam::Warning.
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
List of values generated by applying the access operation to each list item.
Namespace for handling debugging switches.
List< word > wordList
List of word.
messageStream Info
Information stream (stdout output on master, null elsewhere).
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces).
const word GlobalIOList< Tuple2< scalar, vector > >::typeName("scalarVectorTable")
Ostream & endl(Ostream &os)
Add newline and flush stream.
errorManip< error > abort(error &err)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
vectorField pointField
pointField is a vectorField.
constexpr char nl
The newline '\n' character (0x0a).
points setSize(newPointi)
#define forAll(list, i)
Loop across all elements in list.
Extract type (as a word) from an object, typically using its type() method.