Parts mismatch fixup tests for part-by-part interpolation. More...

Inheritance diagram for PartMismatchTest:

Public Member Functions

 PartMismatchTest ()
 Setup each test-case. More...
 
void unitTest (Partial partial_fixup, Empty empty_fixup)
 Do the test. More...
 

Protected Types

using Remapper = Portage::CoreDriver< 2, Wonton::Entity_kind::CELL, Wonton::Jali_Mesh_Wrapper, Wonton::Jali_State_Wrapper >
 
using PartPair = Portage::PartPair< 2, Wonton::Jali_Mesh_Wrapper, Wonton::Jali_State_Wrapper >
 
using Partial = Portage::Partial_fixup_type
 
using Empty = Portage::Empty_fixup_type
 

Protected Member Functions

double compute_source_density (int c)
 Compute source cell density. More...
 
template<bool is_source>
void create_partition (double thresh)
 Create a partition based on a threshold value. More...
 
double get_expected_remapped_density (int const cell, Partial partial_fixup, Empty empty_fixup)
 Compute the expected remapped density on target mesh. More...
 

Protected Attributes

std::shared_ptr< Jali::Mesh > source_mesh
 
std::shared_ptr< Jali::Mesh > target_mesh
 
std::shared_ptr< Jali::State > source_state
 
std::shared_ptr< Jali::State > target_state
 
Wonton::Jali_Mesh_Wrapper source_mesh_wrapper
 
Wonton::Jali_Mesh_Wrapper target_mesh_wrapper
 
Wonton::Jali_State_Wrapper source_state_wrapper
 
Wonton::Jali_State_Wrapper target_state_wrapper
 
std::vector< PartPairparts
 
std::vector< int > source_cells [nb_parts]
 
std::vector< int > target_cells [nb_parts]
 

Static Protected Attributes

static constexpr int const nb_parts = 2
 
static constexpr double upper_bound = std::numeric_limits<double>::max()
 
static constexpr double lower_bound = std::numeric_limits<double>::min()
 
static constexpr double epsilon = 1.E-10
 

Detailed Description

Parts mismatch fixup tests for part-by-part interpolation.

Here, the purpose is to check that parts mismatch are correctly handled when interpolating each pair of source-target part independently. More precisely, we aim to ensure that values within partially filled and empty cells are correctly fixed according to the user-specified fixup scheme which may be:

  • constant and leave empty,
  • constant and extrapolate,
  • locally conservative and leave empty,
  • locally conservative and extrapolate,
  • shifted conservative and leave empty,
  • shifted conservative and extrapolate.

Again, source and target meshes are respectively split into two parts, and each source-target part pair is remapped independently. Remapped values are then compared to the exact expected values.

0,1 source 1,1 ___________________ source mesh: 4x4 cartesian grid. | | : | | Here, the domain is halved into two equal parts. |____|____:____|____| The prescribed density is 100 for the first part | | : | | and 1 for the second part. |____0____:____1____| | | : | |

________:________
________:________

___________________ target mesh: 5x5 cartesian grid. | | | . | : | Here parts interface is shifted such that the |___|___|_._|___:___| first part is 4/5 of the domain and the last | | | . | : | part is only 1/5 of it. |___|___0_._|___:1| Hence, we have a: | | | . | : | - partially filled cells layer in [0.5-0.6] |___|___|_._|___:___| - empty cells layer in [0.6-0.8] | | | . | : | |___|___|_._|___:___|

0,0 target 1,0

Member Typedef Documentation

◆ Empty

◆ Partial

◆ PartPair

using PartMismatchTest::PartPair = Portage::PartPair<2, Wonton::Jali_Mesh_Wrapper, Wonton::Jali_State_Wrapper>
protected

◆ Remapper

using PartMismatchTest::Remapper = Portage::CoreDriver<2, Wonton::Entity_kind::CELL, Wonton::Jali_Mesh_Wrapper, Wonton::Jali_State_Wrapper>
protected

Constructor & Destructor Documentation

◆ PartMismatchTest()

PartMismatchTest::PartMismatchTest ( )
inline

Setup each test-case.

It creates both source and target meshes, then computes and assigns a density field on source mesh, then creates parts couples for both source and target meshes.

Member Function Documentation

◆ compute_source_density()

double PartMismatchTest::compute_source_density ( int  c)
inlineprotected

Compute source cell density.

Parameters
cthe source cell local index
Returns
the exact density of the given cell.

◆ create_partition()

template<bool is_source>
void PartMismatchTest::create_partition ( double  thresh)
inlineprotected

Create a partition based on a threshold value.

Template Parameters
is_sourcesource or target mesh?
Parameters
threshx-axis threshold value

◆ get_expected_remapped_density()

double PartMismatchTest::get_expected_remapped_density ( int const  cell,
Partial  partial_fixup,
Empty  empty_fixup 
)
inlineprotected

Compute the expected remapped density on target mesh.

It depends on Partial/empty mismatch fixup schemes being used:

  • locally-conservative/leave-empty: [100.0|100.0| 50.0| 0.0|1.0]
  • locally-conservative/extrapolate: [100.0|100.0| 50.0| 50.0|1.0]
  • constant/leave-empty: [100.0|100.0|100.0| 0.0|1.0]
  • constant/extrapolate: [100.0|100.0|100.0|100.0|1.0]
  • shifted-conservative/leave-empty: [ 83.3| 83.3| 83.3| 0.0|2.5]
  • shifted-conservative/extrapolate: [ 62.5| 62.5| 62.5| 62.5|2.5]
Parameters
cellthe target cell local index
partial_fixupthe Partial mismatch fixup scheme to use
empty_fixupthe empty cell fixup scheme to use
Returns
the expected remapped density value

◆ unitTest()

void PartMismatchTest::unitTest ( Partial  partial_fixup,
Empty  empty_fixup 
)
inline

Do the test.

Parameters
partial_fixupthe partially filled cell fixup scheme to use.
empty_fixupthe empty cells fixup scheme to use.

Member Data Documentation

◆ epsilon

constexpr double PartMismatchTest::epsilon = 1.E-10
staticprotected

◆ lower_bound

constexpr double PartMismatchTest::lower_bound = std::numeric_limits<double>::min()
staticprotected

◆ nb_parts

constexpr int const PartMismatchTest::nb_parts = 2
staticprotected

◆ parts

std::vector<PartPair> PartMismatchTest::parts
protected

◆ source_cells

std::vector<int> PartMismatchTest::source_cells[nb_parts]
protected

◆ source_mesh

std::shared_ptr<Jali::Mesh> PartMismatchTest::source_mesh
protected

◆ source_mesh_wrapper

Wonton::Jali_Mesh_Wrapper PartMismatchTest::source_mesh_wrapper
protected

◆ source_state

std::shared_ptr<Jali::State> PartMismatchTest::source_state
protected

◆ source_state_wrapper

Wonton::Jali_State_Wrapper PartMismatchTest::source_state_wrapper
protected

◆ target_cells

std::vector<int> PartMismatchTest::target_cells[nb_parts]
protected

◆ target_mesh

std::shared_ptr<Jali::Mesh> PartMismatchTest::target_mesh
protected

◆ target_mesh_wrapper

Wonton::Jali_Mesh_Wrapper PartMismatchTest::target_mesh_wrapper
protected

◆ target_state

std::shared_ptr<Jali::State> PartMismatchTest::target_state
protected

◆ target_state_wrapper

Wonton::Jali_State_Wrapper PartMismatchTest::target_state_wrapper
protected

◆ upper_bound

constexpr double PartMismatchTest::upper_bound = std::numeric_limits<double>::max()
staticprotected

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