PolyFEM
Loading...
Searching...
No Matches
polyfem::mesh::LocalBoundary Class Reference

Boundary primitive IDs for a single element. More...

#include <LocalBoundary.hpp>

Public Member Functions

 LocalBoundary (const int global_element_id, BoundaryType type)
 Construct a new Local Boundary object for a given element.
 
 LocalBoundary (const LocalBoundary &other)
 Copy constructor.
 
void add_boundary_primitive (const int global_index, const int local_index)
 Mark a boundary primitive as a part of the global boundary.
 
int size () const
 Number of boundary primitives for the element.
 
bool empty () const
 Check if the element has any boundary primitives.
 
int element_id () const
 Get the element's ID.
 
BoundaryType type () const
 Get the type of boundary for the element.
 
int local_primitive_id (const int index) const
 Get the i-th boundary primitive's local ID.
 
int global_primitive_id (const int index) const
 Get the i-th boundary primitive's global ID.
 
int operator[] (const int index) const
 Get the i-th boundary primitive's local ID.
 
void remove_from (const LocalBoundary &other)
 Remove all boundary primitives that are also in another LocalBoundary.
 
void remove_tag_for_index (const int index)
 Remove a boundary primitive from the element.
 

Private Attributes

std::vector< int > global_primitive_id_
 Global IDs of the boundary primitives.
 
std::vector< int > local_primitive_id_
 Local IDs of the boundary primitives.
 
const int global_element_id_
 Element ID.
 
const BoundaryType type_
 Type of boundary primitives for the element.
 

Friends

std::ostream & operator<< (std::ostream &os, const LocalBoundary &lb)
 Print the LocalBoundary to an output stream.
 

Detailed Description

Boundary primitive IDs for a single element.

Definition at line 24 of file LocalBoundary.hpp.

Constructor & Destructor Documentation

◆ LocalBoundary() [1/2]

polyfem::mesh::LocalBoundary::LocalBoundary ( const int  global_element_id,
BoundaryType  type 
)

Construct a new Local Boundary object for a given element.

Parameters
global_element_idElement ID
typeType of boundary for the element

Definition at line 5 of file LocalBoundary.cpp.

◆ LocalBoundary() [2/2]

polyfem::mesh::LocalBoundary::LocalBoundary ( const LocalBoundary other)

Copy constructor.

Parameters
otherLocalBoundary to copy

Definition at line 10 of file LocalBoundary.cpp.

Member Function Documentation

◆ add_boundary_primitive()

void polyfem::mesh::LocalBoundary::add_boundary_primitive ( const int  global_index,
const int  local_index 
)

Mark a boundary primitive as a part of the global boundary.

Parameters
global_indexGlobal index of the boundary primitive
local_indexLocal index of the boundary primitive

Definition at line 16 of file LocalBoundary.cpp.

References global_primitive_id_, and local_primitive_id_.

Referenced by polyfem::assembler::Problem::setup_bc().

Here is the caller graph for this function:

◆ element_id()

int polyfem::mesh::LocalBoundary::element_id ( ) const
inline

Get the element's ID.

Returns
Element ID.

Definition at line 51 of file LocalBoundary.hpp.

References global_element_id_.

Referenced by polyfem::utils::BoundarySampler::boundary_quadrature(), polyfem::utils::BoundarySampler::boundary_quadrature(), and polyfem::utils::BoundarySampler::sample_boundary().

Here is the caller graph for this function:

◆ empty()

bool polyfem::mesh::LocalBoundary::empty ( ) const
inline

Check if the element has any boundary primitives.

Returns
True if the element has no boundary primitives.

Definition at line 47 of file LocalBoundary.hpp.

References size().

Referenced by polyfem::assembler::Problem::setup_bc().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ global_primitive_id()

int polyfem::mesh::LocalBoundary::global_primitive_id ( const int  index) const
inline

Get the i-th boundary primitive's global ID.

Parameters
indexIndex of the boundary primitive.
Returns
Global ID of the boundary primitive.

Definition at line 65 of file LocalBoundary.hpp.

