6#include <Kokkos_Core.hpp>
21template<
typename ValueType>
23 Field<ValueType>& domainVector, std::pair<size_t, size_t> range, ValueType fixedValue
26 auto [refGradient, value, valueFraction, refValue] =
views(
37 refValue[i] = fixedValue;
38 value[i] = fixedValue;
39 valueFraction[i] = 1.0;
40 refGradient[i] = fixedValue;
47template<
typename ValueType>
55 : Base(mesh, dict, patchID), fixedValue_(dict.get<ValueType>(
"fixedValue"))
63 static std::string
name() {
return "fixedValue"; }
65 static std::string
doc() {
return "Set a fixed value on the boundary"; }
67 static std::string
schema() {
return "none"; }
69 virtual std::unique_ptr<VolumeBoundaryFactory<ValueType>>
clone() const final
71 return std::make_unique<FixedValue>(*
this);
76 ValueType fixedValue_;
const Vector< T > & refGrad() const
Get the view storing the Neumann boundary values.
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.
const Vector< scalar > & valueFraction() const
Get the view storing the fraction of the boundary value.
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()
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 Executor &exec, std::pair< localIdx, localIdx > range, Kernel kernel, std::string name="parallelFor")
auto views(Types &... args)
Unpacks all views of the passed classes.