7#include <Kokkos_Core.hpp>
20template<
typename ValueType>
24 std::pair<size_t, size_t> range,
37 refValue[i] = fixedValue;
38 value[i] = fixedValue;
39 internalValues[nInternalFaces + i] = fixedValue;
45template<
typename ValueType>
54 : Base(mesh, dict, patchID), mesh_(mesh), fixedValue_(dict.get<ValueType>(
"fixedValue"))
62 static std::string
name() {
return "fixedValue"; }
64 static std::string
doc() {
return "Set a fixed value on the boundary"; }
66 static std::string
schema() {
return "none"; }
68 virtual std::unique_ptr<SurfaceBoundaryFactory<ValueType>>
clone()
const override
70 return std::make_unique<FixedValue>(*
this);
76 ValueType fixedValue_;
const Vector< T > & refValue() const
Get the view storing the Dirichlet boundary values.
const Vector< T > & value() const
Get the view storing the computed values from the boundary condition.
A class representing a dictionary that stores key-value pairs.
Represents the domain fields for a computational domain.
const BoundaryData< ValueType > & boundaryData() const
const Executor & exec() const
const Vector< ValueType > & internalVector() const
Represents an unstructured mesh in NeoN.
localIdx nInternalFaces() const
Get the number of internal faces in the mesh.
virtual std::unique_ptr< SurfaceBoundaryFactory< ValueType > > clone() const override
FixedValue(const UnstructuredMesh &mesh, const Dictionary &dict, localIdx patchID)
virtual void correctBoundaryCondition(Field< ValueType > &domainVector) override
static std::string schema()
static std::string name()
A template class for registering derived classes with a base class.
void setFixedValue(Field< ValueType > &domainVector, const UnstructuredMesh &mesh, std::pair< size_t, size_t > range, ValueType fixedValue)
void parallelFor(const Executor &exec, std::pair< localIdx, localIdx > range, Kernel kernel, std::string name="parallelFor")