#include <ScdInterface.hpp>
Public Member Functions | |
~ScdBox () | |
Destructor. More... | |
ScdInterface * | sc_impl () const |
Return the ScdInterface responsible for this box. More... | |
ErrorCode | add_vbox (ScdBox *vbox, HomCoord from1, HomCoord to1, HomCoord from2, HomCoord to2, HomCoord from3, HomCoord to3, bool bb_input=false, const HomCoord &bb_min=HomCoord::getUnitv(0), const HomCoord &bb_max=HomCoord::getUnitv(0)) |
Add a vertex box to this box. More... | |
bool | boundary_complete () const |
Return whether this box has all its vertices defined. More... | |
int | box_dimension () const |
Return highest topological dimension of box. More... | |
EntityHandle | start_vertex () const |
Starting vertex handle for this box. More... | |
EntityHandle | start_element () const |
Starting entity handle for this box. More... | |
int | num_elements () const |
Return the number of elements in the box. More... | |
int | num_vertices () const |
Return the number of vertices in the box. More... | |
const int * | box_dims () const |
Return the parametric coordinates for this box. More... | |
HomCoord | box_min () const |
Return the lower corner parametric coordinates for this box. More... | |
HomCoord | box_max () const |
Return the upper corner parametric coordinates for this box. More... | |
HomCoord | box_size () const |
Return the parameter extents for this box. More... | |
void | box_size (int *ijk) const |
Return the parametric extents for this box. More... | |
void | box_size (int &i, int &j, int &k) const |
Return the parametric extents for this box. More... | |
EntityHandle | get_element (const HomCoord &ijk) const |
Get the element at the specified coordinates. More... | |
EntityHandle | get_element (int i, int j=0, int k=0) const |
Get the element at the specified coordinates. More... | |
EntityHandle | get_vertex (const HomCoord &ijk) const |
Get the vertex at the specified coordinates. More... | |
EntityHandle | get_vertex (int i, int j=0, int k=0) const |
Get the vertex at the specified coordinates. More... | |
ErrorCode | get_params (EntityHandle ent, int &i, int &j, int &k, int &dir) const |
Get parametric coordinates of the specified entity. More... | |
ErrorCode | get_params (EntityHandle ent, int &i, int &j, int &k) const |
Get parametric coordinates of the specified entity, intermediate entities not allowed (no dir parameter) More... | |
ErrorCode | get_params (EntityHandle ent, HomCoord &ijkd) const |
Get parametric coordinates of the specified entity. More... | |
ErrorCode | get_adj_edge_or_face (int dim, int i, int j, int k, int dir, EntityHandle &ent, bool create_if_missing=true) const |
Get the adjacent edge or face at a parametric location This function gets the left (i=0), front (j=0), or bottom (k=0) edge or face for a parametric element. Left, front, or bottom is indicated by dir = 0, 1, or 2, resp. All edges and faces in a structured mesh block can be accessed using these parameters. More... | |
bool | contains (int i, int j, int k) const |
Return whether the box contains the parameters passed in. More... | |
bool | contains (const HomCoord &ijk) const |
Return whether the box contains the parameters passed in. More... | |
void | box_set (EntityHandle this_set) |
Set/Get the entity set representing the box. More... | |
EntityHandle | box_set () |
ErrorCode | get_coordinate_arrays (double *&xc, double *&yc, double *&zc) |
Get coordinate arrays for vertex coordinates for a structured block. More... | |
ErrorCode | get_coordinate_arrays (const double *&xc, const double *&yc, const double *&zc) const |
Get read-only coordinate arrays for vertex coordinates for a structured block. More... | |
bool | locally_periodic_i () const |
Return whether box is locally periodic in i. More... | |
bool | locally_periodic_j () const |
Return whether box is locally periodic in j. More... | |
bool | locally_periodic_k () const |
Return whether box is locally periodic in k. More... | |
void | locally_periodic (bool lperiodic[3]) |
Set local periodicity. More... | |
const int * | locally_periodic () const |
Get local periodicity. More... | |
ScdParData & | par_data () |
Return parallel data. More... | |
const ScdParData & | par_data () const |
Return parallel data. More... | |
void | par_data (const ScdParData &par_datap) |
set parallel data More... | |
Private Member Functions | |
ScdBox (ScdInterface *sc_impl, EntityHandle box_set, EntitySequence *seq1, EntitySequence *seq2=NULL) | |
Constructor. More... | |
EntityHandle | get_vertex_from_seq (int i, int j, int k) const |
function to get vertex handle directly from sequence More... | |
ErrorCode | vert_dat (ScdVertexData *vert_dat) |
set the vertex sequence More... | |
ScdVertexData * | vert_dat () const |
get the vertex sequence More... | |
ErrorCode | elem_seq (EntitySequence *elem_seq) |
set the element sequence More... | |
StructuredElementSeq * | elem_seq () const |
get the element sequence More... | |
void | start_vertex (EntityHandle startv) |
Set the starting vertex handle for this box. More... | |
void | start_element (EntityHandle starte) |
Set the starting entity handle for this box. More... | |
Private Attributes | |
ScdInterface * | scImpl |
interface instance More... | |
EntityHandle | boxSet |
entity set representing this box More... | |
ScdVertexData * | vertDat |
vertex sequence this box represents, if there's only one, otherwise they're retrieved from the element sequence More... | |
StructuredElementSeq * | elemSeq |
element sequence this box represents More... | |
EntityHandle | startVertex |
starting vertex handle for this box More... | |
EntityHandle | startElem |
starting element handle for this box More... | |
int | boxDims [6] |
lower and upper corners More... | |
int | locallyPeriodic [3] |
is locally periodic in i or j or k More... | |
ScdParData | parData |
parallel data associated with this box, if any More... | |
HomCoord | boxSize |
parameter extents More... | |
int | boxSizeIJ |
convenience parameters, (boxSize[1]-1)*(boxSize[0]-1) and boxSize[0]-1 More... | |
int | boxSizeIJM1 |
int | boxSizeIM1 |
Friends | |
class | ScdInterface |
Definition at line 506 of file ScdInterface.hpp.
moab::ScdBox::~ScdBox | ( | ) |
Destructor.
Definition at line 548 of file ScdInterface.cpp.
References moab::ScdInterface::box_set_tag(), boxSet, moab::Core::is_valid(), moab::ScdInterface::mbImpl, moab::ScdInterface::remove_box(), scImpl, and moab::Interface::tag_set_data().
|
private |
Constructor.
Create a structured box instance; this constructor is private because it should only be called from ScdInterface, a friend class. This constructor takes two sequences, one of which can be NULL. If both sequences come in non-NULL, the first should be a VertexSequence* corresponding to a structured vertex sequence and the second should be a StructuredElementSeq*. If the 2nd is NULL, the first can be either of those types. The other members of this class are taken from the sequences (e.g. parametric space) or the box set argument. Tags on the box set should be set from the caller.
sc_impl | A ScdInterface instance |
box_set | Entity set representing this rectangle |
seq1 | An EntitySequence (see ScdBox description) |
seq2 | An EntitySequence (see ScdBox description), or NULL |
Definition at line 474 of file ScdInterface.cpp.
References moab::ScdInterface::add_box(), moab::Range::begin(), boxDims, moab::ScdInterface::boxDimsTag, moab::ScdInterface::boxPeriodicTag, boxSize, boxSizeIJ, boxSizeIJM1, boxSizeIM1, moab::EntitySequence::data(), elemSeq, moab::Range::empty(), ErrorCode, moab::Interface::get_entities_by_dimension(), locallyPeriodic, moab::ScdElementData::max_params(), moab::ScdVertexData::max_params(), MB_SUCCESS, moab::ScdInterface::mbImpl, moab::ScdElementData::min_params(), moab::ScdVertexData::min_params(), scImpl, moab::StructuredElementSeq::sdata(), moab::EntitySequence::start_handle(), moab::SequenceData::start_handle(), startElem, startVertex, moab::Interface::tag_get_data(), and vertDat.
ErrorCode moab::ScdBox::add_vbox | ( | ScdBox * | vbox, |
HomCoord | from1, | ||
HomCoord | to1, | ||
HomCoord | from2, | ||
HomCoord | to2, | ||
HomCoord | from3, | ||
HomCoord | to3, | ||
bool | bb_input = false , |
||
const HomCoord & | bb_min = HomCoord::getUnitv( 0 ) , |
||
const HomCoord & | bb_max = HomCoord::getUnitv( 0 ) |
||
) |
Add a vertex box to this box.
Definition at line 580 of file ScdInterface.cpp.
References moab::ScdElementData::add_vsequence(), elemSeq, ErrorCode, moab::StructuredElementSeq::sdata(), and vertDat.
Referenced by moab::ScdInterface::construct_box().
bool moab::ScdBox::boundary_complete | ( | ) | const |
Return whether this box has all its vertices defined.
Tests whether vertex boxs added with add_vbox have completely defined the vertex parametric space for this box.
Definition at line 598 of file ScdInterface.cpp.
References moab::StructuredElementSeq::boundary_complete(), and elemSeq.
Referenced by moab::ScdNCHelper::create_mesh().
|
inline |
Return highest topological dimension of box.
Definition at line 575 of file ScdInterface.cpp.
References moab::Interface::dimension_from_handle(), moab::ScdInterface::mbImpl, scImpl, and startElem.
Referenced by get_params(), and moab::ScdInterface::tag_shared_vertices().
|
inline |
Return the parametric coordinates for this box.
Definition at line 1520 of file ScdInterface.hpp.
References boxDims.
Referenced by moab::ScdInterface::assign_global_ids(), and moab::ScdInterface::get_shared_vertices().
|
inline |
Return the upper corner parametric coordinates for this box.
Definition at line 1530 of file ScdInterface.hpp.
References boxDims.
Referenced by moab::Skinner::skin_box().
|
inline |
Return the lower corner parametric coordinates for this box.
Definition at line 1525 of file ScdInterface.hpp.
References boxDims.
Referenced by moab::Skinner::skin_box().
|
inline |
Definition at line 1594 of file ScdInterface.hpp.
References boxSet.
|
inline |
Set/Get the entity set representing the box.
Definition at line 1589 of file ScdInterface.hpp.
References boxSet.
Referenced by moab::ScdInterface::construct_box(), moab::ScdNCHelper::create_mesh(), and moab::ScdInterface::tag_shared_vertices().
|
inline |
Return the parameter extents for this box.
Definition at line 1535 of file ScdInterface.hpp.
References boxSize.
Referenced by moab::ScdInterface::construct_box().
|
inline |
|
inline |
|
inline |
Return whether the box contains the parameters passed in.
i | Parametric coordinates being evaluated |
j | Parametric coordinates being evaluated |
k | Parametric coordinates being evaluated |
Definition at line 1579 of file ScdInterface.hpp.
References boxDims.
|
inline |
Return whether the box contains the parameters passed in.
i | Parametric coordinates being evaluated |
j | Parametric coordinates being evaluated |
k | Parametric coordinates being evaluated |
Definition at line 1584 of file ScdInterface.hpp.
|
inlineprivate |
|
private |
set the element sequence
Definition at line 628 of file ScdInterface.cpp.
References boxSize, boxSizeIJM1, boxSizeIM1, elemSeq, moab::StructuredElementSeq::is_periodic(), locallyPeriodic, and MB_SUCCESS.
Referenced by moab::ScdInterface::construct_box().
ErrorCode moab::ScdBox::get_adj_edge_or_face | ( | int | dim, |
int | i, | ||
int | j, | ||
int | k, | ||
int | dir, | ||
EntityHandle & | ent, | ||
bool | create_if_missing = true |
||
) | const |
Get the adjacent edge or face at a parametric location This function gets the left (i=0), front (j=0), or bottom (k=0) edge or face for a parametric element. Left, front, or bottom is indicated by dir = 0, 1, or 2, resp. All edges and faces in a structured mesh block can be accessed using these parameters.
Get the entity of specified dimension adjacent to parametric element.
dim | Dimension of adjacent entity being requested |
i | Parametric coordinates of cell being evaluated |
j | Parametric coordinates of cell being evaluated |
k | Parametric coordinates of cell being evaluated |
dir | Direction (0, 1, or 2), for getting adjacent edges (2d, 3d) or faces (3d) |
ent | Entity returned from this function |
create_if_missing | If true, creates the entity if it doesn't already exist |
dim | Dimension of adjacent entity being requested |
i | Parametric coordinates of cell being evaluated |
j | Parametric coordinates of cell being evaluated |
k | Parametric coordinates of cell being evaluated |
dir | Direction (0, 1, or 2), for getting adjacent edges (2d, 3d) or faces (3d) |
ent | EntityHandle of adjacent entity |
create_if_missing | If true, creates the entity if it doesn't already exist |
Definition at line 669 of file ScdInterface.cpp.
References moab::Range::begin(), boxDims, moab::Interface::create_element(), dim, ErrorCode, moab::Interface::get_adjacencies(), get_vertex(), moab::ScdInterface::impl(), locallyPeriodic, MB_SUCCESS, MBEDGE, MBQUAD, scImpl, and moab::Range::size().
Referenced by moab::Skinner::skin_box().
ErrorCode moab::ScdBox::get_coordinate_arrays | ( | const double *& | xc, |
const double *& | yc, | ||
const double *& | zc | ||
) | const |
Get read-only coordinate arrays for vertex coordinates for a structured block.
Returns error if there isn't a single vertex sequence associated with this structured block
xc | X coordinate array pointer returned |
yc | Y coordinate array pointer returned |
zc | Z coordinate array pointer returned |
Definition at line 613 of file ScdInterface.cpp.
References moab::SequenceData::get_sequence_data(), MB_SUCCESS, and vertDat.
ErrorCode moab::ScdBox::get_coordinate_arrays | ( | double *& | xc, |
double *& | yc, | ||
double *& | zc | ||
) |
Get coordinate arrays for vertex coordinates for a structured block.
Returns error if there isn't a single vertex sequence associated with this structured block
xc | X coordinate array pointer returned |
yc | Y coordinate array pointer returned |
zc | Z coordinate array pointer returned |
Definition at line 603 of file ScdInterface.cpp.
References moab::SequenceData::get_sequence_data(), MB_SUCCESS, and vertDat.
Referenced by moab::ScdInterface::construct_box(), and moab::ScdNCHelper::create_mesh().
|
inline |
Get the element at the specified coordinates.
ijk | Parametric coordinates being evaluated |
Definition at line 1561 of file ScdInterface.hpp.
Referenced by moab::Core::create_scd_sequence(), and main().
|
inline |
Get the element at the specified coordinates.
i | Parametric coordinates being evaluated |
j | Parametric coordinates being evaluated |
k | Parametric coordinates being evaluated |
Definition at line 1554 of file ScdInterface.hpp.
References boxDims, boxSizeIJM1, boxSizeIM1, and startElem.
ErrorCode moab::ScdBox::get_params | ( | EntityHandle | ent, |
HomCoord & | ijkd | ||
) | const |
Get parametric coordinates of the specified entity.
This function returns MB_ENTITY_NOT_FOUND if the entity is not in this ScdBox.
ent | Entity being queried |
ijkd | Parametric coordinates returned (including direction, in case of getting adjacent edges (2d, 3d) or faces (3d)) |
Definition at line 640 of file ScdInterface.cpp.
References box_dimension(), moab::Interface::dimension_from_handle(), elemSeq, moab::StructuredElementSeq::get_params(), moab::ScdVertexData::get_params(), moab::ScdInterface::impl(), MB_NOT_IMPLEMENTED, scImpl, and vertDat.
|
inline |
Get parametric coordinates of the specified entity, intermediate entities not allowed (no dir parameter)
This function returns MB_ENTITY_NOT_FOUND if the entity is not in this ScdBox, or MB_FAILURE if the entity is an intermediate-dimension entity.
ent | Entity being queried |
i | Parametric coordinates returned |
j | Parametric coordinates returned |
k | Parametric coordinates returned |
Definition at line 1624 of file ScdInterface.hpp.
References ErrorCode, get_params(), and MB_SUCCESS.
|
inline |
Get parametric coordinates of the specified entity.
This function returns MB_ENTITY_NOT_FOUND if the entity is not in this ScdBox.
ent | Entity being queried |
i | Parametric coordinates returned |
j | Parametric coordinates returned |
k | Parametric coordinates returned |
dir | Parametric coordinate direction returned (in case of getting adjacent edges (2d, 3d) or faces (3d); not modified otherwise |
Definition at line 1609 of file ScdInterface.hpp.
References ErrorCode, and MB_SUCCESS.
Referenced by get_params().
|
inline |
Get the vertex at the specified coordinates.
ijk | Parametric coordinates being evaluated |
Definition at line 1574 of file ScdInterface.hpp.
Referenced by moab::Core::create_scd_sequence(), get_adj_edge_or_face(), and main().
|
inline |
Get the vertex at the specified coordinates.
i | Parametric coordinates being evaluated |
j | Parametric coordinates being evaluated |
k | Parametric coordinates being evaluated |
Definition at line 1566 of file ScdInterface.hpp.
References boxDims, boxSize, boxSizeIJ, get_vertex_from_seq(), startVertex, and vertDat.
|
private |
function to get vertex handle directly from sequence
i | Parameter being queried |
j | Parameter being queried |
k | Parameter being queried |
Definition at line 569 of file ScdInterface.cpp.
References elemSeq, and moab::StructuredElementSeq::get_vertex().
Referenced by get_vertex().
|
inline |
Get local periodicity.
Definition at line 1659 of file ScdInterface.hpp.
References locallyPeriodic.
|
inline |
Set local periodicity.
lperiodic | Vector of ijk periodicities to set this box to |
Definition at line 1653 of file ScdInterface.hpp.
References locallyPeriodic.
Referenced by moab::ScdInterface::assign_global_ids().
|
inline |
Return whether box is locally periodic in i.
Return whether box is locally periodic in i
Definition at line 1638 of file ScdInterface.hpp.
References locallyPeriodic.
|
inline |
Return whether box is locally periodic in j.
Return whether box is locally periodic in j
Definition at line 1643 of file ScdInterface.hpp.
References locallyPeriodic.
|
inline |
Return whether box is locally periodic in k.
Return whether box is locally periodic in k
Definition at line 1648 of file ScdInterface.hpp.
References locallyPeriodic.
|
inline |
Return the number of elements in the box.
Definition at line 1493 of file ScdInterface.hpp.
References boxSize, locallyPeriodic, and startElem.
Referenced by moab::ScdInterface::construct_box(), moab::ScdNCHelper::create_mesh(), moab::ScdInterface::create_scd_sequence(), and moab::ScdInterface::tag_shared_vertices().
|
inline |
Return the number of vertices in the box.
Definition at line 1515 of file ScdInterface.hpp.
References boxSize.
Referenced by moab::ScdInterface::assign_global_ids(), moab::ScdNCHelper::create_mesh(), and moab::ScdInterface::create_scd_sequence().
|
inline |
Return parallel data.
Return parallel data, if there is any
Definition at line 749 of file ScdInterface.hpp.
Referenced by moab::ScdInterface::assign_global_ids(), moab::ScdInterface::construct_box(), moab::ScdInterface::get_shared_vertices(), and moab::ScdInterface::tag_shared_vertices().
|
inline |
Return parallel data.
Return parallel data, if there is any
Definition at line 758 of file ScdInterface.hpp.
|
inline |
set parallel data
Set parallel data for this box
par_data | Parallel data to be set on this box |
Definition at line 767 of file ScdInterface.hpp.
|
inline |
Return the ScdInterface responsible for this box.
Definition at line 1468 of file ScdInterface.hpp.
References scImpl.
|
inline |
Starting entity handle for this box.
If this is a vertex box, the start vertex handle is returned.
Definition at line 1483 of file ScdInterface.hpp.
References startElem.
Referenced by moab::ScdInterface::construct_box(), moab::ScdNCHelper::create_mesh(), and moab::ScdInterface::tag_shared_vertices().
|
inlineprivate |
Set the starting entity handle for this box.
Definition at line 1488 of file ScdInterface.hpp.
References startElem.
|
inline |
Starting vertex handle for this box.
Definition at line 1473 of file ScdInterface.hpp.
References startVertex.
Referenced by moab::ScdInterface::assign_global_ids(), moab::ScdNCHelper::create_mesh(), and moab::ScdInterface::tag_shared_vertices().
|
inlineprivate |
Set the starting vertex handle for this box.
Definition at line 1478 of file ScdInterface.hpp.
References startVertex.
|
inlineprivate |
|
private |
set the vertex sequence
Definition at line 622 of file ScdInterface.cpp.
References MB_SUCCESS, and vertDat.
|
friend |
Definition at line 508 of file ScdInterface.hpp.
|
private |
lower and upper corners
Definition at line 832 of file ScdInterface.hpp.
Referenced by box_dims(), box_max(), box_min(), contains(), get_adj_edge_or_face(), get_element(), get_vertex(), and ScdBox().
|
private |
entity set representing this box
Definition at line 816 of file ScdInterface.hpp.
|
private |
parameter extents
Definition at line 841 of file ScdInterface.hpp.
Referenced by box_size(), elem_seq(), get_vertex(), num_elements(), num_vertices(), and ScdBox().
|
private |
convenience parameters, (boxSize[1]-1)*(boxSize[0]-1) and boxSize[0]-1
Definition at line 844 of file ScdInterface.hpp.
Referenced by get_vertex(), and ScdBox().
|
private |
Definition at line 845 of file ScdInterface.hpp.
Referenced by elem_seq(), get_element(), and ScdBox().
|
private |
Definition at line 846 of file ScdInterface.hpp.
Referenced by elem_seq(), get_element(), and ScdBox().
|
private |
element sequence this box represents
Definition at line 823 of file ScdInterface.hpp.
Referenced by add_vbox(), boundary_complete(), elem_seq(), get_params(), get_vertex_from_seq(), and ScdBox().
|
private |
is locally periodic in i or j or k
Definition at line 835 of file ScdInterface.hpp.
Referenced by elem_seq(), get_adj_edge_or_face(), locally_periodic(), locally_periodic_i(), locally_periodic_j(), locally_periodic_k(), num_elements(), and ScdBox().
|
private |
parallel data associated with this box, if any
Definition at line 838 of file ScdInterface.hpp.
|
private |
interface instance
Definition at line 813 of file ScdInterface.hpp.
Referenced by box_dimension(), get_adj_edge_or_face(), get_params(), sc_impl(), ScdBox(), and ~ScdBox().
|
private |
starting element handle for this box
Definition at line 829 of file ScdInterface.hpp.
Referenced by box_dimension(), get_element(), num_elements(), ScdBox(), and start_element().
|
private |
starting vertex handle for this box
Definition at line 826 of file ScdInterface.hpp.
Referenced by get_vertex(), ScdBox(), and start_vertex().
|
private |
vertex sequence this box represents, if there's only one, otherwise they're retrieved from the element sequence
Definition at line 820 of file ScdInterface.hpp.
Referenced by add_vbox(), get_coordinate_arrays(), get_params(), get_vertex(), ScdBox(), and vert_dat().