References global_primitive_id_.

Referenced by polyfem::utils::BoundarySampler::boundary_quadrature(), polyfem::utils::BoundarySampler::boundary_quadrature(), and polyfem::utils::BoundarySampler::sample_boundary().

Here is the caller graph for this function:

◆ local_primitive_id()

int polyfem::mesh::LocalBoundary::local_primitive_id ( const int  index) const
inline

Get the i-th boundary primitive's local ID.

Parameters
indexIndex of the boundary primitive.
Returns
Local ID of the boundary primitive.

Definition at line 60 of file LocalBoundary.hpp.

References local_primitive_id_.

Referenced by operator[]().

Here is the caller graph for this function:

◆ operator[]()

int polyfem::mesh::LocalBoundary::operator[] ( const int  index) const
inline

Get the i-th boundary primitive's local ID.

Parameters
indexIndex of the boundary primitive.
Returns
Local ID of the boundary primitive.

Definition at line 70 of file LocalBoundary.hpp.

References local_primitive_id().

Here is the call graph for this function:

◆ remove_from()

void polyfem::mesh::LocalBoundary::remove_from ( const LocalBoundary other)

Remove all boundary primitives that are also in another LocalBoundary.

Parameters
otherOther LocalBoundary to remove from this one.

Definition at line 22 of file LocalBoundary.cpp.

References remove_tag_for_index(), and size().

Here is the call graph for this function:

◆ remove_tag_for_index()

void polyfem::mesh::LocalBoundary::remove_tag_for_index ( const int  index)

Remove a boundary primitive from the element.

Parameters
indexIndex of the boundary primitive to remove.

Definition at line 43 of file LocalBoundary.cpp.

References global_primitive_id_, and local_primitive_id_.

Referenced by remove_from().

Here is the caller graph for this function:

◆ size()

int polyfem::mesh::LocalBoundary::size ( ) const
inline

Number of boundary primitives for the element.

Returns
Number of boundary primitives for the element.

Definition at line 43 of file LocalBoundary.hpp.

References local_primitive_id_.

Referenced by polyfem::utils::BoundarySampler::boundary_quadrature(), polyfem::utils::BoundarySampler::boundary_quadrature(), empty(), remove_from(), and polyfem::utils::BoundarySampler::sample_boundary().

Here is the caller graph for this function:

◆ type()

BoundaryType polyfem::mesh::LocalBoundary::type ( ) const
inline

Get the type of boundary for the element.

Returns
Type of boundary for the element.

Definition at line 55 of file LocalBoundary.hpp.

References type_.

Referenced by polyfem::utils::BoundarySampler::boundary_quadrature(), polyfem::utils::BoundarySampler::boundary_quadrature(), and polyfem::utils::BoundarySampler::sample_boundary().

Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  os,
const LocalBoundary lb 
)
friend

Print the LocalBoundary to an output stream.

Parameters
osOutput stream
lbLocalBoundary to print
Returns
Output stream

Definition at line 49 of file LocalBoundary.cpp.

Member Data Documentation

◆ global_element_id_

const int polyfem::mesh::LocalBoundary::global_element_id_
private

Element ID.

Definition at line 93 of file LocalBoundary.hpp.

Referenced by element_id().

◆ global_primitive_id_

std::vector<int> polyfem::mesh::LocalBoundary::global_primitive_id_
private

Global IDs of the boundary primitives.

Definition at line 88 of file LocalBoundary.hpp.

Referenced by add_boundary_primitive(), global_primitive_id(), and remove_tag_for_index().

◆ local_primitive_id_

std::vector<int> polyfem::mesh::LocalBoundary::local_primitive_id_
private

Local IDs of the boundary primitives.

Definition at line 90 of file LocalBoundary.hpp.

Referenced by add_boundary_primitive(), local_primitive_id(), remove_tag_for_index(), and size().

◆ type_

const BoundaryType polyfem::mesh::LocalBoundary::type_
private

Type of boundary primitives for the element.

Definition at line 95 of file LocalBoundary.hpp.

Referenced by type().


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