|
PolyFEM
|
Applies geometry JSON semantics while delegating all decoding to MeshLoader. More...
#include <GeometryLoader.hpp>
Public Member Functions | |
| GeometryLoader (Units units, const io::ResourceIO &resources) | |
| LoadedGeometry | load (const json &geometry, const std::vector< json > &obstacle_displacements, const std::vector< json > &dirichlet_conditions, bool non_conforming=false) const |
| std::unique_ptr< Mesh > | load_fem (const json &geometry, bool non_conforming=false) const |
| Load and combine the enabled FEM entries in a geometry configuration. | |
| std::unique_ptr< Mesh > | load_fem_entry (const json &geometry, bool non_conforming=false) const |
| SurfaceMesh | load_surface (const json &geometry, int dimension) const |
| Load and prepare one configured surface/codimensional geometry entry. | |
| Obstacle | load_obstacles (const json &geometry, const std::vector< json > &obstacle_displacements, const std::vector< json > &dirichlet_conditions, int dimension, bool non_conforming=false) const |
| void | apply_geometry_selection (Mesh &mesh, const json &geometry_selection) const |
| Apply configured geometry IDs to an already constructed mesh. | |
Static Public Member Functions | |
| static void | construct_affine_transformation (double unit_scale, const json &transform, const VectorNd &mesh_dimensions, MatrixNd &A, VectorNd &b) |
| Construct the affine map used by geometry and collision-proxy inputs. | |
Private Attributes | |
| Units | units_ |
| const io::ResourceIO & | resources_ |
Applies geometry JSON semantics while delegating all decoding to MeshLoader.
Definition at line 21 of file GeometryLoader.hpp.
|
inline |
Definition at line 24 of file GeometryLoader.hpp.
| void polyfem::mesh::GeometryLoader::apply_geometry_selection | ( | Mesh & | mesh, |
| const json & | geometry_selection | ||
| ) | const |
Apply configured geometry IDs to an already constructed mesh.
Definition at line 37 of file GeometryLoader.cpp.
References polyfem::mesh::Mesh::bounding_box(), polyfem::utils::Selection::build_selections(), polyfem::mesh::Mesh::compute_element_barycenters(), polyfem::mesh::Mesh::element_vertices(), polyfem::mesh::Mesh::get_body_id(), polyfem::mesh::Mesh::n_elements(), resources_, and polyfem::mesh::Mesh::set_geometry_ids().
Referenced by load_fem_entry().
|
static |
Construct the affine map used by geometry and collision-proxy inputs.
Definition at line 692 of file GeometryLoader.cpp.
References polyfem::utils::deg2rad(), polyfem::log_and_throw_error(), and polyfem::utils::to_rotation_matrix().
Referenced by load_fem_entry(), and load_surface().
| LoadedGeometry polyfem::mesh::GeometryLoader::load | ( | const json & | geometry, |
| const std::vector< json > & | obstacle_displacements, | ||
| const std::vector< json > & | dirichlet_conditions, | ||
| bool | non_conforming = false |
||
| ) | const |
Definition at line 21 of file GeometryLoader.cpp.
References polyfem::mesh::LoadedGeometry::fem, load_fem(), load_obstacles(), polyfem::log_and_throw_error(), and polyfem::mesh::LoadedGeometry::obstacle.
Referenced by polyfem::State::load_mesh().
| std::unique_ptr< Mesh > polyfem::mesh::GeometryLoader::load_fem | ( | const json & | geometry, |
| bool | non_conforming = false |
||
| ) | const |
Load and combine the enabled FEM entries in a geometry configuration.
Definition at line 312 of file GeometryLoader.cpp.
References polyfem::utils::json_as_array(), load_fem_entry(), and polyfem::log_and_throw_error().
Referenced by load(), and polyfem::legacy::State::load_mesh().
| std::unique_ptr< Mesh > polyfem::mesh::GeometryLoader::load_fem_entry | ( | const json & | geometry, |
| bool | non_conforming = false |
||
| ) | const |
Definition at line 75 of file GeometryLoader.cpp.
References apply_geometry_selection(), polyfem::utils::Selection::build_selections(), construct_affine_transformation(), polyfem::Units::convert(), polyfem::utils::is_param_valid(), polyfem::Units::length(), polyfem::mesh::MeshLoader::load_fem(), polyfem::log_and_throw_error(), polyfem::logger(), resources_, and units_.
Referenced by load_fem().
| Obstacle polyfem::mesh::GeometryLoader::load_obstacles | ( | const json & | geometry, |
| const std::vector< json > & | obstacle_displacements, | ||
| const std::vector< json > & | dirichlet_conditions, | ||
| int | dimension, | ||
| bool | non_conforming = false |
||
| ) | const |
Definition at line 485 of file GeometryLoader.cpp.
References polyfem::mesh::Obstacle::append_mesh(), polyfem::mesh::Obstacle::append_mesh_sequence(), polyfem::mesh::Obstacle::append_plane(), polyfem::mesh::SurfaceMeshData::edges, faces, polyfem::mesh::SurfaceMeshData::faces, polyfem::io::ResourceIO::glob(), polyfem::io::ResourceIO::is_group(), polyfem::utils::is_param_valid(), polyfem::utils::json_as_array(), polyfem::io::ResourceIO::list(), load_surface(), polyfem::log_and_throw_error(), point, polyfem::mesh::SurfaceMeshData::points, resources_, polyfem::mesh::Obstacle::set_units(), units_, and polyfem::mesh::SurfaceMeshData::vertices.
Referenced by load(), polyfem::State::load_mesh(), polyfem::legacy::State::load_mesh(), and polyfem::legacy::State::load_mesh().
| SurfaceMesh polyfem::mesh::GeometryLoader::load_surface | ( | const json & | geometry, |
| int | dimension | ||
| ) | const |
Load and prepare one configured surface/codimensional geometry entry.
Definition at line 382 of file GeometryLoader.cpp.
References construct_affine_transformation(), polyfem::Units::convert(), polyfem::mesh::SurfaceMeshData::edges, faces, polyfem::mesh::SurfaceMeshData::faces, polyfem::utils::is_param_valid(), polyfem::Units::length(), polyfem::mesh::MeshLoader::load_surface(), polyfem::log_and_throw_error(), polyfem::mesh::SurfaceMeshData::points, resources_, units_, and polyfem::mesh::SurfaceMeshData::vertices.
Referenced by load_obstacles().
|
private |
Definition at line 68 of file GeometryLoader.hpp.
Referenced by apply_geometry_selection(), load_fem_entry(), load_obstacles(), and load_surface().
|
private |
Definition at line 67 of file GeometryLoader.hpp.
Referenced by load_fem_entry(), load_obstacles(), and load_surface().