25template<
typename ValueType>
114 std::string fieldName,
120 std::string collectionName
129 boundaryConditions_(other.boundaryConditions_), db_(other.db_)
140 for (
auto& boundaryCondition : boundaryConditions_)
142 boundaryCondition.correctBoundaryCondition(this->
field_);
160 if (!db_.has_value())
162 throw std::runtime_error {
163 "Database not set: make sure the field is registered in the database"
176 if (!db_.has_value())
178 throw std::runtime_error(
179 "Database not set: make sure the field is registered in the database"
194 return boundaryConditions_;
202 std::vector<VolumeBoundary<ValueType>> boundaryConditions_;
203 std::optional<Database*> db_;
Represents the boundary fields for a computational domain.
Represents the domain fields for a computational domain.
Represents an unstructured mesh in NeoN.
A class to contain the data and executors for a field and define some basic operations.
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 Vector< ValueType > & internalVector() const
Returns a const reference to the internal field.
Field< ValueType > field_
Represents a volume boundary field for a cell-centered finite volume method.
Represents a volume field in a finite volume method.
Database & db()
Retrieves the database.
VolumeField(const Executor &exec, std::string name, const UnstructuredMesh &mesh, const std::vector< VolumeBoundary< ValueType > > &boundaryConditions)
Constructor for a uninitialized VolumeField.
VolumeField(const VolumeField &other)
VolumeField(const Executor &exec, std::string name, const UnstructuredMesh &mesh, const Vector< ValueType > &internalVector, const std::vector< VolumeBoundary< ValueType > > &boundaryConditions)
Constructor for a VolumeField with a given internal field.
const Database & db() const
Retrieves the database.
bool hasDatabase() const
Returns true if the field has a database, false otherwise.
void correctBoundaryConditions()
Corrects the boundary conditions of the surface field.
std::string fieldCollectionName
bool registered() const
Returns true if the field is registered in the database, false otherwise.
std::vector< VolumeBoundary< ValueType > > boundaryConditions() const
VolumeField(const Executor &exec, std::string fieldName, const UnstructuredMesh &mesh, const Field< ValueType > &domainVector, 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.
ValueType VectorValueType
VolumeField(const Executor &exec, std::string name, const UnstructuredMesh &mesh, const Vector< ValueType > &internalVector, const BoundaryData< ValueType > &boundaryVectors, const std::vector< VolumeBoundary< ValueType > > &boundaryConditions)
Constructor for a VolumeField with a given internal and boundary field.
std::variant< SerialExecutor, CPUExecutor, GPUExecutor > Executor