MAST
Multidisciplinary-design Adaptation and Sensitivity Toolkit (MAST)
MAST::LevelSetIntersection Class Reference

Detailed Description

Definition at line 54 of file level_set_intersection.h.

#include <level_set_intersection.h>

Collaboration diagram for MAST::LevelSetIntersection:

Public Member Functions

 LevelSetIntersection ()
 
virtual ~LevelSetIntersection ()
 
void clear ()
 clears the data structures More...
 
unsigned int edge_on_boundary () const
 
const libMesh::Elem & elem () const
 
std::pair< const libMesh::Node *, const libMesh::Node * > get_bounding_nodes_for_node (const libMesh::Node &node) const
 for new nodes required to create the subelements this method returns the nodes on an edge that bound the given node. More...
 
void get_corner_nodes_on_negative_phi (std::set< const libMesh::Node *> &nodes) const
 
MAST::LevelSet2DIntersectionMode get_intersection_mode () const
 
void get_material_sides_without_intersection (std::set< unsigned int > &sides) const
 identifies the sides of the element that are completely on the material side without any intersection on them. More...
 
void get_nearest_intersection_point (const libMesh::Point &p, libMesh::Point &pt)
 
Real get_node_phi_value (const libMesh::Node *n) const
 
const libMesh::Point & get_nondimensional_coordinate_for_node (const libMesh::Node &n) const
 
Real get_positive_phi_volume_fraction () const
 
unsigned int get_side_on_interface (const libMesh::Elem &e) const
 
const std::vector< const libMesh::Elem * > & get_sub_elems_negative_phi () const
 
const std::vector< const libMesh::Elem * > & get_sub_elems_positive_phi () const
 
bool has_side_on_interface (const libMesh::Elem &e) const
 
bool if_elem_has_boundary () const
 
bool if_elem_has_negative_phi_region () const
 
bool if_elem_has_positive_phi_region () const
 
bool if_elem_on_negative_phi () const
 
bool if_elem_on_positive_phi () const
 
bool if_hanging_node (const libMesh::Node *n) const
 The case of two adjacent edges results in a new node on an edge that is not coincident with the level set interface. More...
 
bool if_interior_node (const libMesh::Node &node) const
 identifies if the new node is on an edge along the level-set method in the interior of the element (as opposed to on the edges of the original element). More...
 
bool if_intersection_through_elem () const
 
bool if_node_is_new (const libMesh::Node &node) const
 identifies if the node from the subelements is a new node or an existing node from the parent element. More...
 
void init (const MAST::FieldFunction< Real > &phi, const libMesh::Elem &e, const Real t, unsigned int max_elem_id, unsigned int max_node_id)
 
unsigned int node_on_boundary () const
 

Protected Member Functions

void _add_node_local_coords (const libMesh::Elem &e, std::vector< std::pair< libMesh::Point, libMesh::Point > > &side_nondim_points, std::map< const libMesh::Node *, libMesh::Point > &node_coord_map)
 
Real _find_intersection_on_straight_edge (const libMesh::Point &p0, const libMesh::Point &p1, const MAST::FieldFunction< Real > &phi, const Real t)
 
void _find_quad4_intersections (const MAST::FieldFunction< Real > &phi, const libMesh::Elem &e, const Real t, const std::map< const libMesh::Node *, std::pair< Real, bool > > &node_phi_vals)
 
std::unique_ptr< libMesh::Elem > _first_order_elem (const libMesh::Elem &e)
 creates a first order element from the given high-order element. More...
 
void _init_on_first_order_ref_elem (const MAST::FieldFunction< Real > &phi, const libMesh::Elem &e, const Real t)
 initializes on a reference element that is a first-order counterpart of the given high-order element. More...
 

Protected Attributes

std::map< const libMesh::Node *, std::pair< const libMesh::Node *, const libMesh::Node * > > _bounding_nodes
 
unsigned int _edge_num_on_boundary
 
const libMesh::Elem * _elem
 
std::map< const libMesh::Elem *, int > _elem_sides_on_interface
 
std::set< const libMesh::Node * > _hanging_node
 
bool _if_elem_on_negative_phi
 true if element is completely on the negative side of level set with no intersection More...
 
bool _if_elem_on_positive_phi
 true if element is completely on the positive side of level set with no intersection More...
 
bool _initialized
 
std::set< const libMesh::Node * > _interior_nodes
 
const unsigned int _max_elem_divs
 
unsigned int _max_iters
 
unsigned int _max_mesh_elem_id
 
unsigned int _max_mesh_node_id
 
MAST::LevelSet2DIntersectionMode _mode
 
std::vector< const libMesh::Elem * > _negative_phi_elems
 
