7#include <Kokkos_Core.hpp>
22template<
typename ValueType>
24 Field<ValueType>& domainVector, std::pair<size_t, size_t> range, ValueType fixedValue
27 auto [refGradient, value, valueFraction, refValue] =
views(
38 refValue[i] = fixedValue;
39 value[i] = fixedValue;
40 valueFraction[i] = 1.0;
41 refGradient[i] = fixedValue;
49template<
typename ValueType>
56 using Base::correctBoundaryCondition;
59 : Base(mesh, dict, patchID, {.assignable =
false, .fixesValue =
true}),
60 fixedValue_(dict.get<ValueType>(
"fixedValue"))
68 static std::string
name() {
return "fixedValue"; }
72 static std::string
doc() {
return "Set a fixed value on the boundary"; }
74 static std::string
schema() {
return "none"; }
76 virtual std::unique_ptr<VolumeBoundaryFactory<ValueType>>
clone() const final
78 return std::make_unique<FixedValue>(*
this);
83 ValueType fixedValue_;
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
Represents an unstructured mesh in NeoN.
virtual std::unique_ptr< VolumeBoundaryFactory< ValueType > > clone() const final
virtual void correctBoundaryCondition(Field< ValueType > &domainVector) final
FixedValue(const UnstructuredMesh &mesh, const Dictionary &dict, localIdx patchID)
static std::string schema()
std::string getName() const override
static std::string name()
A template class for registering derived classes with a base class.
void setFixedValue(Field< ValueType > &domainVector, std::pair< size_t, size_t > range, ValueType fixedValue)
void parallelFor(const ExecutorType &, std::pair< localIdx, localIdx > range, const Kernel &kernel, std::string name)
auto views(Types &... args)
Unpacks all views of the passed classes.