49 class CloudStateField;
52 class CloudDerivedField;
55 class CloudAverageField;
76 #define DECLARE_STATE_FIELDS(Type, nullArg) \
77 mutable PtrList<CloudStateField<Type>> \
78 CAT3(state, CAPITALIZE(Type), Fields_);
80 #undef DECLARE_STATE_FIELDS
83 #define DECLARE_DERIVED_FIELDS(Type, nullArg) \
84 mutable PtrList<CloudDerivedField<Type>> \
85 CAT3(derived, CAPITALIZE(Type), Fields_);
87 #undef DECLARE_DERIVED_FIELDS
90 #define DECLARE_AVERAGE_FIELDS(Type, nullArg) \
91 mutable PtrList<CloudAverageField<Type>> \
92 CAT3(average, CAPITALIZE(Type), Fields_);
94 #undef DECLARE_AVERAGE_FIELDS
97 autoPtr<LagrangianLabelDynamicField> statePtr_;
106 static LagrangianMesh&
mesh
108 const polyMesh& pMesh,
116 PtrList<CloudStateField<Type>>& stateFields()
const;
119 void clearStateFields();
123 PtrList<CloudDerivedField<Type>>& derivedFields()
const;
126 void clearDerivedFields(
const bool final);
130 PtrList<CloudAverageField<Type>>& averageFields()
const;
133 void removeFromAverageFields(
const LagrangianSubMesh&);
136 void addToAverageFields(
const LagrangianSubMesh&,
const bool final);
139 void correctAverageFields(
const LagrangianSubMesh&,
const bool final);
142 void clearAverageFields();
145 void resetAverageFields();
152 autoPtr<LagrangianLabelDynamicField> readStates()
const;
156 autoPtr<List<LagrangianState>> initialStates()
const;
165 void storeStates(
const LagrangianSubMesh& subMesh);
168 tmp<LagrangianSubScalarField> cellLengthScale
170 const LagrangianSubMesh& subMesh
177 const scalar maxTimeStepFraction,
178 const scalar maxCellLengthScaleFraction
182 virtual bool writeData(Ostream&)
const;
292 template<
class Type,
class ... Args>
299 template<
class Type,
class ... Args>
306 template<
class Type,
class ... Args>
316 virtual void solve();
#define DECLARE_STATE_FIELDS(Type, nullArg)
State fields.
#define DECLARE_AVERAGE_FIELDS(Type, nullArg)
Average fields.
#define DECLARE_DERIVED_FIELDS(Type, nullArg)
Derived fields.
A cloud field that is averaged and then interpolated back to the cloud. Uses CloudDerivedField to pro...
A field derived from other state fields of the cloud. Stores and virtualises a function or a method w...
A field which is stored as part of the state of the cloud. This is a light wrapper around a dynamic L...
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
readOption
Enumeration defining the read options.
IOobject(const word &name, const fileName &instance, const objectRegistry ®istry, readOption r=NO_READ, writeOption w=NO_WRITE, bool registerObject=true)
Construct from name, instance, registry, io options.
const word & name() const
Return name.
writeOption
Enumeration defining the write options.
Class containing Lagrangian geometry and topology.
List of Lagrangian models, constructed as a (Lagrangian) mesh object. Provides similar functions to t...
Mesh that relates to a sub-section of a Lagrangian mesh. This is used to construct fields that relate...
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Base class for clouds. Provides a basic evolution algorithm, models, and a database for caching deriv...
CloudStateField< Type > & stateField(const Args &... args) const
Add/get a state field to/from the cache.
declareRunTimeSelectionTable(autoPtr, cloud, polyMesh,(const polyMesh &mesh, const word &name, const contextType context),(mesh, name, context))
Declare run-time constructor selection table.
contextType
Context in which this cloud is used.
CloudStateField< vector > & U
Velocity.
virtual void initialise(const bool predict)
Initialisation hook.
cloud(const polyMesh &mesh, const word &name, const contextType context, const IOobject::readOption readOption=IOobject::READ_IF_PRESENT, const IOobject::writeOption writeOption=IOobject::AUTO_WRITE)
Construct from a mesh and a name.
virtual void topoChange(const polyTopoChangeMap &)
Update topology using the given map.
virtual void distribute(const polyDistributionMap &)
Redistribute or update using the given distribution map.
TypeName("cloud")
Run-time type information.
const CloudDerivedField< Type > & derivedField(const Args &... args) const
Add/get a derived field to/from the cache.
virtual void storePosition()
Store the positions for use during mapping.
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
Foam::LagrangianModels & LagrangianModels() const
Access the models.
static autoPtr< cloud > New(const polyMesh &mesh, const word &name, const word &type)
Selector.
virtual void movePoints(const polyMesh &)
Update for mesh motion.
const CloudAverageField< Type > & averageField(const Args &... args) const
Add/get an average field to/from the cache.
enum Foam::cloud::contextType context
trackingType
Tracking method.
static const Foam::cloud & lookup(const LagrangianMesh &mesh)
Lookup the cloud associated with a mesh.
virtual ~cloud()
Destructor.
virtual tmp< LagrangianSubVectorField > dUdt(const LagrangianSubMesh &) const =0
Return the acceleration with which to do second-order tracking.
void operator=(const LagrangianMesh &)=delete
Disallow default bitwise assignment.
enum Foam::cloud::trackingType tracking
virtual void partition()
Partition hook.
virtual bool reCalculateModified()=0
Do we need to re-calculate particles that are modified?
virtual void calculate(const LagrangianSubScalarField &deltaT, const bool final)
Update the cloud properties.
const LagrangianMesh & mesh() const
Access the mesh.
virtual void solve()
Solve the cloud's evolution over the current time-step.
Finite volume model abstract base class.
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.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
A class for managing temporary objects.
A class for handling words, derived from string.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
LagrangianSubSubField< scalar > LagrangianSubScalarSubField
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Foam::argList args(argc, argv)