7#include <Kokkos_Core.hpp>
22 std::pair<size_t, size_t> range
25 auto [refValueV, valueV] =
35 "computeSymmetryBoundaryScalar"
44 auto [refValueV, valueV, nHatV] =
views(
54 const Vec3 n = nHatV[i];
55 const Vec3 v = valueV[i];
57 const Vec3 vtan = v - n * vn;
62 "computeSymmetryBoundaryVec3"
68template<
typename ValueType>
76 : Base(mesh, dict, patchID), mesh_(mesh)
84 static std::string
name() {
return "symmetry"; }
85 static std::string
doc()
87 return "Symmetry plane (zero gradient for scalars, mirror for vectors)";
89 static std::string
schema() {
return "none"; }
91 std::unique_ptr<SurfaceBoundaryFactory<ValueType>>
clone()
const override
93 return std::make_unique<Symmetry>(*
this);
const vectorVector & faceUnitNormals() const
Get the field of face unit normal vectors.
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.
const BoundaryMesh & boundaryMesh() const
Get the boundary mesh.
A class for the representation of a 3D Vec3.
Symmetry(const UnstructuredMesh &mesh, const Dictionary &dict, localIdx patchID)
static std::string schema()
std::unique_ptr< SurfaceBoundaryFactory< ValueType > > clone() const override
static std::string name()
void correctBoundaryCondition(Field< ValueType > &domainVector) override
A template class for registering derived classes with a base class.
void applySymmetry(Field< scalar > &domainVector, const UnstructuredMesh &, std::pair< size_t, size_t > 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.