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

#include <Obstacle.hpp>

Classes

class  Plane
 

Public Member Functions

 Obstacle ()
 
virtual ~Obstacle ()=default
 
void append_mesh (const Eigen::MatrixXd &vertices, const Eigen::VectorXi &codim_vertices, const Eigen::MatrixXi &codim_edges, const Eigen::MatrixXi &faces, const json &displacement)
 
void append_mesh_sequence (const std::vector< Eigen::MatrixXd > &vertices, const Eigen::VectorXi &codim_vertices, const Eigen::MatrixXi &codim_edges, const Eigen::MatrixXi &faces, const int fps)
 
void append_plane (const VectorNd &point, const VectorNd &normal)
 
int n_vertices () const
 
int n_edges () const
 
int n_faces () const
 
int dim () const
 
int ndof () const
 
const Eigen::MatrixXd & v () const
 
const Eigen::VectorXi & codim_v () const
 
const Eigen::MatrixXi & f () const
 
const Eigen::MatrixXi & e () const
 
const Eigen::MatrixXi & get_face_connectivity () const
 
const Eigen::MatrixXi & get_edge_connectivity () const
 
const Eigen::VectorXi & get_vertex_connectivity () const
 
void change_displacement (const int oid, const Eigen::RowVector3d &val, const std::shared_ptr< utils::Interpolation > &interp=std::make_shared< utils::NoInterpolation >())
 
void change_displacement (const int oid, const std::function< Eigen::MatrixXd(double x, double y, double z, double t)> &func, const std::shared_ptr< utils::Interpolation > &interp=std::make_shared< utils::NoInterpolation >())
 
void change_displacement (const int oid, const json &val, const std::shared_ptr< utils::Interpolation > &interp=std::make_shared< utils::NoInterpolation >())
 
void change_displacement (const int oid, const Eigen::RowVector3d &val, const std::string &interp="")
 
void change_displacement (const int oid, const std::function< Eigen::MatrixXd(double x, double y, double z, double t)> &func, const std::string &interp="")
 
void change_displacement (const int oid, const json &val, const std::string &interp="")
 
void update_displacement (const double t, Eigen::MatrixXd &sol) const
 
void set_zero (Eigen::MatrixXd &sol) const
 
void clear ()
 
const std::vector< Plane > & planes () const
 
void set_units (const Units &units)
 

Private Member Functions

void append_mesh (const Eigen::MatrixXd &vertices, const Eigen::VectorXi &codim_vertices, const Eigen::MatrixXi &codim_edges, const Eigen::MatrixXi &faces)
 

Private Attributes

int dim_
 
Eigen::MatrixXd v_
 
Eigen::VectorXi codim_v_
 
Eigen::MatrixXi f_
 
Eigen::MatrixXi e_
 
Eigen::VectorXi in_v_
 
Eigen::MatrixXi in_f_
 
Eigen::MatrixXi in_e_
 
std::vector< assembler::TensorBCValuedisplacements_
 
std::vector< int > endings_
 
std::vector< Planeplanes_
 

Detailed Description

Definition at line 16 of file Obstacle.hpp.

Constructor & Destructor Documentation

◆ Obstacle()

polyfem::mesh::Obstacle::Obstacle ( )

Definition at line 17 of file Obstacle.cpp.

References clear().

Here is the call graph for this function:

◆ ~Obstacle()

virtual polyfem::mesh::Obstacle::~Obstacle ( )
virtualdefault

Member Function Documentation

◆ append_mesh() [1/2]

void polyfem::mesh::Obstacle::append_mesh ( const Eigen::MatrixXd &  vertices,
const Eigen::VectorXi &  codim_vertices,
const Eigen::MatrixXi &  codim_edges,
const Eigen::MatrixXi &  faces 
)
private

Definition at line 40 of file Obstacle.cpp.

References codim_v_, dim_, e_, endings_, f_, faces, in_e_, in_f_, in_v_, polyfem::log_and_throw_error(), and v_.

Here is the call graph for this function:

◆ append_mesh() [2/2]

void polyfem::mesh::Obstacle::append_mesh ( const Eigen::MatrixXd &  vertices,
const Eigen::VectorXi &  codim_vertices,
const Eigen::MatrixXi &  codim_edges,
const Eigen::MatrixXi &  faces,
const json displacement 
)

Definition at line 96 of file Obstacle.cpp.

References append_mesh(), polyfem::utils::Interpolation::build(), dim_, displacements_, and faces.

Referenced by append_mesh(), append_mesh_sequence(), and polyfem::mesh::read_obstacle_geometry().

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

◆ append_mesh_sequence()

void polyfem::mesh::Obstacle::append_mesh_sequence ( const std::vector< Eigen::MatrixXd > &  vertices,
const Eigen::VectorXi &  codim_vertices,
const Eigen::MatrixXi &  codim_edges,
const Eigen::MatrixXi &  faces,
const int  fps 
)

