7#include <Kokkos_Core.hpp>
23 auto [refValueV, valueV, internalValuesV, faceCellsV] =
views(
36 const localIdx owner = faceCellsV[i];
37 const scalar v = internalValuesV[owner];
42 "computeSymmetryBoundaryScalar"
51 auto [refValueV, valueV, internalValuesV, faceCellsV, nHatV] =
views(
65 const localIdx owner = faceCellsV[i];
66 const Vec3 n = nHatV[i];
68 Vec3 v = internalValuesV[owner];
70 const auto vtan = v - n * vn;
75 "computeSymmetryBoundaryVec3"
81template<
typename ValueType>
89 : Base(mesh, dict, patchID), mesh_(mesh)
97 static std::string
name() {
return "symmetry"; }
98 static std::string
doc()
100 return "Symmetry plane (zero gradient for scalars, mirror for vectors)";
102 static std::string
schema() {
return "none"; }
104 std::unique_ptr<SurfaceBoundaryFactory<ValueType>>
clone()
const override
106 return std::make_unique<Symmetry>(*
this);
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 vectorVector & nf() const
Get the field of face unit normals.
const labelVector & faceCells() const
Get the field of face cells.
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.
localIdx nInternalFaces() const
Get the number of internal faces in the mesh.
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 &mesh, std::pair< size_t, size_t > range)
void parallelFor(const ExecutorType &exec, std::pair< localIdx, localIdx > range, Kernel kernel, std::string name)
auto views(Types &... args)
Unpacks all views of the passed classes.