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

Implements a variable coefficient Laplacian f=Div[h*Grad[u]]. More...

#include <StarPatchOperator.h>

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

Public Member Functions

 StarPatchOperator (const Vector< D > &coeffs, const Domain< D > &domain, const GhostFiller< D > &ghost_filler)
 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 interior) 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, std::function< double(const std::array< double, D > &)> hfunc)
 Helper function for adding Dirichlet 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.
 

Protected Member Functions

constexpr int addValue (int axis) const
 

Protected Attributes

Vector< D > coeffs
 

Detailed Description

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

Implements a variable coefficient Laplacian f=Div[h*Grad[u]].

h is a cell-centered coefficient

Template Parameters
Dthe number of Cartesian dimensions

Constructor & Destructor Documentation

◆ StarPatchOperator()

template<int D>
ThunderEgg::VarPoisson::StarPatchOperator< D >::StarPatchOperator ( const Vector< D > &  coeffs,
const Domain< D > &  domain,
const GhostFiller< D > &  ghost_filler 
)
inline

Construct a new StarPatchOperator object.

Parameters
coeffsthe cell centered coefficients
domainthe Domain associated with the operator
ghost_fillerthe GhostFiller to use before calling applySinglePatch

Member Function Documentation

◆ addDrichletBCToRHS()

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

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

Parameters
fthe right hand side vector
gfuncthe exact solution
hfuncthe coefficients

◆ applySinglePatch()

template<int D>
void ThunderEgg::VarPoisson::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::VarPoisson::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::VarPoisson::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::VarPoisson::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: