ThunderEgg  1.0.0
ThunderEgg::Poisson::StarPatchOperator< D > Class Template Reference

Implements 2nd order finite-difference Laplacian operator. More...

#include <StarPatchOperator.h>

Inheritance diagram for ThunderEgg::Poisson::StarPatchOperator< D >:
Collaboration diagram for ThunderEgg::Poisson::StarPatchOperator< D >:

Public Member Functions

 StarPatchOperator (const Domain< D > &domain, const GhostFiller< D > &ghost_filler, bool neumann=false)
 Construct a new StarPatchOperator object. More...
 
StarPatchOperator< D > * clone () const override
 Get a clone of this operator. More...
 
void applySinglePatch (const PatchInfo< D > &pinfo, const PatchView< const double, D > &u_view, const PatchView< double, D > &f_view, bool internal) const
 
void applySinglePatch (const PatchInfo< D > &pinfo, const PatchView< const double, D > &u_view, const PatchView< double, D > &f_view) const override
 Apply the operator to a single patch. More...
 
void applySinglePatchWithInternalBoundaryConditions (const PatchInfo< D > &pinfo, const PatchView< const double, D > &u_view, const PatchView< double, D > &f_view) const override
 Apply the operator to a single patch. More...
 
void enforceBoundaryConditions (const PatchInfo< D > &pinfo, const PatchView< const double, D > &u_view) const
 
void enforceInternalBoundaryConditions (const PatchInfo< D > &pinfo, const PatchView< const double, D > &u_view) const
 
void modifyRHSForInternalBoundaryConditions (const PatchInfo< D > &pinfo, const PatchView< const double, D > &u_view, const PatchView< double, D > &f_view) const override
 Treat the internal patch boundaries as domain boundaires and modify RHS accordingly. More...
 
void addDrichletBCToRHS (Vector< D > &f, std::function< double(const std::array< double, D > &)> gfunc)
 Helper function for adding Dirichlet boundary conditions to right hand side. More...
 
void addNeumannBCToRHS (Vector< D > &f, std::function< double(const std::array< double, D > &)> gfunc, std::array< std::function< double(const std::array< double, D > &)>, D > gfunc_grad)
 Helper function for adding Neumann boundary conditions to right hand side. More...
 
- Public Member Functions inherited from ThunderEgg::PatchOperator< D >
 PatchOperator (const Domain< D > &domain, const GhostFiller< D > &ghost_filler)
 Construct a new Patch Operator object. More...
 
virtual ~PatchOperator ()
 Destroy the PatchOperator object.
 
void apply (const Vector< D > &u, Vector< D > &f) const override
 Apply the operator. More...
 
const Domain< D > & getDomain () const
 Get the Domain object associated with this PatchOperator.
 
const GhostFiller< D > & getGhostFiller () const
 Get the GhostFiller object associated with this PatchOperator.
 
- Public Member Functions inherited from ThunderEgg::Operator< D >
virtual ~Operator ()
 Destroy the Operator object.
 

Detailed Description

template<int D>
class ThunderEgg::Poisson::StarPatchOperator< D >

Implements 2nd order finite-difference Laplacian operator.

Supports both Dirichlet and Neumann boundary conditions

Template Parameters
Dthe number of Cartesian dimensions

Constructor & Destructor Documentation

◆ StarPatchOperator()

template<int D>
ThunderEgg::Poisson::StarPatchOperator< D >::StarPatchOperator ( const Domain< D > &  domain,
const GhostFiller< D > &  ghost_filler,
bool  neumann = false 
)
inline

Construct a new StarPatchOperator object.

Parameters
domainthe Domain that the operator is associated with
ghost_fillerthe GhostFiller to use before calling applySinglePatch
neumannwhether or not to use Neumann boundary conditions

Member Function Documentation

◆ addDrichletBCToRHS()

template<int D>
void ThunderEgg::Poisson::StarPatchOperator< D >::addDrichletBCToRHS ( Vector< D > &  f,
std::function< double(const std::array< double, D > &)>  gfunc 
)
inline

Helper function for adding Dirichlet boundary conditions to right hand side.

Parameters
fthe right hand side vector
gfuncthe exact solution

◆ addNeumannBCToRHS()

template<int D>
void ThunderEgg::Poisson::StarPatchOperator< D >::addNeumannBCToRHS ( Vector< D > &  f,
std::function< double(const std::array< double, D > &)>  gfunc,
std::array< std::function< double(const std::array< double, D > &)>  ,
,
gfunc_grad   
)
inline

Helper function for adding Neumann boundary conditions to right hand side.

Parameters
fthe right hand side vector
gfuncthe exact solution
gfunc_gradthe gradient of gfunc

◆ applySinglePatch()

template<int D>
void ThunderEgg::Poisson::StarPatchOperator< D >::applySinglePatch ( const PatchInfo< D > &  pinfo,
const PatchView< const double, D > &  u_view,
const PatchView< double, D > &  f_view 
) const
inlineoverridevirtual

Apply the operator to a single patch.

The ghost values in u will be updated to the latest values, and should not need to be modified

Parameters
pinfothe patch
u_viewthe solution
f_viewthe left hand side

Implements ThunderEgg::PatchOperator< D >.

◆ applySinglePatchWithInternalBoundaryConditions()

template<int D>
void ThunderEgg::Poisson::StarPatchOperator< D >::applySinglePatchWithInternalBoundaryConditions ( const PatchInfo< D > &  pinfo,
const PatchView< const double, D > &  u_view,
const PatchView< double, D > &  f_view 
) const
inlineoverridevirtual

Apply the operator to a single patch.

The ghost values in u will be updated to the latest values, and should not need to be modified

Parameters
pinfothe patch
u_viewthe solution
f_viewthe left hand side

Implements ThunderEgg::PatchOperator< D >.

◆ clone()

template<int D>
StarPatchOperator<D>* ThunderEgg::Poisson::StarPatchOperator< D >::clone ( ) const
inlineoverridevirtual

Get a clone of this operator.

Returns
StarPatchOperator<D>* a newly allocated copy of this operator

Implements ThunderEgg::PatchOperator< D >.

◆ modifyRHSForInternalBoundaryConditions()

template<int D>
void ThunderEgg::Poisson::StarPatchOperator< D >::modifyRHSForInternalBoundaryConditions ( const PatchInfo< D > &  pinfo,
const PatchView< const double, D > &  u_view,
const PatchView< double, D > &  f_view 
) const
inlineoverridevirtual

Treat the internal patch boundaries as domain boundaires and modify RHS accordingly.

This will be u_viewed in patch solvers to formulate a RHS for the individual patch to solve for.

Parameters
pinfothe patch
u_viewthe left hand side
f_viewthe right hand side

Implements ThunderEgg::PatchOperator< D >.


The documentation for this class was generated from the following file: