6#include <Kokkos_Core.hpp>
19template<
typename ValueType>
23 std::pair<size_t, size_t> range,
35 KOKKOS_LAMBDA(
const size_t i) {
36 refValue[i] = fixedValue;
37 value[i] = fixedValue;
38 internalValues[nInternalFaces + i] = fixedValue;
44template<
typename ValueType>
53 : Base(mesh, dict, patchID), mesh_(mesh), fixedValue_(dict.get<ValueType>(
"fixedValue"))
61 static std::string
name() {
return "fixedValue"; }
63 static std::string
doc() {
return "Set a fixed value on the boundary"; }
65 static std::string
schema() {
return "none"; }
67 virtual std::unique_ptr<SurfaceBoundaryFactory<ValueType>>
clone()
const override
69 return std::make_unique<FixedValue>(*
this);
75 ValueType fixedValue_;
const NeoFOAM::Field< T > & value() const
Get the view storing the computed values from the boundary condition.
const NeoFOAM::Field< T > & refValue() const
Get the view storing the Dirichlet boundary values.
A class representing a dictionary that stores key-value pairs.
Represents the domain fields for a computational domain.
const Executor & exec() const
const BoundaryFields< ValueType > & boundaryField() const
const Field< ValueType > & internalField() const
Represents an unstructured mesh in NeoFOAM.
size_t nInternalFaces() const
Get the number of internal faces in the mesh.
virtual void correctBoundaryCondition(DomainField< ValueType > &domainField) override
static std::string name()
virtual std::unique_ptr< SurfaceBoundaryFactory< ValueType > > clone() const override
FixedValue(const UnstructuredMesh &mesh, const Dictionary &dict, std::size_t patchID)
static std::string schema()
A template class for registering derived classes with a base class.
void setFixedValue(DomainField< ValueType > &domainField, const UnstructuredMesh &mesh, std::pair< size_t, size_t > range, ValueType fixedValue)
void parallelFor(const Executor &exec, std::pair< size_t, size_t > range, Kernel kernel, std::string name="parallelFor")