8#include <Kokkos_Core.hpp>
23 SurfaceInterpolationFactory,
24 Parameters<const Executor&, const UnstructuredMesh&, Input>>
30 static std::unique_ptr<SurfaceInterpolationFactory>
35 (std::holds_alternative<NeoFOAM::Dictionary>(inputs))
36 ? std::get<NeoFOAM::Dictionary>(inputs).get<std::string>(
"surfaceInterpolation")
37 : std::get<NeoFOAM::TokenList>(inputs).get<std::string>(0);
39 keyExistsOrError(key);
40 return table().at(key)(exec, uMesh, inputs);
43 static std::string
name() {
return "SurfaceInterpolationFactory"; }
60 virtual std::unique_ptr<SurfaceInterpolationFactory>
clone()
const = 0;
75 : exec_(surfInterp.exec_), mesh_(surfInterp.mesh_),
76 interpolationKernel_(surfInterp.interpolationKernel_->clone()) {};
79 : exec_(surfInterp.exec_), mesh_(surfInterp.mesh_),
80 interpolationKernel_(std::move(surfInterp.interpolationKernel_)) {};
85 std::unique_ptr<SurfaceInterpolationFactory> interpolationKernel
87 : exec_(exec), mesh_(mesh), interpolationKernel_(std::move(interpolationKernel)) {};
90 : exec_(exec), mesh_(mesh),
96 interpolationKernel_->interpolate(volField, surfaceField);
101 std::string nameInterpolated =
"interpolated_" + volField.
name;
115 interpolationKernel_->interpolate(faceFlux, volField, surfaceField);
121 std::string
name =
"interpolated_" + volField.
name;
133 std::unique_ptr<SurfaceInterpolationFactory> interpolationKernel_;
A factory class for runtime selection of derived classes.
Represents an unstructured mesh in NeoFOAM.
Represents a surface boundary field for a cell-centered finite volume method.
virtual ~SurfaceInterpolationFactory()
static std::string name()
const UnstructuredMesh & mesh_
static std::unique_ptr< SurfaceInterpolationFactory > create(const Executor &exec, const UnstructuredMesh &uMesh, Input inputs)
SurfaceInterpolationFactory(const Executor &exec, const UnstructuredMesh &mesh)
virtual std::unique_ptr< SurfaceInterpolationFactory > clone() const =0
virtual void interpolate(const VolumeField< scalar > &volField, ScalarSurfaceField &surfaceField) const =0
virtual void interpolate(const ScalarSurfaceField &faceFlux, const VolumeField< scalar > &volField, ScalarSurfaceField &surfaceField) const =0
SurfaceInterpolation(const Executor &exec, const UnstructuredMesh &mesh, std::unique_ptr< SurfaceInterpolationFactory > interpolationKernel)
ScalarSurfaceField interpolate(const ScalarSurfaceField &faceFlux, const VolumeField< scalar > &volField) const
ScalarSurfaceField interpolate(const VolumeField< scalar > &volField) const
void interpolate(const ScalarSurfaceField &faceFlux, const VolumeField< scalar > &volField, ScalarSurfaceField &surfaceField) const
SurfaceInterpolation(const SurfaceInterpolation &surfInterp)
SurfaceInterpolation(SurfaceInterpolation &&surfInterp)
void interpolate(const VolumeField< scalar > &volField, ScalarSurfaceField &surfaceField) const
SurfaceInterpolation(const Executor &exec, const UnstructuredMesh &mesh, Input input)
Represents a volume field in a finite volume method.
std::vector< BoundaryType > createCalculatedBCs(const UnstructuredMesh &mesh)
std::variant< Dictionary, TokenList > Input
const std::string & name(const NeoFOAM::Document &doc)
Retrieves the name of a Document.
std::variant< SerialExecutor, CPUExecutor, GPUExecutor > Executor