7#include <Kokkos_Core.hpp>
58 const std::string key =
"implicit";
59 if (!dict.
contains(key))
return true;
60 if (dict.
isType<
bool>(key))
return dict.
get<
bool>(key);
61 if (dict.
isType<
int>(key))
return dict.
get<
int>(key) != 0;
62 if (dict.
isType<std::string>(key))
64 const std::string v = dict.
get<std::string>(key);
65 return (v ==
"true" || v ==
"yes" || v ==
"on" || v ==
"1");
77template<
typename ValueType>
81 std::pair<localIdx, localIdx> range,
90 std::pair<localIdx, localIdx> range,
96 auto [refGradV, valueV, valueFractionV, refValueV, boundaryFaceOwnersV] =
views(
108 const localIdx owner = boundaryFaceOwnersV[i];
109 const auto v = internalV[owner];
113 valueFractionV[i] = 0.0;
116 "setSlipSymmetryValue(scalar)"
125 std::pair<localIdx, localIdx> range,
154 const localIdx owner = boundaryFaceOwnersV[i];
155 const auto v = internalV[owner];
156 const auto n = faceUnitNormalsV[i];
158 const auto un = (v & n);
159 const auto vtan = v - n * un;
167 valueFractionV[i] = 0.0;
173 refGradV[i] = deferred ? n * (-deltaCoeffsV[i] * un) : NeoN::zero<NeoN::Vec3>();
175 "setSlipSymmetryValue(Vec3)"
const vectorVector & faceUnitNormals() const
Get the field of face unit normal vectors.
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.
T & get(const std::string &key)
Retrieves the value associated with the given key, casting it to the specified type.
bool isType(const std::string &key) const
Checks if the value associated with the given key is of given Type T.
bool contains(const std::string &key) const
Checks if the given key is present in the dictionary.
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.
NormalDamping normalDampingMode(bool implicit)
Map the implicit flag onto the NormalDamping mode.
void setSlipSymmetryValue(Field< ValueType > &domainVector, const UnstructuredMesh &mesh, std::pair< localIdx, localIdx > range, NormalDamping mode)
void setSlipSymmetryValue< NeoN::scalar >(Field< NeoN::scalar > &domainVector, const UnstructuredMesh &mesh, std::pair< localIdx, localIdx > range, NormalDamping mode)
void setSlipSymmetryValue< NeoN::Vec3 >(Field< NeoN::Vec3 > &domainVector, const UnstructuredMesh &mesh, std::pair< localIdx, localIdx > range, NormalDamping mode)
bool readTransformImplicit(const Dictionary &dict)
Read the "implicit" flag from a slip/symmetry patch dictionary.
@ Implicit
normal damping via per-component diagonal correction (segregated solve)
@ Deferred
normal damping via refGrad -> per-component RHS (multi-RHS friendly)
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.