test_flecsi_mesh_wrapper.cc File Reference
#include "wonton/mesh/flecsi/flecsi_mesh_wrapper.h"
#include <iostream>
#include "gtest/gtest.h"
#include "mpi.h"
#include "flecsi-sp.h"
#include "flecsi-sp/burton/burton.h"
#include "flecsi-sp/burton/factory.h"
#include "wonton/support/Point.h"

Typedefs

using mesh_2d_t = flecsi::sp::burton::burton_mesh_2d_t
 
using mesh_3d_t = flecsi::sp::burton::burton_mesh_3d_t
 
using flecsi_mesh_2d_t = Wonton::flecsi_mesh_t< mesh_2d_t >
 
using flecsi_mesh_3d_t = Wonton::flecsi_mesh_t< mesh_3d_t >
 

Functions

bool vdd_eq (const std::vector< Wonton::Point< 2 >> &a, const std::vector< Wonton::Point< 2 >> &b, const double eps=1e-12)
 Unit tests for the Jali mesh wrapper class. More...
 
void coordinates_canonical_rotation (const Wonton::Point< 2 > &center_node, std::vector< Wonton::Point< 2 >> *const xylist)
 Rotate the xylist vector into a canonical (unique) form. The first point will be the one with the lowest angle between it, the nodeid and the x-axis. More...
 
void dual_cell_coordinates_canonical_rotation (const flecsi_mesh_2d_t &mesh_wrapper, int const nodeid, std::vector< Wonton::Point< 2 >> *const xylist)
 Rotate the xylist vector into a canonical (unique) form. The first point will be the one with the lowest angle between it, the nodeid and the x-axis. More...
 
