Portage::MismatchFixer< D, onwhat, SourceMesh_Wrapper, SourceState_Wrapper, TargetMesh_Wrapper, TargetState_Wrapper > Class Template Reference

#include <fix_mismatch.h>

Public Member Functions

 MismatchFixer (SourceMesh_Wrapper const &source_mesh, SourceState_Wrapper const &source_state, TargetMesh_Wrapper const &target_mesh, TargetState_Wrapper &target_state, Wonton::Executor_type const *executor, bool global_check=true)
 
bool check_mismatch (Portage::vector< std::vector< Weights_t >> const &source_ents_and_weights)
 Compute (and cache) whether the mesh domains are mismatched. More...
 
bool has_mismatch () const
 Return whether the mesh domains are mismatched (must be called after check_mismatch) More...
 
bool fix_mismatch (std::string const &src_var_name, std::string const &trg_var_name, double global_lower_bound=-std::numeric_limits< double >::max(), double global_upper_bound=std::numeric_limits< double >::max(), double conservation_tol=1e2 *std::numeric_limits< double >::epsilon(), int maxiter=5, Partial_fixup_type partial_fixup_type=Partial_fixup_type::SHIFTED_CONSERVATIVE, Empty_fixup_type empty_fixup_type=Empty_fixup_type::EXTRAPOLATE)
 Repair the remapped field to account for boundary mismatch. More...
 
bool fix_mismatch_meshvar (std::string const &src_var_name, std::string const &trg_var_name, double global_lower_bound, double global_upper_bound, double conservation_tol=1e2 *std::numeric_limits< double >::epsilon(), int maxiter=5, Partial_fixup_type partial_fixup_type=Partial_fixup_type::SHIFTED_CONSERVATIVE, Empty_fixup_type empty_fixup_type=Empty_fixup_type::EXTRAPOLATE)
 Repair a remapped mesh field to account for boundary mismatch. More...
 

Constructor & Destructor Documentation

◆ MismatchFixer()

template<int D, Entity_kind onwhat, class SourceMesh_Wrapper , class SourceState_Wrapper , class TargetMesh_Wrapper , class TargetState_Wrapper >
Portage::MismatchFixer< D, onwhat, SourceMesh_Wrapper, SourceState_Wrapper, TargetMesh_Wrapper, TargetState_Wrapper >::MismatchFixer ( SourceMesh_Wrapper const &  source_mesh,
SourceState_Wrapper const &  source_state,
TargetMesh_Wrapper const &  target_mesh,
TargetState_Wrapper &  target_state,
Wonton::Executor_type const *  executor,
bool  global_check = true 
)
inline

Member Function Documentation

◆ check_mismatch()

template<int D, Entity_kind onwhat, class SourceMesh_Wrapper , class SourceState_Wrapper , class TargetMesh_Wrapper , class TargetState_Wrapper >
bool Portage::MismatchFixer< D, onwhat, SourceMesh_Wrapper, SourceState_Wrapper, TargetMesh_Wrapper, TargetState_Wrapper >::check_mismatch ( Portage::vector< std::vector< Weights_t >> const &  source_ents_and_weights)
inline

Compute (and cache) whether the mesh domains are mismatched.

Parameters
[in]sources_and_weightsIntersection sources and moments (vols, centroids)
Returns
whether the mesh domains are mismatched

◆ fix_mismatch()

template<int D, Entity_kind onwhat, class SourceMesh_Wrapper , class SourceState_Wrapper , class TargetMesh_Wrapper , class TargetState_Wrapper >
bool Portage::MismatchFixer< D, onwhat, SourceMesh_Wrapper, SourceState_Wrapper, TargetMesh_Wrapper, TargetState_Wrapper >::fix_mismatch ( std::string const &  src_var_name,
std::string const &  trg_var_name,
double  global_lower_bound = -std::numeric_limits<double>::max(),
double  global_upper_bound = std::numeric_limits<double>::max(),
double  conservation_tol = 1e2*std::numeric_limits<double>::epsilon(),
int  maxiter = 5,
Partial_fixup_type  partial_fixup_type = Partial_fixup_type::SHIFTED_CONSERVATIVE,
Empty_fixup_type  empty_fixup_type = Empty_fixup_type::EXTRAPOLATE 
)
inline

Repair the remapped field to account for boundary mismatch.

Parameters
src_var_namefield variable on source mesh
trg_var_namefield variable on target mesh
global_lower_boundlower limit on variable
global_upper_boundupper limit on variable
partial_fixup_typetype of fixup in case of partial mismatch
empty_fixup_typetype of fixup in empty target entities

partial_fixup_type can be one of three types:

CONSTANT - Fields will see no perturbations BUT REMAP WILL BE NON-CONSERVATIVE (constant preserving, not linearity preserving) LOCALLY_CONSERVATIVE - REMAP WILL BE LOCALLY CONSERVATIVE (target cells will preserve the integral quantities received from source mesh overlap) but perturbations will occur in the field (constant fields may not stay constant if there is mismatch) SHIFTED_CONSERVATIVE - REMAP WILL BE CONSERVATIVE and field perturbations will be minimum but field values may be shifted (Constant fields will be shifted to different constant; no guarantees on linearity preservation)

empty_fixup_type can be one of two types:

LEAVE_EMPTY - Leave empty cells as is EXTRAPOLATE - Fill empty cells with extrapolated values FILL - Fill empty cells with specified values (not yet implemented)

◆ fix_mismatch_meshvar()

template<int D, Entity_kind onwhat, class SourceMesh_Wrapper , class SourceState_Wrapper , class TargetMesh_Wrapper , class TargetState_Wrapper >
bool Portage::MismatchFixer< D, onwhat, SourceMesh_Wrapper, SourceState_Wrapper, TargetMesh_Wrapper, TargetState_Wrapper >::fix_mismatch_meshvar ( std::string const &  src_var_name,
std::string const &  trg_var_name,
double  global_lower_bound,
double  global_upper_bound,
double  conservation_tol = 1e2*std::numeric_limits<double>::epsilon(),
int  maxiter = 5,
Partial_fixup_type  partial_fixup_type = Partial_fixup_type::SHIFTED_CONSERVATIVE,
Empty_fixup_type  empty_fixup_type = Empty_fixup_type::EXTRAPOLATE 
)
inline

Repair a remapped mesh field to account for boundary mismatch.

◆ has_mismatch()

template<int D, Entity_kind onwhat, class SourceMesh_Wrapper , class SourceState_Wrapper , class TargetMesh_Wrapper , class TargetState_Wrapper >
bool Portage::MismatchFixer< D, onwhat, SourceMesh_Wrapper, SourceState_Wrapper, TargetMesh_Wrapper, TargetState_Wrapper >::has_mismatch ( ) const
inline

Return whether the mesh domains are mismatched (must be called after check_mismatch)

Returns
whether the mesh domains are mismatched

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