std::vector< libMesh::Elem * > _new_elems
 
std::vector< libMesh::Node * > _new_nodes
 
std::map< const libMesh::Node *, libMesh::Point > _node_local_coords
 
unsigned int _node_num_on_boundary
 
std::map< const libMesh::Node *, std::pair< Real, bool > > _node_phi_vals
 
const MAST::FieldFunction< Real > * _phi
 
std::vector< const libMesh::Elem * > _positive_phi_elems
 
Real _tol
 

Constructor & Destructor Documentation

◆ LevelSetIntersection()

MAST::LevelSetIntersection::LevelSetIntersection ( )

Definition at line 31 of file level_set_intersection.cpp.

◆ ~LevelSetIntersection()

MAST::LevelSetIntersection::~LevelSetIntersection ( )
virtual

Definition at line 49 of file level_set_intersection.cpp.

Member Function Documentation

◆ _add_node_local_coords()

void MAST::LevelSetIntersection::_add_node_local_coords ( const libMesh::Elem &  e,
std::vector< std::pair< libMesh::Point, libMesh::Point > > &  side_nondim_points,
std::map< const libMesh::Node *, libMesh::Point > &  node_coord_map 
)
protected

Definition at line 612 of file level_set_intersection.cpp.

◆ _find_intersection_on_straight_edge()

Real MAST::LevelSetIntersection::_find_intersection_on_straight_edge ( const libMesh::Point &  p0,
const libMesh::Point &  p1,
const MAST::FieldFunction< Real > &  phi,
const Real  t 
)
protected
Returns
the value along a straight edge where the level-set function zero.

Definition at line 1587 of file level_set_intersection.cpp.

◆ _find_quad4_intersections()

void MAST::LevelSetIntersection::_find_quad4_intersections ( const MAST::FieldFunction< Real > &  phi,
const libMesh::Elem &  e,
const Real  t,
const std::map< const libMesh::Node *, std::pair< Real, bool > > &  node_phi_vals 
)
protected

Definition at line 658 of file level_set_intersection.cpp.

◆ _first_order_elem()

std::unique_ptr< libMesh::Elem > MAST::LevelSetIntersection::_first_order_elem ( const libMesh::Elem &  e)
protected

creates a first order element from the given high-order element.

For a QUAD9 a QUAD4 is obtained by only using the corner nodes. Note that this does not create any new nodes. The element can be deleted after use.

Definition at line 283 of file level_set_intersection.cpp.

◆ _init_on_first_order_ref_elem()

void MAST::LevelSetIntersection::_init_on_first_order_ref_elem ( const MAST::FieldFunction< Real > &  phi,
const libMesh::Elem &  e,
const Real  t 
)
protected

initializes on a reference element that is a first-order counterpart of the given high-order element.

For two-dimensional elements this is a QUAD4.

Definition at line 313 of file level_set_intersection.cpp.

◆ clear()

void MAST::LevelSetIntersection::clear ( )

clears the data structures

Definition at line 201 of file level_set_intersection.cpp.

◆ edge_on_boundary()

unsigned int MAST::LevelSetIntersection::edge_on_boundary ( ) const
Returns
the edge number on the element if the mode is COLINEAR_EDGE, otherwise throws an error.

Definition at line 86 of file level_set_intersection.cpp.

◆ elem()

const libMesh::Elem & MAST::LevelSetIntersection::elem ( ) const
Returns
a reference to the element on which the intersection is defined

Definition at line 56 of file level_set_intersection.cpp.

◆ get_bounding_nodes_for_node()

std::pair< const libMesh::Node *, const libMesh::Node * > MAST::LevelSetIntersection::get_bounding_nodes_for_node ( const libMesh::Node &  node) const

for new nodes required to create the subelements this method returns the nodes on an edge that bound the given node.

An error is thrown if the node is not a

Definition at line 1691 of file level_set_intersection.cpp.

◆ get_corner_nodes_on_negative_phi()

void MAST::LevelSetIntersection::get_corner_nodes_on_negative_phi ( std::set< const libMesh::Node *> &  nodes) const

Definition at line 543 of file level_set_intersection.cpp.

◆ get_intersection_mode()

MAST::LevelSet2DIntersectionMode MAST::LevelSetIntersection::get_intersection_mode ( ) const
Returns
mode of intersection

Definition at line 65 of file level_set_intersection.cpp.

◆ get_material_sides_without_intersection()

void MAST::LevelSetIntersection::get_material_sides_without_intersection ( std::set< unsigned int > &  sides) const

identifies the sides of the element that are completely on the material side without any intersection on them.

Definition at line 1708 of file level_set_intersection.cpp.

◆ get_nearest_intersection_point()