bool faceted_poly_ok (std::vector< Wonton::Point< 3 >> const &fctpoints, std::vector< std::vector< int >> const &facets, double expected_area, double expected_volume, Wonton::Point< 3 > expected_centroid, double tol)
 Check validity of faceted polyhedron. More...
 
 TEST (FleCSI_Mesh, vdd_eq)
 Unit test for equality comparisons. More...
 
 TEST (FleCSI_Mesh, coordinates_canonical_rotation)
 Unit test for canonical rotations of coordinates. More...
 
 TEST (FleCSI_Mesh_Wrapper, ccw)
 Unit test for counter-clockwise winding of coordinates. More...
 
 TEST (FleCSI_Mesh_Wrapper, Get_Neighbor_Cells)
 Unit test for getting dual cell coordinates NOT IMPLEMENTED IN FLECSI YET ! More...
 
 TEST (FleCSI_Mesh_Wrapper, Get_Exterior_Flag)
 Unit test for getting entities on the exterior boundary. More...
 
 TEST (FleCSI_Mesh_Wrapper, Decompose_Cell_Into_Tets)
 Unit test for 5-tet hex decomposition. More...
 
 TEST (FleCSI_Mesh_Wrapper, MESH_SIDES_2D)
 Unit test for 2D sides construction and queries in the wrapper class (and not natively in FleCSI. More...
 
 TEST (FleCSI_Mesh_Wrapper, MESH_SIDES_3D)
 Unit test for 3D sides construction and queries in the wrapper class (and not natively in FleCSI). More...
 
 TEST (FleCSI_Mesh_Wrapper, MESH_WEDGES_2D)
 Unit test for 2D wedges construction and queries in the wrapper class (and not natively in FleCSI). More...
 
 TEST (FleCSI_Mesh_Wrapper, MESH_WEDGES_3D)
 Unit test for 3D wedges construction and queries in the wrapper class (and not natively in FleCSI). More...
 
 TEST (FleCSI_Mesh_Wrapper, MESH_CORNERS_2D)
 Unit test for 2D corners construction and queries in the wrapper class (and not natively in FleCSI). More...
 
 TEST (FleCSI_Mesh_Wrapper, MESH_CORNERS_3D)
 Unit test for 3D sides construction and queries in the wrapper class (and not natively in FleCSI). More...
 

Typedef Documentation

◆ flecsi_mesh_2d_t

◆ flecsi_mesh_3d_t

◆ mesh_2d_t

using mesh_2d_t = flecsi::sp::burton::burton_mesh_2d_t

◆ mesh_3d_t

using mesh_3d_t = flecsi::sp::burton::burton_mesh_3d_t

Function Documentation

◆ coordinates_canonical_rotation()

void coordinates_canonical_rotation ( const Wonton::Point< 2 > &  center_node,
std::vector< Wonton::Point< 2 >> *const  xylist 
)

Rotate the xylist vector into a canonical (unique) form. The first point will be the one with the lowest angle between it, the nodeid and the x-axis.

Parameters
[in]center_nodeThe center node to test
[in,out]xylistThe xylist vector

◆ dual_cell_coordinates_canonical_rotation()

void dual_cell_coordinates_canonical_rotation ( const flecsi_mesh_2d_t mesh_wrapper,
int const  nodeid,
std::vector< Wonton::Point< 2 >> *const  xylist 
)

Rotate the xylist vector into a canonical (unique) form. The first point will be the one with the lowest angle between it, the nodeid and the x-axis.

Parameters
[in]mesh_wrapperThe mesh wrapper
[in]nodeidThe node id
[in,out]xylistThe xylist

◆ faceted_poly_ok()

bool faceted_poly_ok ( std::vector< Wonton::Point< 3 >> const &  fctpoints,
std::vector< std::vector< int >> const &  facets,
double  expected_area,
double  expected_volume,
Wonton::Point< 3 >  expected_centroid,
double  tol 
)

Check validity of faceted polyhedron.

Parameters
fctpointsVector of unique points of facetization
facetsVector of vector of facet points (indexing fctpoints)
centroidCentroid of polyhedron
expected_areaExpected area of polyhedron surface (-1 means don't check)
expected_volumeExpected volume of polyhedron (-1 means don't check)
expected_centroidExpected centroid of polyhedron ([-99, -99, -99] means don't check)

◆ TEST() [1/12]

TEST ( FleCSI_Mesh  ,
vdd_eq   
)

Unit test for equality comparisons.

◆ TEST() [2/12]

TEST ( FleCSI_Mesh  ,
coordinates_canonical_rotation   
)

Unit test for canonical rotations of coordinates.

◆ TEST() [3/12]

TEST ( FleCSI_Mesh_Wrapper  ,
ccw   
)

Unit test for counter-clockwise winding of coordinates.

◆ TEST() [4/12]

TEST ( FleCSI_Mesh_Wrapper  ,
Get_Neighbor_Cells   
)

Unit test for getting dual cell coordinates NOT IMPLEMENTED IN FLECSI YET !

Unit test for getting neighbor cells

◆ TEST() [5/12]

TEST ( FleCSI_Mesh_Wrapper  ,
Get_Exterior_Flag   
)

Unit test for getting entities on the exterior boundary.

◆ TEST() [6/12]

TEST ( FleCSI_Mesh_Wrapper  ,
Decompose_Cell_Into_Tets   
)

Unit test for 5-tet hex decomposition.

◆ TEST() [7/12]

TEST ( FleCSI_Mesh_Wrapper  ,
MESH_SIDES_2D   
)

Unit test for 2D sides construction and queries in the wrapper class (and not natively in FleCSI.

For this we only need cells (always present), faces and nodes (always present) from FleCSI

◆ TEST() [8/12]

TEST ( FleCSI_Mesh_Wrapper  ,
MESH_SIDES_3D   
)

Unit test for 3D sides construction and queries in the wrapper class (and not natively in FleCSI).

For this we only need cells (always present), faces and nodes (always present) from FleCSI

◆ TEST() [9/12]

TEST ( FleCSI_Mesh_Wrapper  ,
MESH_WEDGES_2D   
)

Unit test for 2D wedges construction and queries in the wrapper class (and not natively in FleCSI).

For this we only need cells (always present), faces and nodes (always present) from FleCSI

◆ TEST() [10/12]

TEST ( FleCSI_Mesh_Wrapper  ,
MESH_WEDGES_3D   
)

Unit test for 3D wedges construction and queries in the wrapper class (and not natively in FleCSI).

For this we only need cells (always present), faces and nodes (always present) from FleCSI

◆ TEST() [11/12]

TEST ( FleCSI_Mesh_Wrapper  ,
MESH_CORNERS_2D   
)

Unit test for 2D corners construction and queries in the wrapper class (and not natively in FleCSI).

For this we only need cells (always present), faces and nodes (always present) from FleCSI

◆ TEST() [12/12]

TEST ( FleCSI_Mesh_Wrapper  ,
MESH_CORNERS_3D   
)

Unit test for 3D sides construction and queries in the wrapper class (and not natively in FleCSI).

For this we only need cells (always present), faces and nodes (always present) from FleCSI

◆ vdd_eq()

bool vdd_eq ( const std::vector< Wonton::Point< 2 >> &  a,
const std::vector< Wonton::Point< 2 >> &  b,
const double  eps = 1e-12 
)

Unit tests for the Jali mesh wrapper class.

file test_jali_mesh_wrapper.cc

Returns true if a == b within the accuracy 'eps'

Parameters
[in]aFirst input vector of pairs of doubles
[in]bSecond input vector of pairs of doubles
[in]epsTolerance
Returns
Whether a == b within the accuracy eps