Definition at line 124 of file Obstacle.cpp.

References append_mesh(), dim_, displacements_, faces, x, y, and z.

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

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

◆ append_plane()

void polyfem::mesh::Obstacle::append_plane ( const VectorNd point,
const VectorNd normal 
)

Definition at line 163 of file Obstacle.cpp.

References dim_, and planes_.

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

Here is the caller graph for this function:

◆ change_displacement() [1/6]

void polyfem::mesh::Obstacle::change_displacement ( const int  oid,
const Eigen::RowVector3d &  val,
const std::shared_ptr< utils::Interpolation > &  interp = std::make_shared< utils::NoInterpolation >() 
)

Referenced by change_displacement(), change_displacement(), and change_displacement().

Here is the caller graph for this function:

◆ change_displacement() [2/6]

void polyfem::mesh::Obstacle::change_displacement ( const int  oid,
const Eigen::RowVector3d &  val,
const std::string &  interp = "" 
)

Definition at line 172 of file Obstacle.cpp.

References polyfem::utils::Interpolation::build(), change_displacement(), and val.

Here is the call graph for this function:

◆ change_displacement() [3/6]

void polyfem::mesh::Obstacle::change_displacement ( const int  oid,
const json val,
const std::shared_ptr< utils::Interpolation > &  interp = std::make_shared< utils::NoInterpolation >() 
)

◆ change_displacement() [4/6]

void polyfem::mesh::Obstacle::change_displacement ( const int  oid,
const json val,
const std::string &  interp = "" 
)

Definition at line 180 of file Obstacle.cpp.

References polyfem::utils::Interpolation::build(), change_displacement(), and val.

Here is the call graph for this function:

◆ change_displacement() [5/6]

void polyfem::mesh::Obstacle::change_displacement ( const int  oid,
const std::function< Eigen::MatrixXd(double x, double y, double z, double t)> &  func,
const std::shared_ptr< utils::Interpolation > &  interp = std::make_shared< utils::NoInterpolation >() 
)

◆ change_displacement() [6/6]

void polyfem::mesh::Obstacle::change_displacement ( const int  oid,
const std::function< Eigen::MatrixXd(double x, double y, double z, double t)> &  func,
const std::string &  interp = "" 
)

Definition at line 176 of file Obstacle.cpp.

References polyfem::utils::Interpolation::build(), and change_displacement().

Here is the call graph for this function:

◆ clear()

void polyfem::mesh::Obstacle::clear ( )

Definition at line 22 of file Obstacle.cpp.

References dim_, displacements_, e_, endings_, f_, in_e_, in_f_, in_v_, planes_, and v_.

Referenced by Obstacle(), and polyfem::State::reset_mesh().

Here is the caller graph for this function:

◆ codim_v()

const Eigen::VectorXi & polyfem::mesh::Obstacle::codim_v ( ) const
inline

Definition at line 42 of file Obstacle.hpp.

References codim_v_.

Referenced by polyfem::State::build_collision_mesh().

Here is the caller graph for this function:

◆ dim()

int polyfem::mesh::Obstacle::dim ( ) const
inline

Definition at line 39 of file Obstacle.hpp.

References dim_.

Referenced by ndof().

Here is the caller graph for this function:

◆ e()

const Eigen::MatrixXi & polyfem::mesh::Obstacle::e ( ) const
inline

Definition at line 44 of file Obstacle.hpp.

References e_.

Referenced by polyfem::State::build_collision_mesh(), polyfem::mesh::LocalMesh< M >::LocalMesh(), and polyfem::mesh::Remesher::write_mesh().

Here is the caller graph for this function:

◆ f()

const Eigen::MatrixXi & polyfem::mesh::Obstacle::f ( ) const
inline

Definition at line 43 of file Obstacle.hpp.

References f_.

Referenced by polyfem::State::build_collision_mesh(), polyfem::mesh::LocalMesh< M >::LocalMesh(), and polyfem::mesh::Remesher::write_mesh().

Here is the caller graph for this function:

◆ get_edge_connectivity()

const Eigen::MatrixXi & polyfem::mesh::Obstacle::get_edge_connectivity ( ) const
inline

Definition at line 47 of file Obstacle.hpp.

References in_e_.

Referenced by polyfem::io::OutGeometryData::save_volume().

Here is the caller graph for this function:

◆ get_face_connectivity()

const Eigen::MatrixXi & polyfem::mesh::Obstacle::get_face_connectivity ( ) const
inline

Definition at line 46 of file Obstacle.hpp.

References in_f_.

Referenced by polyfem::io::OutGeometryData::save_volume().

Here is the caller graph for this function:

◆ get_vertex_connectivity()

const Eigen::VectorXi & polyfem::mesh::Obstacle::get_vertex_connectivity ( ) const
inline

