PolyFEM
Loading...
Searching...
No Matches
polyfem::utils::Selection Class Referenceabstract

#include <Selection.hpp>

Inheritance diagram for polyfem::utils::Selection:
[legend]

Public Types

typedef std::array< RowVectorNd, 2 > BBox
 

Public Member Functions

 Selection (const int id)
 
virtual ~Selection ()
 
virtual bool inside (const size_t p_id, const std::vector< int > &vs, const RowVectorNd &p) const =0
 
virtual int id (const size_t element_id, const std::vector< int > &vs, const RowVectorNd &p) const
 

Static Public Member Functions

static std::shared_ptr< Selectionbuild (const json &j_selections, const BBox &mesh_bbox, const std::string &root_path="")
 Build a selection objects from a JSON selection.
 
static std::vector< std::shared_ptr< utils::Selection > > build_selections (const json &j_selections, const BBox &mesh_bbox, const std::string &root_path="")
 Build a vector of selection objects from a JSON selection(s).
 

Protected Member Functions

 Selection ()
 

Protected Attributes

size_t id_
 

Detailed Description

Definition at line 10 of file Selection.hpp.

Member Typedef Documentation

◆ BBox

Definition at line 13 of file Selection.hpp.

Constructor & Destructor Documentation

◆ Selection() [1/2]

polyfem::utils::Selection::Selection ( const int  id)
inline

Definition at line 15 of file Selection.hpp.

◆ ~Selection()

virtual polyfem::utils::Selection::~Selection ( )
inlinevirtual

Definition at line 17 of file Selection.hpp.

◆ Selection() [2/2]

polyfem::utils::Selection::Selection ( )
inlineprotected

Definition at line 47 of file Selection.hpp.

Member Function Documentation

◆ build()

std::shared_ptr< Selection > polyfem::utils::Selection::build ( const json j_selections,
const BBox mesh_bbox,
const std::string &  root_path = "" 
)
static

Build a selection objects from a JSON selection.

Parameters
j_selectionsJSON object of selection(s).
mesh_bboxBounding box of the mesh.
root_pathRoot path of the JSON file.
Returns
Shared pointer to selection object.

Definition at line 16 of file Selection.cpp.

References polyfem::log_and_throw_error(), and polyfem::utils::resolve_path().

Referenced by build_selections().

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

◆ build_selections()

std::vector< std::shared_ptr< Selection > > polyfem::utils::Selection::build_selections ( const json j_selections,
const BBox mesh_bbox,
const std::string &  root_path = "" 
)
static

Build a vector of selection objects from a JSON selection(s).

Parameters
j_selectionsJSON object of selection(s).
mesh_bboxBounding box of the mesh.
root_pathRoot path of the JSON file.
Returns
Vector of selection objects.

Definition at line 45 of file Selection.cpp.

References build(), polyfem::log_and_throw_error(), and polyfem::utils::resolve_path().

Referenced by polyfem::mesh::read_fem_mesh().

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

◆ id()

virtual int polyfem::utils::Selection::id ( const size_t  element_id,
const std::vector< int > &  vs,
const RowVectorNd p 
) const
inlinevirtual

◆ inside()

Member Data Documentation

◆ id_

size_t polyfem::utils::Selection::id_
protected

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