7#include <Kokkos_Core.hpp>
23template<
typename ValueType>
27 std::pair<localIdx, localIdx> range
32 auto [refGradient, value, valueFraction, refValue, boundaryFaceOwners, deltaCoeffs] =
views(
46 value[i] = iVector[boundaryFaceOwners[i]] + refGradient[i] * (1 / deltaCoeffs[i]);
47 valueFraction[i] = 0.0;
48 refValue[i] = zero<ValueType>();
50 "applyFixedFluxPressure"
64template<
typename ValueType>
72 using Base::correctBoundaryCondition;
75 : Base(mesh, {}, patchID, {.assignable =
true, .fixesValue =
false}), mesh_(mesh)
83 static std::string
name() {
return "fixedFluxPressure"; }
87 static std::string
doc()
89 return "Fixed-flux pressure wall BC (externally updatable per-face refGrad).";
92 static std::string
schema() {
return "none"; }
94 virtual std::unique_ptr<VolumeBoundaryFactory<ValueType>>
clone() const final
96 return std::make_unique<FixedFluxPressure>(*
this);
const scalarVector & deltaCoeffs() const
Get the field of delta coefficients.
const labelVector & faceOwners() const
Get the list of labels of owner cells of boundary faces.
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.
const BoundaryMesh & boundaryMesh() const
Get the boundary mesh.
virtual std::unique_ptr< VolumeBoundaryFactory< ValueType > > clone() const final
FixedFluxPressure(const UnstructuredMesh &mesh, const Dictionary &, localIdx patchID)
virtual void correctBoundaryCondition(Field< ValueType > &domainVector) final
std::string getName() const override
static std::string schema()
static std::string name()
A template class for registering derived classes with a base class.
void applyFixedFluxPressure(Field< ValueType > &domainVector, const UnstructuredMesh &mesh, std::pair< localIdx, localIdx > range)
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.