Definition at line 48 of file Obstacle.hpp.

References in_v_.

Referenced by polyfem::io::OutGeometryData::save_volume().

Here is the caller graph for this function:

◆ n_edges()

int polyfem::mesh::Obstacle::n_edges ( ) const
inline

Definition at line 37 of file Obstacle.hpp.

References e_.

Referenced by polyfem::mesh::LocalMesh< M >::LocalMesh(), and polyfem::mesh::Remesher::write_mesh().

Here is the caller graph for this function:

◆ n_faces()

int polyfem::mesh::Obstacle::n_faces ( ) const
inline

Definition at line 38 of file Obstacle.hpp.

References f_.

Referenced by polyfem::mesh::LocalMesh< M >::LocalMesh().

Here is the caller graph for this function:

◆ n_vertices()

◆ ndof()

int polyfem::mesh::Obstacle::ndof ( ) const
inline

Definition at line 40 of file Obstacle.hpp.

References dim(), and n_vertices().

Referenced by polyfem::State::init_homogenization_solve(), polyfem::State::init_nonlinear_tensor_solve(), polyfem::mesh::Remesher::project_quantities(), polyfem::io::OutGeometryData::save_volume(), polyfem::io::OutGeometryData::save_volume_vector_field(), and polyfem::assembler::RhsAssembler::time_bc().

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

◆ planes()

const std::vector< Plane > & polyfem::mesh::Obstacle::planes ( ) const
inline

Definition at line 64 of file Obstacle.hpp.

References planes_.

◆ set_units()

void polyfem::mesh::Obstacle::set_units ( const Units units)

Definition at line 245 of file Obstacle.cpp.

References displacements_, and polyfem::Units::length().

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

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

◆ set_zero()

void polyfem::mesh::Obstacle::set_zero ( Eigen::MatrixXd &  sol) const

Definition at line 239 of file Obstacle.cpp.

References dim_, and v_.

◆ update_displacement()

void polyfem::mesh::Obstacle::update_displacement ( const double  t,
Eigen::MatrixXd &  sol 
) const

Definition at line 212 of file Obstacle.cpp.

References dim_, displacements_, endings_, and v_.

◆ v()

const Eigen::MatrixXd & polyfem::mesh::Obstacle::v ( ) const
inline

Definition at line 41 of file Obstacle.hpp.

References v_.

Referenced by polyfem::State::build_collision_mesh(), polyfem::mesh::LocalMesh< M >::LocalMesh(), and polyfem::io::OutGeometryData::save_volume().

Here is the caller graph for this function:

Member Data Documentation

◆ codim_v_

Eigen::VectorXi polyfem::mesh::Obstacle::codim_v_
private

Definition at line 77 of file Obstacle.hpp.

Referenced by append_mesh(), and codim_v().

◆ dim_

int polyfem::mesh::Obstacle::dim_
private

◆ displacements_

std::vector<assembler::TensorBCValue> polyfem::mesh::Obstacle::displacements_
private

Definition at line 85 of file Obstacle.hpp.

Referenced by append_mesh(), append_mesh_sequence(), clear(), set_units(), and update_displacement().

◆ e_

Eigen::MatrixXi polyfem::mesh::Obstacle::e_
private

Definition at line 79 of file Obstacle.hpp.

Referenced by append_mesh(), clear(), e(), and n_edges().

◆ endings_

std::vector<int> polyfem::mesh::Obstacle::endings_
private

Definition at line 87 of file Obstacle.hpp.

Referenced by append_mesh(), clear(), and update_displacement().

◆ f_

Eigen::MatrixXi polyfem::mesh::Obstacle::f_
private

Definition at line 78 of file Obstacle.hpp.

Referenced by append_mesh(), clear(), f(), and n_faces().

◆ in_e_

Eigen::MatrixXi polyfem::mesh::Obstacle::in_e_
private

Definition at line 83 of file Obstacle.hpp.

Referenced by append_mesh(), clear(), and get_edge_connectivity().

◆ in_f_

Eigen::MatrixXi polyfem::mesh::Obstacle::in_f_
private

Definition at line 82 of file Obstacle.hpp.

Referenced by append_mesh(), clear(), and get_face_connectivity().

◆ in_v_

Eigen::VectorXi polyfem::mesh::Obstacle::in_v_
private

Definition at line 81 of file Obstacle.hpp.

Referenced by append_mesh(), clear(), and get_vertex_connectivity().

◆ planes_

std::vector<Plane> polyfem::mesh::Obstacle::planes_
private

Definition at line 89 of file Obstacle.hpp.

Referenced by append_plane(), clear(), and planes().

◆ v_

Eigen::MatrixXd polyfem::mesh::Obstacle::v_
private

Definition at line 76 of file Obstacle.hpp.

Referenced by append_mesh(), clear(), n_vertices(), set_zero(), update_displacement(), and v().


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