25template<
typename ValueType>
44 std::string fieldName,
99 std::string fieldName,
105 std::string collectionName
136 if (!db_.has_value())
138 throw std::runtime_error {
139 "Database not set: make sure the field is registered in the database"
152 if (!db_.has_value())
154 throw std::runtime_error(
155 "Database not set: make sure the field is registered in the database"
170 return boundaryConditions_;
178 std::vector<VolumeBoundary<ValueType>> boundaryConditions_;
179 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.
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 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.
VolumeField< ValueType > & operator+=(const ValueType rhs)
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.
VolumeField< ValueType > & operator-=(const ValueType rhs)
VolumeField(const Executor &exec, std::string fieldName, const UnstructuredMesh &mesh, const std::vector< VolumeBoundary< ValueType > > &boundaryConditions)
Constructor for a uninitialized VolumeField.
std::variant< SerialExecutor, CPUExecutor, GPUExecutor > Executor