void MAST::LevelSetIntersection::get_nearest_intersection_point ( const libMesh::Point &  p,
libMesh::Point &  pt 
)

Definition at line 1747 of file level_set_intersection.cpp.

◆ get_node_phi_value()

Real MAST::LevelSetIntersection::get_node_phi_value ( const libMesh::Node *  n) const
Returns
value of phi on element node. This can only be the node in the

Definition at line 180 of file level_set_intersection.cpp.

◆ get_nondimensional_coordinate_for_node()

const libMesh::Point & MAST::LevelSetIntersection::get_nondimensional_coordinate_for_node ( const libMesh::Node &  n) const

Definition at line 1650 of file level_set_intersection.cpp.

◆ get_positive_phi_volume_fraction()

Real MAST::LevelSetIntersection::get_positive_phi_volume_fraction ( ) const
Returns
the area/volume fraction of element on positive phi of the element

Definition at line 159 of file level_set_intersection.cpp.

◆ get_side_on_interface()

unsigned int MAST::LevelSetIntersection::get_side_on_interface ( const libMesh::Elem &  e) const
Returns
the id of side that is on the interface. In case the element does not have a side on the interface, then an error is thrown.

Definition at line 598 of file level_set_intersection.cpp.

◆ get_sub_elems_negative_phi()

const std::vector< const libMesh::Elem * > & MAST::LevelSetIntersection::get_sub_elems_negative_phi ( ) const

Definition at line 535 of file level_set_intersection.cpp.

◆ get_sub_elems_positive_phi()

const std::vector< const libMesh::Elem * > & MAST::LevelSetIntersection::get_sub_elems_positive_phi ( ) const

Definition at line 527 of file level_set_intersection.cpp.

◆ has_side_on_interface()

bool MAST::LevelSetIntersection::has_side_on_interface ( const libMesh::Elem &  e) const

Definition at line 584 of file level_set_intersection.cpp.

◆ if_elem_has_boundary()

bool MAST::LevelSetIntersection::if_elem_has_boundary ( ) const
Returns
true if the intersection is through the element, or has colinear edge.

Definition at line 136 of file level_set_intersection.cpp.

◆ if_elem_has_negative_phi_region()

bool MAST::LevelSetIntersection::if_elem_has_negative_phi_region ( ) const
Returns
true if there is any portion of the element (interior edge, or node) that is on the negative side of the level set function.

Definition at line 117 of file level_set_intersection.cpp.

◆ if_elem_has_positive_phi_region()

bool MAST::LevelSetIntersection::if_elem_has_positive_phi_region ( ) const
Returns
true if there is any portion of the element (interior edge, or node) that is on the positive side of the level set function.

Definition at line 126 of file level_set_intersection.cpp.

◆ if_elem_on_negative_phi()

bool MAST::LevelSetIntersection::if_elem_on_negative_phi ( ) const
Returns
true if the element is entirely on the negative side of the level set without any intersection. This will return true only if the mode is NO_INTERSECTION and all nodal phi values are negative.

Definition at line 107 of file level_set_intersection.cpp.

◆ if_elem_on_positive_phi()

bool MAST::LevelSetIntersection::if_elem_on_positive_phi ( ) const
Returns
true if the element is entirely on the positive side of the level set without any intersection. This will return true only if the mode is NO_INTERSECTION and all nodal phi values are positive.

Definition at line 98 of file level_set_intersection.cpp.

◆ if_hanging_node()

bool MAST::LevelSetIntersection::if_hanging_node ( const libMesh::Node *  n) const

The case of two adjacent edges results in a new node on an edge that is not coincident with the level set interface.

This will end up as a hanging node if added to the mesh.

Returns
true if this node n is the hanging node.

Definition at line 194 of file level_set_intersection.cpp.

◆ if_interior_node()

bool MAST::LevelSetIntersection::if_interior_node ( const libMesh::Node &  node) const

identifies if the new node is on an edge along the level-set method in the interior of the element (as opposed to on the edges of the original element).

Definition at line 1681 of file level_set_intersection.cpp.

◆ if_intersection_through_elem()

bool MAST::LevelSetIntersection::if_intersection_through_elem ( ) const
Returns
true if the intersection passes through the interior of the element. Note that COLINEAR_EDGE or THROUGH_NODE do not qualify for this.

Definition at line 146 of file level_set_intersection.cpp.

◆ if_node_is_new()

bool MAST::LevelSetIntersection::if_node_is_new ( const libMesh::Node &  node) const

identifies if the node from the subelements is a new node or an existing node from the parent element.

Definition at line 1665 of file level_set_intersection.cpp.

◆ init()

