25template<
typename ValueType>
120 std::string fieldName,
126 std::string collectionName
141 boundaryConditions_(other.boundaryConditions_), db_(other.db_)
152 for (
auto& boundaryCondition : boundaryConditions_)
154 boundaryCondition.correctBoundaryCondition(this->
field_);
172 if (!db_.has_value())
174 throw std::runtime_error(
175 "Database not set: make sure the field is registered in the database"
188 if (!db_.has_value())
190 throw std::runtime_error(
191 "Database not set: make sure the field is registered in the database"
206 return boundaryConditions_;
214 std::vector<VolumeBoundary<ValueType>> boundaryConditions_;
215 std::optional<Database*> db_;
Represents the boundary fields for a computational domain.
Represents the domain fields for a computational domain.
A class to contain the data and executors for a field and define some basic operations.
Represents an unstructured mesh in NeoFOAM.
This class represents a mixin for a geometric field.
const UnstructuredMesh & mesh() const
Returns a const reference to the unstructured mesh object.
const Executor & exec() const
Returns a const reference to the executor object.
const Field< ValueType > & internalField() const
Returns a const reference to the internal field.
DomainField< ValueType > field_
Represents a volume boundary field for a cell-centered finite volume method.
Represents a volume field in a finite volume method.
VolumeField(const Executor &exec, std::string name, const UnstructuredMesh &mesh, const Field< ValueType > &internalField, const BoundaryFields< ValueType > &boundaryFields, const std::vector< VolumeBoundary< ValueType > > &boundaryConditions)
Constructor for a VolumeField with a given internal and boundary field.
Database & db()
Retrieves the database.
bool hasDatabase() const
Returns true if the field has a database, false otherwise.
const Database & db() const
Retrieves the database.
VolumeField(const VolumeField &other)
void correctBoundaryConditions()
Corrects the boundary conditions of the surface field.
VolumeField(const Executor &exec, std::string name, const UnstructuredMesh &mesh, const std::vector< VolumeBoundary< ValueType > > &boundaryConditions)
Constructor for a uninitialized VolumeField.
std::vector< VolumeBoundary< ValueType > > boundaryConditions() const
bool registered() const
Returns true if the field is registered in the database, false otherwise.
std::string fieldCollectionName
VolumeField(const Executor &exec, std::string fieldName, const UnstructuredMesh &mesh, const Field< ValueType > &internalField, const std::vector< VolumeBoundary< ValueType > > &boundaryConditions, Database &db, std::string dbKey, std::string collectionName)
Constructor for a VolumeField with a given internal field and database.
VolumeField(const Executor &exec, std::string name, const UnstructuredMesh &mesh, const Field< ValueType > &internalField, const std::vector< VolumeBoundary< ValueType > > &boundaryConditions)
Constructor for a VolumeField with a given internal field.
std::variant< SerialExecutor, CPUExecutor, GPUExecutor > Executor