Class with convenience functions for handling spectral mesh Class with convenience functions for handling spectral meshes. See description of spectral mesh handling in doc/metadata_info.doc and in the MOAB user's guide. More...
#include <SpectralMeshTool.hpp>
Public Member Functions | |
SpectralMeshTool (Interface *impl, int order=0) | |
Constructor. More... | |
~SpectralMeshTool () | |
Destructor. More... | |
Tag | spectral_vertices_tag (const bool create_if_missing=false) |
Return tag used to store lexicographically-ordered vertex array NOTE: If creating this tag with this call, this SpectralMeshTool instance must already have a non-zero spectral order value set on it; the size of the spectral vertices tag depends on this order. More... | |
Tag | spectral_order_tag (const bool create_if_missing=false) |
Return tag used to store spectral order. More... | |
ErrorCode | convert_to_fine (EntityHandle spectral_set) |
Convert representation from coarse to fine Each element in set, or in interface if set is not input, is converted to fine elements, using vertices in SPECTRAL_VERTICES tagged array. More... | |
ErrorCode | convert_to_coarse (int order=0, EntityHandle spectral_set=0) |
Convert representation from fine to coarse Each element in set, or in interface if set is not input, is converted to coarse elements, with fine vertices put into SPECTRAL_VERTICES tagged array. NOTE: This function assumes that each order^d (fine) elements comprise each coarse element, and are in order of fine elements in each coarse element. If order is input as 0, looks for a SPECTRAL_ORDER tag on the mesh. More... | |
template<class T > | |
ErrorCode | create_spectral_elems (const T *conn, int num_fine_elems, int dim, Range &output_range, int start_idx=0, Range *local_gids=NULL) |
Create coarse spectral elements from fine elements pointed to by conn This function creates the coarse elements by taking conn (assumed to be in FE ordering) and picking out the corner vertices to make coarse connectivity, and the other vertices (along with corners) to make SPECTRAL_VERTICES array pointed to by each entity. More... | |
void | spectral_order (int order) |
Set spectral order for this instance. More... | |
int | spectral_order () |
Get spectral order for this instance. More... | |
Static Public Attributes | |
static const short int | permute_array [] = { 0, 1, 13, 25, 3, 2, 14, 26, 7, 6, 18, 30, 11, 10, 22, 34 } |
static const short int | lin_permute_array [] = { 0, 25, 34, 11 } |
Private Attributes | |
Interface * | mbImpl |
the MB instance that this works with More... | |
Error * | mError |
error object for this tool More... | |
Tag | svTag |
SPECTRAL_VERTICES tag. More... | |
Tag | soTag |
SPECTRAL_ORDER tag. More... | |
int | spectralOrder |
order of the spectral mesh being accessed More... | |
int | spectralOrderp1 |
order of the spectral mesh being accessed plus one More... | |
Class with convenience functions for handling spectral mesh Class with convenience functions for handling spectral meshes. See description of spectral mesh handling in doc/metadata_info.doc and in the MOAB user's guide.
There are two primary representations of spectral meshes: a) coarse elements: with SPECTRAL_VERTICES lexicographically-ordered array of fine vertices on each element, and tags on vertices or on elements (with _LEX suffix) b) fine elements: as linear elements made from fine vertices, with tags on vertices
Definition at line 22 of file SpectralMeshTool.hpp.
|
inline |
Constructor.
impl | MOAB Interface instance |
order | Spectral order, defaults to 0 |
Definition at line 131 of file SpectralMeshTool.hpp.
References mError, and moab::Interface::query_interface().
|
inline |
ErrorCode moab::SpectralMeshTool::convert_to_coarse | ( | int | order = 0 , |
EntityHandle | spectral_set = 0 |
||
) |
Convert representation from fine to coarse Each element in set, or in interface if set is not input, is converted to coarse elements, with fine vertices put into SPECTRAL_VERTICES tagged array. NOTE: This function assumes that each order^d (fine) elements comprise each coarse element, and are in order of fine elements in each coarse element. If order is input as 0, looks for a SPECTRAL_ORDER tag on the mesh.
order | Order of the spectral mesh |
spectral_set | Set containing spectral elements |
Definition at line 72 of file SpectralMeshTool.cpp.
References moab::Range::begin(), moab::Interface::connect_iterate(), create_spectral_elems(), moab::CN::Dimension(), moab::Range::empty(), moab::Range::end(), ErrorCode, moab::Interface::get_entities_by_handle(), MB_SET_ERR, MB_SUCCESS, mbImpl, moab::Range::psize(), moab::Range::size(), spectralOrder, moab::Range::subset_by_dimension(), and moab::TYPE_FROM_HANDLE().
ErrorCode moab::SpectralMeshTool::convert_to_fine | ( | EntityHandle | spectral_set | ) |
Convert representation from coarse to fine Each element in set, or in interface if set is not input, is converted to fine elements, using vertices in SPECTRAL_VERTICES tagged array.
spectral_set | Set containing spectral elements |
Definition at line 59 of file SpectralMeshTool.cpp.
References MB_NOT_IMPLEMENTED.
template ErrorCode moab::SpectralMeshTool::create_spectral_elems< EntityHandle > | ( | const T * | conn, |
int | num_fine_elems, | ||
int | dim, | ||
Range & | output_range, | ||
int | start_idx = 0 , |
||
Range * | local_gids = NULL |
||
) |
Create coarse spectral elements from fine elements pointed to by conn This function creates the coarse elements by taking conn (assumed to be in FE ordering) and picking out the corner vertices to make coarse connectivity, and the other vertices (along with corners) to make SPECTRAL_VERTICES array pointed to by each entity.
conn | Connectivity of fine (linear) elements, in FE ordering |
verts_per_e | Vertices per entity |
num_fine_elems | Number of fine elements represented by conn |
spectral_set | Set to which coarse elements should be added, if any |
start_idx | Starting index in conn (for parallel support) |
local_gids | If non-null, will insert all fine vertices into this range |
Definition at line 108 of file SpectralMeshTool.cpp.
References moab::Range::begin(), dim, moab::Range::end(), ErrorCode, moab::ReadUtilIface::get_element_connect(), moab::Range::insert(), lin_permute_array, MB_CHK_SET_ERR, MB_SUCCESS, MBHEX, mbImpl, MBQUAD, permute_array, moab::Interface::query_interface(), spectral_vertices_tag(), spectralOrder, spectralOrderp1, and moab::Interface::tag_iterate().
Referenced by convert_to_coarse(), and moab::NCHelperHOMME::create_mesh().
|
inline |
Get spectral order for this instance.
Definition at line 97 of file SpectralMeshTool.hpp.
References spectralOrder.
|
inline |
Set spectral order for this instance.
order | Order set on this instance |
Definition at line 88 of file SpectralMeshTool.hpp.
References spectralOrder, and spectralOrderp1.
Tag moab::SpectralMeshTool::spectral_order_tag | ( | const bool | create_if_missing = false | ) |
Return tag used to store spectral order.
so_tag | Spectral order tag |
create_if_missing | If true, will create this tag if it doesn't exist already |
create_if_missing | If true, will create this tag if it doesn't exist already |
Definition at line 40 of file SpectralMeshTool.cpp.
References moab::dum, ErrorCode, MB_SUCCESS, MB_TAG_CREAT, MB_TAG_DENSE, MB_TYPE_INTEGER, mbImpl, soTag, and moab::Interface::tag_get_handle().
Tag moab::SpectralMeshTool::spectral_vertices_tag | ( | const bool | create_if_missing = false | ) |
Return tag used to store lexicographically-ordered vertex array NOTE: If creating this tag with this call, this SpectralMeshTool instance must already have a non-zero spectral order value set on it; the size of the spectral vertices tag depends on this order.
sv_tag | Spectral vertices tag |
create_if_missing | If true, will create this tag if it doesn't exist already |
Definition at line 17 of file SpectralMeshTool.cpp.
References ErrorCode, MB_SET_ERR_RET_VAL, MB_SUCCESS, MB_TAG_CREAT, MB_TAG_DENSE, MB_TYPE_HANDLE, mbImpl, spectralOrder, spectralOrderp1, svTag, and moab::Interface::tag_get_handle().
Referenced by moab::NCHelperHOMME::create_mesh(), and create_spectral_elems().
|
static |
Definition at line 109 of file SpectralMeshTool.hpp.
Referenced by create_spectral_elems().
|
private |
the MB instance that this works with
Definition at line 113 of file SpectralMeshTool.hpp.
Referenced by convert_to_coarse(), create_spectral_elems(), spectral_order_tag(), and spectral_vertices_tag().
|
private |
error object for this tool
Definition at line 116 of file SpectralMeshTool.hpp.
Referenced by SpectralMeshTool().
|
static |
Definition at line 107 of file SpectralMeshTool.hpp.
Referenced by create_spectral_elems().
|
private |
SPECTRAL_ORDER tag.
Definition at line 122 of file SpectralMeshTool.hpp.
Referenced by spectral_order_tag().
|
private |
order of the spectral mesh being accessed
Definition at line 125 of file SpectralMeshTool.hpp.
Referenced by convert_to_coarse(), create_spectral_elems(), spectral_order(), and spectral_vertices_tag().
|
private |
order of the spectral mesh being accessed plus one
Definition at line 128 of file SpectralMeshTool.hpp.
Referenced by create_spectral_elems(), spectral_order(), and spectral_vertices_tag().
|
private |
SPECTRAL_VERTICES tag.
Definition at line 119 of file SpectralMeshTool.hpp.
Referenced by spectral_vertices_tag().