void MAST::LevelSetIntersection::init ( const MAST::FieldFunction< Real > &  phi,
const libMesh::Elem &  e,
const Real  t,
unsigned int  max_elem_id,
unsigned int  max_node_id 
)

Definition at line 245 of file level_set_intersection.cpp.

◆ node_on_boundary()

unsigned int MAST::LevelSetIntersection::node_on_boundary ( ) const
Returns
the node number on the element if the mode is THROUDH_NODE, otherwise throws an error.

Definition at line 75 of file level_set_intersection.cpp.

Member Data Documentation

◆ _bounding_nodes

std::map<const libMesh::Node*, std::pair<const libMesh::Node*, const libMesh::Node*> > MAST::LevelSetIntersection::_bounding_nodes
protected

Definition at line 302 of file level_set_intersection.h.

◆ _edge_num_on_boundary

unsigned int MAST::LevelSetIntersection::_edge_num_on_boundary
protected

Definition at line 289 of file level_set_intersection.h.

◆ _elem

const libMesh::Elem* MAST::LevelSetIntersection::_elem
protected

Definition at line 268 of file level_set_intersection.h.

◆ _elem_sides_on_interface

std::map<const libMesh::Elem*, int> MAST::LevelSetIntersection::_elem_sides_on_interface
protected

Definition at line 295 of file level_set_intersection.h.

◆ _hanging_node

std::set<const libMesh::Node*> MAST::LevelSetIntersection::_hanging_node
protected

Definition at line 303 of file level_set_intersection.h.

◆ _if_elem_on_negative_phi

bool MAST::LevelSetIntersection::_if_elem_on_negative_phi
protected

true if element is completely on the negative side of level set with no intersection

Definition at line 283 of file level_set_intersection.h.

◆ _if_elem_on_positive_phi

bool MAST::LevelSetIntersection::_if_elem_on_positive_phi
protected

true if element is completely on the positive side of level set with no intersection

Definition at line 277 of file level_set_intersection.h.

◆ _initialized

bool MAST::LevelSetIntersection::_initialized
protected

Definition at line 269 of file level_set_intersection.h.

◆ _interior_nodes

std::set<const libMesh::Node*> MAST::LevelSetIntersection::_interior_nodes
protected

Definition at line 301 of file level_set_intersection.h.

◆ _max_elem_divs

const unsigned int MAST::LevelSetIntersection::_max_elem_divs
protected

Definition at line 267 of file level_set_intersection.h.

◆ _max_iters

unsigned int MAST::LevelSetIntersection::_max_iters
protected

Definition at line 264 of file level_set_intersection.h.

◆ _max_mesh_elem_id

unsigned int MAST::LevelSetIntersection::_max_mesh_elem_id
protected

Definition at line 265 of file level_set_intersection.h.

◆ _max_mesh_node_id

unsigned int MAST::LevelSetIntersection::_max_mesh_node_id
protected

Definition at line 266 of file level_set_intersection.h.

◆ _mode

MAST::LevelSet2DIntersectionMode MAST::LevelSetIntersection::_mode
protected

Definition at line 285 of file level_set_intersection.h.

◆ _negative_phi_elems

std::vector<const libMesh::Elem*> MAST::LevelSetIntersection::_negative_phi_elems
protected

Definition at line 293 of file level_set_intersection.h.

◆ _new_elems

std::vector<libMesh::Elem*> MAST::LevelSetIntersection::_new_elems
protected

Definition at line 298 of file level_set_intersection.h.

◆ _new_nodes

std::vector<libMesh::Node*> MAST::LevelSetIntersection::_new_nodes
protected

Definition at line 297 of file level_set_intersection.h.

◆ _node_local_coords

std::map<const libMesh::Node*, libMesh::Point> MAST::LevelSetIntersection::_node_local_coords
protected

Definition at line 299 of file level_set_intersection.h.

◆ _node_num_on_boundary

unsigned int MAST::LevelSetIntersection::_node_num_on_boundary
protected

Definition at line 287 of file level_set_intersection.h.

◆ _node_phi_vals

std::map<const libMesh::Node*, std::pair<Real, bool> > MAST::LevelSetIntersection::_node_phi_vals
protected

Definition at line 300 of file level_set_intersection.h.

◆ _phi

const MAST::FieldFunction<Real>* MAST::LevelSetIntersection::_phi
protected

Definition at line 271 of file level_set_intersection.h.

◆ _positive_phi_elems

std::vector<const libMesh::Elem*> MAST::LevelSetIntersection::_positive_phi_elems
protected

Definition at line 291 of file level_set_intersection.h.

◆ _tol

Real MAST::LevelSetIntersection::_tol
protected

Definition at line 262 of file level_set_intersection.h.


The documentation for this class was generated from the following files: