MeshKit
1.0
|
A meshing geometry as Cartesian structured mesh It makes constructs tree structure with triangles and makes hexes bounding geometry With ray-tracing, find intersections and determine element inside/outside/boundary. Intersection fraction is stored to boundary elements. Element inside/outside/boundary status are stored as tag. More...
#include <meshkit/EBMesher.hpp>
Public Member Functions | |
EBMesher (MKCore *mkcore, const MEntVector &me_vec, double size=-1., bool use_geom=true, int add_layer=3) | |
Bare constructor. | |
virtual | ~EBMesher () |
Destructor. | |
virtual const moab::EntityType * | mesh_types_arr () const |
Return the mesh entity types operated on by this scheme. | |
virtual bool | add_modelent (ModelEnt *model_ent) |
Add a ModelEnt to this operation's MEntSelection The MEntSelection is a map, and can only have a given entity once. | |
int | set_division (double *min, double *max) |
set # of divisions (x/y/z directions) of Cartesian box to use SCDMesh output | |
virtual void | setup_this () |
Setup is a no-op, but must be provided since it's pure virtual. | |
virtual void | execute_this () |
void | get_grid_and_edges_techX (double *boxMin, double *boxMax, int *nDiv, std::map< CutCellSurfEdgeKey, std::vector< double >, LessThan > &rmdCutCellSurfEdge, std::vector< int > &rvnInsideCell, bool isCornerExterior=true) |
query function for techX | |
bool | get_grid_and_edges (double *boxMin, double *boxMax, int *nDiv, std::map< CutCellSurfEdgeKey, std::vector< double >, LessThan > &rmdCutCellEdge, std::vector< int > &rvnInsideCell, bool isCornerExterior=true) |
query function to get multiple cut-cell edges | |
bool | get_volume_fraction (int vol_frac_div) |
get volume fraction for each material | |
void | export_mesh (const char *file_name, bool separate=false) |
export mesh to file | |
void | set_num_interval (int *n_interval) |
set number of intervals | |
void | increase_box (double box_increase) |
set number of intervals | |
void | use_whole_geom (int use) |
set if mesh for whole geometry at once or individually | |
void | use_mesh_geometry (bool use) |
set if mesh based geometry is used | |
void | set_obb_tree_box_dimension () |
construct obb tree with faceted geometry and set the box max/min coordinates | |
Static Public Member Functions | |
static const char * | name () |
Get class name. | |
static bool | can_mesh (iBase_EntityType dim) |
Function returning whether this scheme can mesh entities of t the specified dimension. | |
static bool | can_mesh (ModelEnt *me) |
Function returning whether this scheme can mesh the specified entity. | |
static const moab::EntityType * | output_types () |
Get list of mesh entity types that can be generated. | |
Private Member Functions | |
EBMesher (const EBMesher &) | |
No copy constructor, since there's only meant to be one of these. | |
MeshOp * | get_scd_mesher () |
EBMesher & | operator= (const EBMesher &) |
No operator=, since there's only meant to be one of these. | |
EdgeStatus | get_edge_status (const double dZ, int &iSkip) |
get hex edge status (inside/outside/boundary) | |
bool | set_neighbor_hex_status (int dir, int i, int j, int k) |
set hex status for neighboring elements | |
bool | set_hex_status (int index, EdgeStatus value, int dir) |
bool | set_edge_status (int dir) |
set edge status | |
void | set_tag_info () |
set all produced mesh information as tag \ hex status, edge-cut information..... | |
void | write_mesh (const char *file_name, int type, iBase_EntityHandle *handles, int &n_elem) |
wirte mesh | |
double | get_edge_fraction (int idHex, int dir) |
get edge fraction information | |
double | get_uncut_edge_fraction (int i, int j, int k, int dir) |
get if the edge is fully inside(returns 1) or outside(returns 0) | |
bool | is_shared_overlapped_surf (int index) |
check if the intersected surface geometry is shared or overlapped | |
bool | move_intersections (int n_dir, int n_inter, double start_pnt[3]) |
move intersection pairs to check element status | |
bool | get_inside_hex (std::vector< int > &rvnInsideCell) |
get inside status elements | |
bool | is_ray_move_and_set_overlap_surf (bool &bMoveOnce) |
check if ray is passing shared vertices or edges \ And, check if the passing surface is overlapped one | |
void | remove_intersection_duplicates () |
bool | export_fraction_edges (std::map< CutCellSurfEdgeKey, std::vector< double >, LessThan > &rmdCutCellSurfEdge) |
bool | export_fraction_points (std::map< CutCellSurfEdgeKey, std::vector< double >, LessThan > &mdCutCellEdge) |
bool | make_edge (double ePnt[6], std::vector< iBase_EntityHandle > &edge_handles) |
Private Attributes | |
iBase_TagHandle | m_elemStatusTag |
iBase_TagHandle | m_edgeCutFracLengthTag |
iBase_TagHandle | m_edgeCutFracTag |
iBase_TagHandle | m_volFracLengthTag |
iBase_TagHandle | m_volFracHandleTag |
iBase_TagHandle | m_volFracTag |
iBase_TagHandle | m_bbTag |
iMesh_Instance | m_mesh |
iBase_EntitySetHandle | m_hRootSet |
std::vector< IntersectDist > | m_vIntersection |
int | m_nTri |
int | m_nHex |
int | m_iInter |
int | m_nFraction |
int | m_iStartHex |
int | m_nMove |
int | m_nAddLayer |
int | m_nIteration |
int | m_iOverlap |
int | m_iElem |
int | m_nNode [3] |
int | m_nDiv [3] |
int | m_iFirstP |
int | m_iSecondP |
double | m_dFirstP |
double | m_dSecondP |
double | m_curPnt |
double | m_prevPnt |
double | m_boxIncrease |
double | m_dIntervalSize [3] |
double | m_origin_coords [3] |
double | m_dInputSize |
double | m_min [3] |
double | m_max [3] |
EdgeStatus | m_nStatus |
bool | m_bMovedOnce |
bool | m_bUseGeom |
bool | m_bUseWholeGeom |
bool | m_bUseMeshGeom |
std::vector< iBase_EntityHandle > | m_vhVertex |
std::vector< int > | m_vnHexStatus |
std::map< int, CutFraction > | m_mdCutFraction |
std::vector< EdgeStatus > | m_vnEdgeStatus [3] |
Static Private Attributes | |
static int | init |
Static variable, used in registration. |
A meshing geometry as Cartesian structured mesh It makes constructs tree structure with triangles and makes hexes bounding geometry With ray-tracing, find intersections and determine element inside/outside/boundary. Intersection fraction is stored to boundary elements. Element inside/outside/boundary status are stored as tag.
Definition at line 122 of file EBMesher.hpp.
EBMesher | ( | MKCore * | mkcore, |
const MEntVector & | me_vec, | ||
double | size = -1. , |
||
bool | use_geom = true , |
||
int | add_layer = 3 |
||
) |
Bare constructor.
Definition at line 46 of file EBMesher.cpp.
~EBMesher | ( | ) | [virtual] |
Destructor.
Definition at line 97 of file EBMesher.cpp.
No copy constructor, since there's only meant to be one of these.
bool add_modelent | ( | ModelEnt * | model_ent | ) | [virtual] |
Add a ModelEnt to this operation's MEntSelection The MEntSelection is a map, and can only have a given entity once.
model_ent | ModelEnt being added |
Reimplemented from MeshOp.
Definition at line 108 of file EBMesher.cpp.
static bool can_mesh | ( | iBase_EntityType | dim | ) | [inline, static] |
Function returning whether this scheme can mesh entities of t the specified dimension.
dim | entity dimension |
Definition at line 142 of file EBMesher.hpp.
Function returning whether this scheme can mesh the specified entity.
Used by MeshOpFactory to find scheme for an entity.
me | ModelEnt being queried |
Definition at line 102 of file EBMesher.cpp.
void execute_this | ( | ) | [virtual] |
\ The only setup/execute function we need, since meshing vertices is trivial
Implements GraphNode.
Definition at line 189 of file EBMesher.cpp.
bool export_fraction_edges | ( | std::map< CutCellSurfEdgeKey, std::vector< double >, LessThan > & | rmdCutCellSurfEdge | ) | [private] |
bool export_fraction_points | ( | std::map< CutCellSurfEdgeKey, std::vector< double >, LessThan > & | mdCutCellEdge | ) | [private] |
void export_mesh | ( | const char * | file_name, |
bool | separate = false |
||
) |
export mesh to file
file_name | export file name |
separate | export file separately(inside/outside/boundary) |
double get_edge_fraction | ( | int | idHex, |
int | dir | ||
) | [private] |
get edge fraction information
idHex | index in m_mdCutFraction |
dir | ray direction |
EdgeStatus get_edge_status | ( | const double | dZ, |
int & | iSkip | ||
) | [private] |
get hex edge status (inside/outside/boundary)
dZ | edge end coordinate |
iSkip | how many index skipped for next intersection checking |
Definition at line 464 of file EBMesher.cpp.
bool get_grid_and_edges | ( | double * | boxMin, |
double * | boxMax, | ||
int * | nDiv, | ||
std::map< CutCellSurfEdgeKey, std::vector< double >, LessThan > & | rmdCutCellEdge, | ||
std::vector< int > & | rvnInsideCell, | ||
bool | isCornerExterior = true |
||
) |
query function to get multiple cut-cell edges
boxMin | Cartesian box min coordinates returned |
boxMax | Cartesian box max coordinates returned |
nDiv | nDiv(x/yz directions) returned |
rmdCutCellEdge | map of cut-cell surface index and edge cut information returned |
rvnInsideCell | Inside elements returned |
isCornerExterior | if box corner is exterior returned |
void get_grid_and_edges_techX | ( | double * | boxMin, |
double * | boxMax, | ||
int * | nDiv, | ||
std::map< CutCellSurfEdgeKey, std::vector< double >, LessThan > & | rmdCutCellSurfEdge, | ||
std::vector< int > & | rvnInsideCell, | ||
bool | isCornerExterior = true |
||
) |
query function for techX
boxMin | Cartesian box min coordinates returned |
boxMax | Cartesian box max coordinates returned |
nDiv | nDiv(x/yz directions) returned |
rmdCutCellSurfEdge | map of cut-cell surface index and edge cut information returned |
rvnInsideCell | Inside elements returned |
isCornerExterior | if box corner is exterior returned |
bool get_inside_hex | ( | std::vector< int > & | rvnInsideCell | ) | [private] |
get inside status elements
rvnInsideCell | cell indices (i,j,k triple) |
MeshOp * get_scd_mesher | ( | ) | [private] |
Definition at line 117 of file EBMesher.cpp.
double get_uncut_edge_fraction | ( | int | i, |
int | j, | ||
int | k, | ||
int | dir | ||
) | [private] |
get if the edge is fully inside(returns 1) or outside(returns 0)
i | index for i direction |
j | index for j direction |
k | index for k direction |
dir | ray direction |
Definition at line 1585 of file EBMesher.cpp.
bool get_volume_fraction | ( | int | vol_frac_div | ) |
get volume fraction for each material
vol_frac_div | resolution to get volume fraction |
Definition at line 1760 of file EBMesher.cpp.
void increase_box | ( | double | box_increase | ) | [inline] |
set number of intervals
box_increase | number of interval array for x/y/z directions |
Definition at line 494 of file EBMesher.hpp.
bool is_ray_move_and_set_overlap_surf | ( | bool & | bMoveOnce | ) | [private] |
check if ray is passing shared vertices or edges \ And, check if the passing surface is overlapped one
bMoveOnce | if ray is already moved before |
Definition at line 1683 of file EBMesher.cpp.
bool is_shared_overlapped_surf | ( | int | index | ) | [private] |
check if the intersected surface geometry is shared or overlapped
index | intersection index in m_vIntersection vector |
bool make_edge | ( | double | ePnt[6], |
std::vector< iBase_EntityHandle > & | edge_handles | ||
) | [private] |
virtual const moab::EntityType* mesh_types_arr | ( | ) | const [inline, virtual] |
Return the mesh entity types operated on by this scheme.
moab::MBMAXTYPE
Implements MeshOp.
Definition at line 161 of file EBMesher.hpp.
bool move_intersections | ( | int | n_dir, |
int | n_inter, | ||
double | start_pnt[3] | ||
) | [private] |
move intersection pairs to check element status
n_dir | ray direction |
n_inter | index of intersection points |
start_pnt | ray starting point |
static const char* name | ( | ) | [inline, static] |
Get class name.
Definition at line 135 of file EBMesher.hpp.
No operator=, since there's only meant to be one of these.
const moab::EntityType * output_types | ( | ) | [static] |
Get list of mesh entity types that can be generated.
moab::MBMAXTYPE
Definition at line 43 of file EBMesher.cpp.
void remove_intersection_duplicates | ( | ) | [private] |
Definition at line 1730 of file EBMesher.cpp.
int set_division | ( | double * | min, |
double * | max | ||
) |
set # of divisions (x/y/z directions) of Cartesian box to use SCDMesh output
min | Cartesian box min coordinates |
max | Cartesian box max coordinates |
bool set_edge_status | ( | int | dir | ) | [private] |
set edge status
dir | ray direction |
Definition at line 596 of file EBMesher.cpp.
bool set_hex_status | ( | int | index, |
EdgeStatus | value, | ||
int | dir | ||
) | [private] |
\ brief set hex status by edge status
index | hex index in m_vnHexStatus vector |
value | edge status |
dir | ray direction |
Definition at line 575 of file EBMesher.cpp.
bool set_neighbor_hex_status | ( | int | dir, |
int | i, | ||
int | j, | ||
int | k | ||
) | [private] |
set hex status for neighboring elements
dir | current fired ray direction |
i | index for i direction |
j | index for j direction |
k | index for k direction |
Definition at line 537 of file EBMesher.cpp.
void set_num_interval | ( | int * | n_interval | ) |
set number of intervals
n_interval | number of interval array for x/y/z directions |
Definition at line 263 of file EBMesher.cpp.
void set_obb_tree_box_dimension | ( | ) |
construct obb tree with faceted geometry and set the box max/min coordinates
void set_tag_info | ( | ) | [private] |
set all produced mesh information as tag \ hex status, edge-cut information.....
void setup_this | ( | ) | [virtual] |
Setup is a no-op, but must be provided since it's pure virtual.
Implements GraphNode.
Definition at line 125 of file EBMesher.cpp.
void use_mesh_geometry | ( | bool | use | ) | [inline] |
set if mesh based geometry is used
use | if mesh based geometry is used |
Definition at line 504 of file EBMesher.hpp.
void use_whole_geom | ( | int | use | ) | [inline] |
set if mesh for whole geometry at once or individually
use | if mesh for whole geometry at once |
Definition at line 499 of file EBMesher.hpp.
void write_mesh | ( | const char * | file_name, |
int | type, | ||
iBase_EntityHandle * | handles, | ||
int & | n_elem | ||
) | [private] |
wirte mesh
file_name | |
type | element type (inside:0, outside:1, boundary:2) |
handles | element handles |
n_elem | # of elements |
int init [static, private] |
Static variable, used in registration.
Definition at line 373 of file EBMesher.hpp.
iBase_TagHandle m_bbTag [private] |
Definition at line 255 of file EBMesher.hpp.
bool m_bMovedOnce [private] |
Definition at line 267 of file EBMesher.hpp.
double m_boxIncrease [private] |
Definition at line 263 of file EBMesher.hpp.
bool m_bUseGeom [private] |
Definition at line 267 of file EBMesher.hpp.
bool m_bUseMeshGeom [private] |
Definition at line 267 of file EBMesher.hpp.
bool m_bUseWholeGeom [private] |
Definition at line 267 of file EBMesher.hpp.
double m_curPnt [private] |
Definition at line 263 of file EBMesher.hpp.
double m_dFirstP [private] |
Definition at line 263 of file EBMesher.hpp.
double m_dInputSize [private] |
Definition at line 263 of file EBMesher.hpp.
double m_dIntervalSize[3] [private] |
Definition at line 263 of file EBMesher.hpp.
double m_dSecondP [private] |
Definition at line 263 of file EBMesher.hpp.
iBase_TagHandle m_edgeCutFracLengthTag [private] |
Definition at line 255 of file EBMesher.hpp.
iBase_TagHandle m_edgeCutFracTag [private] |
Definition at line 255 of file EBMesher.hpp.
iBase_TagHandle m_elemStatusTag [private] |
Definition at line 255 of file EBMesher.hpp.
iBase_EntitySetHandle m_hRootSet [private] |
Definition at line 258 of file EBMesher.hpp.
int m_iElem [private] |
Definition at line 260 of file EBMesher.hpp.
int m_iFirstP [private] |
Definition at line 260 of file EBMesher.hpp.
int m_iInter [private] |
Definition at line 260 of file EBMesher.hpp.
int m_iOverlap [private] |
Definition at line 260 of file EBMesher.hpp.
int m_iSecondP [private] |
Definition at line 260 of file EBMesher.hpp.
int m_iStartHex [private] |
Definition at line 260 of file EBMesher.hpp.
double m_max[3] [private] |
Definition at line 263 of file EBMesher.hpp.
std::map<int, CutFraction> m_mdCutFraction [private] |
Definition at line 270 of file EBMesher.hpp.
iMesh_Instance m_mesh [private] |
Definition at line 257 of file EBMesher.hpp.
double m_min[3] [private] |
Definition at line 263 of file EBMesher.hpp.
int m_nAddLayer [private] |
Definition at line 260 of file EBMesher.hpp.
int m_nDiv[3] [private] |
Definition at line 260 of file EBMesher.hpp.
int m_nFraction [private] |
Definition at line 260 of file EBMesher.hpp.
int m_nHex [private] |
Definition at line 260 of file EBMesher.hpp.
int m_nIteration [private] |
Definition at line 260 of file EBMesher.hpp.
int m_nMove [private] |
Definition at line 260 of file EBMesher.hpp.
int m_nNode[3] [private] |
Definition at line 260 of file EBMesher.hpp.
EdgeStatus m_nStatus [private] |
Definition at line 266 of file EBMesher.hpp.
int m_nTri [private] |
Definition at line 260 of file EBMesher.hpp.
double m_origin_coords[3] [private] |
Definition at line 263 of file EBMesher.hpp.
double m_prevPnt [private] |
Definition at line 263 of file EBMesher.hpp.
std::vector<iBase_EntityHandle> m_vhVertex [private] |
Definition at line 268 of file EBMesher.hpp.
std::vector<IntersectDist> m_vIntersection [private] |
Definition at line 259 of file EBMesher.hpp.
std::vector<EdgeStatus> m_vnEdgeStatus[3] [private] |
Definition at line 271 of file EBMesher.hpp.
std::vector<int> m_vnHexStatus [private] |
Definition at line 269 of file EBMesher.hpp.
iBase_TagHandle m_volFracHandleTag [private] |
Definition at line 255 of file EBMesher.hpp.
iBase_TagHandle m_volFracLengthTag [private] |
Definition at line 255 of file EBMesher.hpp.
iBase_TagHandle m_volFracTag [private] |
Definition at line 255 of file EBMesher.hpp.