35 #ifndef __MANIFOLD_2_H_
36 #define __MANIFOLD_2_H_
39 #include "../Rocmap/include/Simple_manifold_2.h"
45 using MAP::Simple_manifold_2;
152 COM::Attribute *pconn_g);
162 int bid = eID.
eid()-1;
256 bool to_normalize =
true);
260 bool to_normalize =
false);
272 void compute_mcn( COM::Attribute *mcn_in, COM::Attribute *lbmcn_in);
282 COM::Attribute *
nvals,
284 const COM::Attribute *ews = NULL,
285 COM::Attribute *nws = NULL,
286 const int tosum=
false);
320 void init(
const COM::Attribute *pmesh);
342 bool to_normalize =
true,
343 const COM::Attribute *weights = NULL);
361 std::vector< Pane_manifold_2>
_pms;
364 MAP::Pane_communicator *
_cc;
388 {
if (
_pm)
return _pm->
pane();
else return NULL; }
400 const void *
addr(
const COM::Attribute *
attr)
const;
404 const COM::Attribute *
attr(
const COM::Attribute *a)
const {
406 return a->window()->pane(
_pm->
pane()->id()).attribute(a->id());
507 template <
class Value>
510 *reinterpret_cast<const Value *>(
origin().
addr(attr)));
516 template <
class Value>
528 val += *
reinterpret_cast<const Value*
>(h.
origin().
addr( attr));
530 }
while ( (h=h.
next()) != h0);
544 {
if (
_pm)
return _pm->
pane();
else return NULL; }
553 const void *
addr(
const COM::Attribute *
attr)
const;
556 const COM::Attribute *
attr(
const COM::Attribute *a)
const {
558 return a->window()->pane(
_pm->
pane()->id()).attribute(a->id());
572 return pid1<pid2 || pid1==pid2 &&
_eID<h.
_eID;
589 "get_bd_normal must be called on border edges and be called after update_bd_normals() has been called.");
595 "get_bd_flag must be called on border edges and be called after update_bd_flags() has been called.");
601 "get_bdedge_flag must be called on border edges and be called after update_bdedge_bitmap() has been called.");
636 if ( bid >=0 &&
_nd_prm[ bid].pane_manifold())
649 return bid <0 || !
_nd_prm[ bid].pane_manifold();
684 if ( eID.is_border()) {
701 const COM::Attribute *disp);
This class implements a data structure for 2-manifold over a whole window, which can be composed of m...
int size_of_panes() const
Obtain the number of panes.
int pconn_nblocks() const
Obtain the number of pconn blocks.
void update_bd_normals(const COM::Attribute *normals, bool to_normalize=false)
Update the normals for border faces.
bool is_pure_real_border_edge(const Edge_ID &eID) const
Determine whether a given edge is a border edge of real part of the whole pane (on physical border)...
#define COM_assertion(EX)
Error checking utility similar to the assert macro of the C language.
Pane_manifold_2()
Default constructors.
PM_iterator pm_begin()
Obtain an iterator to the first pane manifold of the window.
int size_of_triangles() const
Total number of triangles of the pane.
int size_of_triangles(Access_Mode mode) const
Obtain the number of triangles.
int size_of_edges() const
Number of edges of the pane.
bool is_real_border_edge(const Edge_ID &eID) const
Determine whether a given edge is a border edge of real part of the pane (either on physical border o...
This class encapsulate a node over a window manifold.
int size_of_faces(Access_Mode mode) const
Obtain the number of faces.
bool operator==(const Halfedge &h) const
Are two halfedges the same?
bool get_bdedge_flag(Edge_ID) const
Obtain flag of opposite halfedge of a border halfedge.
int size_of_triangles(Access_Mode mode) const
Obtain the number of triangles.
MAP::Pane_communicator * _cc
COM::Window * _buf_window
Vector_3< Real > deformed_normal(const COM::Attribute *disp) const
Get the normal of the deformed shape (coordinates plus given displacements) of the incident facet of ...
int size_of_quadrilaterals() const
Total number of quadrilaterals of the pane.
#define COM_assertion_msg(EX, msg)
std::vector< int > _cnt_pn
void elements_to_nodes(const COM::Attribute *evals, COM::Attribute *nvals, const int scheme=E2N_ONE, const COM::Attribute *ews=NULL, COM::Attribute *nws=NULL, const int tosum=false)
Convert element values to nodal values using weighted averaging.
#define SURF_END_NAMESPACE
const COM::Pane * pane() const
Obtain a const pointer to the pane.
Node()
Default constructor.
int id() const
Obtain the node ID within its Pane_manifold_2.
void convert_pconn_edge2ghost(const COM::Attribute *pconn_e, COM::Attribute *pconn_g)
Convert from edge-based pconn to a ghost-node-style pconn for a pane attribute.
Window_manifold_2()
Default constructor.
int size_of_faces() const
Number of elements of the pane.
Halfedge get_prev_edge(Edge_ID, Access_Mode mode) const
Obtain the previous edge in a given access mode.
Halfedge opposite() const
Get the ID of the opposite edge of a given edge.
Halfedge get_next_edge(Edge_ID, Access_Mode mode) const
Obtain the next edge in a given access mode.
const Halfedge & get_counterpart(Edge_ID eID) const
Get the counterpart of an edge in the ACROSS_PANE mode, i.e.
bool operator==(const Node &n) const
Are two nodes the same?
bool is_physical_border() const
Is the edge on the physical boundary?
Vector_3< Real > get_tangent(const Halfedge &h)
Get the tangent of the given halfedge.
Halfedge prev() const
Get the previous halfedge of its owner element.
This class encapsulate a halfedge over a window manifold.
Edge_ID id() const
Obtain the ID of the edge.
std::vector< Pane_manifold_2 >::const_iterator PM_const_iterator
int size_of_real_quadrilaterals() const
Number of real quadrilaterals of the pane.
int size_of_edges(Access_Mode mode) const
Obtain the number of edges.
void init(const COM::Attribute *pmesh)
Initialize the manifold by inheriting the given mesh.
int get_destination(Edge_ID eID, Element_node_enumerator *ene_in=NULL) const
Get the ID of the destination of a given edge.
bool is_primary(int vID, Access_Mode mode) const
Determines whether a given node is a primary copy.
Halfedge next() const
Get the next halfedge of its owner element.
const void * addr(const COM::Attribute *attr) const
Obtain the address of an attribute associated with its bounded element.
Edge_ID get_incident_real_edge(int vID) const
Get the ID of an incident real edge within the pane of a given node.
int get_border_edgeID(Edge_ID eID) const
Get the border edge index. Return -1 if not a border edge.
Node(const Pane_manifold_2 *pm, int vid, Access_Mode mode)
Construct a Node object from a pane manifold and its node ID.
int eid() const
Element ID of the halfedge.
Edge_ID get_opposite_edge(const Edge_ID &eID) const
Get the ID of the opposite edge of a given interior or border edge.
bool is_border() const
Is the node on the physical boundary?
const COM::Attribute * attr(const COM::Attribute *a) const
Obtain the attribute on the parent pane of the node.
std::map< int, int > _pi_map
Node get_primary() const
Get the primary copy of the node.
~Pane_manifold_2()
Destructor.
Edge_ID get_opposite_real_edge(const Edge_ID &eID) const
Get the ID of the opposite real edge of a given real or border edge.
int size_of_quadrilaterals(Access_Mode mode) const
Obtain the number of quadrilaterals.
std::vector< Pane_manifold_2 >::iterator PM_iterator
Vector_3< Real > get_normal(const Halfedge &h, const Vector_2< Real > &nc)
Get the face normal of a point in the element incident on h.
#define SURF_BEGIN_NAMESPACE
Vector_3< Real > tangent() const
Get the tangent of the given halfedge.
Vector_3< Real > normal() const
Get the normal of the incident facet.
bool is_isolated() const
Is the node isolated?
bool operator<(const Halfedge &h) const
Does the current halfedge has a smaller ID then the given one?
void reduce_on_shared_nodes(COM::Attribute *attr, MPI_Op op)
Perform reduction over a given nodal attributes.
Halfedge(const Pane_manifold_2 *pm, Edge_ID e, Access_Mode mode)
Construct a Halfedge object from a pane manifold and its edge ID.
static void compute_shortest_edgelen_elements(COM::Attribute *lens)
Obtain shortest edge length of incident edges of each element.
const Pane_manifold_2 * _pm
void edge_average(const COM::Attribute *attr, Value &val) const
Get the avarage value of the nodes of a given halfedge.
int size_of_quadrilaterals(Access_Mode mode) const
Obtain the number of quadrilaterals.
void determine_primaries(const COM::Attribute *pconn_n)
Determine the primary nodes for across-pane access.
void assign_global_nodeIDs(std::vector< std::vector< int > > &gids) const
void update_bdedge_bitmap(const COM::Attribute *bitmap)
Update bitmap for border edges.
PM_const_iterator pm_begin() const
void accumulate_bd_values(const COM::Attribute *vals)
Accumulate the values for border faces.
void face_center(Point_3< Real > &cnt) const
Get the face center of the incident face of a given halfedge.
Vector_3< Real > get_deformed_normal(const Halfedge &h, const Vector_2< Real > &nc, const COM::Attribute *disp)
Get the normal of the deformed shape (coordinates plus given displacements) of the incident facet of ...
Node destination() const
Obtain the (primary copy of the) destination of the edge.
void update_bd_flags(const COM::Attribute *flags)
Update the flags for border faces.
void shortest_edge_length(COM::Attribute *lens)
Obtain shortest edge length of incident edges of each node or element.
int size_of_real_triangles() const
Number of real triangles of the pane.
Window_manifold_2(const COM::Attribute *pmesh)
Construct a Window_manifold_2 from a given window.
Provides a data structure accessing nodes, elements, and edges in a pane, in a manner similar to the ...
const COM::Attribute * attr(const COM::Attribute *a) const
Obtain the attribute on the parent pane of the node.
bool operator<(const Node &n) const
Does the current node has a smaller ID then the given node?
Encapsulates information about distribution of panes on all processes and handles across pane communi...
bool operator!=(const Node &n) const
Are two nodes different?
std::vector< Node > _nd_prm
bool operator!=(const Halfedge &h) const
Are two halfedges different?
const void * addr(const COM::Attribute *attr) const
Obtain the address of an attribute associated with the node.
void determine_counterparts(const COM::Attribute *pconn_e)
Determine the counterparts of pane-border edges for across-pane access.
bool is_border() const
Is the edge a border edge?
COM::Window * window()
Obtain the underlying window object.
const Pane_manifold_2 * get_pane_manifold(int pid) const
Obtain a const Pane_manifold_2 from a pane ID.
int size_of_nodes() const
Number of nodes of the pane.
void compute_mcn(COM::Attribute *mcn_in, COM::Attribute *lbmcn_in)
bool is_physical_border_edge(Edge_ID eID) const
Is the given edge a physical border edge?
void compute_normals(COM::Attribute *normals, int scheme=E2N_ANGLE, bool to_normalize=true)
Compute the normals at nodes or faces, depending on the type of the attribute normals.
Halfedge get_opposite_edge(Edge_ID, Access_Mode mode) const
Obtain the opposite edge in a given access mode.
bool is_border_edge(Edge_ID eID, Access_Mode mode) const
Is the edge on the boundary of a given mode?
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE USE ModDataTypes USE nvals
std::vector< int > _bd_flgs
void init_communicator()
Initialize a pane communicator.
void serialize_window(COM::Window *outwin) const
Create a serial window (with single pane) from the current window.
std::vector< Halfedge > _bd_cnt
int size_of_real_faces() const
Number of real elements of the pane.
const Point_3< Real > & point() const
Obtain the coordinates of a node.
const Pane_manifold_2 * pane_manifold() const
Obtain the pane manifold that owns the edge.
Node get_primary(int vID, Access_Mode mode) const
Obtains a Node object corresponding to the primary copy of the given node.
void face_average(const COM::Attribute *attr, Value &val) const
Get the average value of the nodes of the incident face of a given halfedge.
The ID of a facet (edge in 2D and face in 3D) encodes an element ID and the local facet's ID internal...
const COM::Pane * pane() const
Obtain the owner Pane_manifold_2 of the node.
double dihedral_angle() const
Return the dihedral angle at the edge.
std::vector< Edge_ID > _beIDs
void edge_center(Point_3< Real > &mid) const
Get the edge center of the given halfedge.
This class implements a data structure for 2-manifold on each pane.
PM_iterator pm_end()
Obtain an iterator to the past-the-last pane manifold of the window.
Node origin() const
Obtain the (primary copy of the) origin of the edge.
const Vector_3< Real > & get_bd_normal(Edge_ID) const
Obtain normal of incident face of border edge.
const Pane_manifold_2 * _pm
void compute_nodal_normals(COM::Attribute *nrm, int scheme=E2N_ANGLE, bool to_normalize=true, const COM::Attribute *weights=NULL)
Compute nodal normals using one of the following weighting schemes: E2N_ONE, E2N_AREA, and E2N_ANGLE, and E2N_USER.
const COM::Window * window() const
PM_const_iterator pm_end() const
void compute_shortest_edgelen_nodes(COM::Attribute *lens)
Obtain shortest edge length of incident edges of each nodes.
int get_origin(Edge_ID eID, Element_node_enumerator *ene_in=NULL) const
Get the ID of the origin of a given edge.
std::vector< Pane_manifold_2 > _pms
std::vector< Vector_3< Real > > _bd_nrms
bool is_border() const
Determines whether the facet is on border.
int size_of_nodes(Access_Mode mode) const
Obtain the number of nodes (shared nodes are counted only once.
int get_bnode_index(int vID) const
Obtain the border node index (equal to ID of incident border edge).
bool coincide(const Node &n) const
Check whether the current node coincide with the given node.
int get_bd_flag(Edge_ID) const
Obtain flag of incident face of border edge.
const Pane_manifold_2 * pane_manifold() const
Obtain the pane manifold that owns the edge.
Halfedge halfedge() const
Get an incident halfedge originated from the node.
bool is_isolated_node(int vID) const
Is the node isolated (i.e. not incident on any element)?
Pane_manifold_2 * get_pane_manifold(int pid)
Obtain a Pane_manifold_2 from a pane ID.
int size_of_faces(Access_Mode mode) const
Obtain the number of faces.
bool is_primary() const
Is the node a primary?
void perturb_mesh(double range)
Perturb the given mesh along its normal direction by length equal to a random number between -range a...
const COM::Pane * pane() const
Obtain the owner Pane_manifold_2 of the node.
Edge_ID get_incident_edge(int vID) const
Get the ID of an incident edge within the pane of a given node that originated from the node...
std::vector< char > _bd_bm