|
PolyFEM
|
Read-only interface to a hierarchical collection of simulation resources. More...
#include <ResourceIO.hpp>
Classes | |
| class | AccessTracker |
Public Member Functions | |
| virtual | ~ResourceIO ()=default |
| virtual std::unique_ptr< const ResourceIO > | with_root (const std::string &root) const =0 |
| virtual std::string | canonical_path (const std::string &path) const =0 |
| Absolute resource identity, independent of the active reader root. | |
| virtual bool | exists (const std::string &path) const =0 |
| virtual bool | is_group (const std::string &path) const =0 |
| virtual std::vector< std::string > | list (const std::string &path) const =0 |
| std::vector< std::string > | glob (const std::string &pattern) const |
| Glob normalized logical paths using POSIX '*' and '?' wildcards. | |
| virtual std::unique_ptr< std::istream > | open (const std::string &path, bool binary) const =0 |
| virtual std::string | read_string (const std::string &path) const |
| virtual Eigen::MatrixXd | read_matrix (const std::string &path) const =0 |
| virtual Eigen::MatrixXi | read_int_matrix (const std::string &path) const =0 |
| virtual std::vector< double > | read_double_vector (const std::string &path) const =0 |
| virtual std::vector< int > | read_int_vector (const std::string &path) const =0 |
| virtual std::vector< long > | read_long_vector (const std::string &path) const =0 |
| virtual bool | has_attribute (const std::string &path, const std::string &name) const =0 |
| virtual long | read_integer_attribute (const std::string &path, const std::string &name) const =0 |
| virtual std::string | read_string_attribute (const std::string &path, const std::string &name) const =0 |
| virtual std::array< long, 2 > | read_shape_attribute (const std::string &path, const std::string &name) const =0 |
| virtual std::filesystem::path | materialize (const std::string &path) const =0 |
| virtual const std::filesystem::path & | host_directory () const =0 |
| Host directory used only as the base for ordinary filesystem outputs. | |
| virtual std::string | describe (const std::string &path) const =0 |
| std::vector< std::string > | accessed_resources () const |
| A snapshot of canonical paths consumed so far, including solver setup. | |
Protected Member Functions | |
| ResourceIO () | |
| void | record_access (const std::string &path) const |
Protected Attributes | |
| std::shared_ptr< AccessTracker > | access_tracker_ |
Read-only interface to a hierarchical collection of simulation resources.
Definition at line 19 of file ResourceIO.hpp.
|
virtualdefault |
|
protected |
Definition at line 187 of file ResourceIO.cpp.
| std::vector< std::string > polyfem::io::ResourceIO::accessed_resources | ( | ) | const |
A snapshot of canonical paths consumed so far, including solver setup.
Tracking remains active for subsequent solves and checkpoint writes.
Definition at line 196 of file ResourceIO.cpp.
References access_tracker_.
Referenced by polyfem::io::CheckpointWriter::embed_resources().
|
pure virtual |
Absolute resource identity, independent of the active reader root.
Implemented in polyfem::io::FileSystemIO, and polyfem::io::HDF5IO.
Referenced by polyfem::io::CheckpointWriter::embed_resources(), and record_access().
|
pure virtual |
Implemented in polyfem::io::FileSystemIO, and polyfem::io::HDF5IO.
Referenced by polyfem::assembler::FiberDirection::add_multimaterial(), polyfem::io::CheckpointWriter::embed_resources(), polyfem::utils::FileSelection::FileSelection(), forward_simulation(), polyfem::mesh::MeshLoader::load_fem(), polyfem::mesh::MeshLoader::load_surface(), and polyfem::mesh::MeshLoader::validate_group().
|
pure virtual |
Implemented in polyfem::io::FileSystemIO, and polyfem::io::HDF5IO.
Referenced by polyfem::io::CheckpointWriter::embed_resources(), glob(), polyfem::utils::ExpressionValue::init(), polyfem::mesh::MeshLoader::load_fem(), polyfem::mesh::MeshLoader::load_surface(), and polyfem::mesh::MeshLoader::validate_group().
| std::vector< std::string > polyfem::io::ResourceIO::glob | ( | const std::string & | pattern | ) | const |
Glob normalized logical paths using POSIX '*' and '?' wildcards.
'**/' matches zero or more directories; returned paths omit './'.
Definition at line 202 of file ResourceIO.cpp.
References exists(), polyfem::mesh::find(), is_group(), and list().
Referenced by polyfem::mesh::GeometryLoader::load_obstacles().
|
pure virtual |
Implemented in polyfem::io::FileSystemIO, and polyfem::io::HDF5IO.
Referenced by polyfem::mesh::MeshLoader::load_fem(), and polyfem::mesh::MeshLoader::validate_group().
|
pure virtual |
Host directory used only as the base for ordinary filesystem outputs.
Implemented in polyfem::io::FileSystemIO, and polyfem::io::HDF5IO.
Referenced by forward_simulation().
|
pure virtual |
Implemented in polyfem::io::FileSystemIO, and polyfem::io::HDF5IO.
Referenced by polyfem::io::CheckpointWriter::embed_resources(), glob(), polyfem::utils::ExpressionValue::init(), polyfem::mesh::load_collision_proxy_displacement_map(), polyfem::mesh::MeshLoader::load_fem(), polyfem::mesh::GeometryLoader::load_obstacles(), and polyfem::mesh::MeshLoader::load_surface().
|
pure virtual |
Implemented in polyfem::io::FileSystemIO, and polyfem::io::HDF5IO.
Referenced by glob(), and polyfem::mesh::GeometryLoader::load_obstacles().
|
pure virtual |
Implemented in polyfem::io::FileSystemIO, and polyfem::io::HDF5IO.
Referenced by polyfem::utils::ExpressionValue::init(), polyfem::mesh::load_collision_proxy_displacement_map(), polyfem::mesh::MeshLoader::load_fem(), and polyfem::mesh::MeshLoader::load_surface().
|
pure virtual |
Implemented in polyfem::io::FileSystemIO, and polyfem::io::HDF5IO.
Referenced by polyfem::assembler::FiberDirection::add_multimaterial(), polyfem::io::CheckpointWriter::embed_resources(), polyfem::problem::NodeValues::load(), polyfem::mesh::MeshLoader::load_fem(), read_string(), and polyfem::problem::KernelProblem::set_parameters().
|
pure virtual |
Implemented in polyfem::io::FileSystemIO, and polyfem::io::HDF5IO.
Referenced by polyfem::mesh::load_collision_proxy_displacement_map(), and polyfem::mesh::MeshLoader::load_fem().
|
pure virtual |
Implemented in polyfem::io::FileSystemIO, and polyfem::io::HDF5IO.
Referenced by polyfem::varform::VarForm::assign_discr_orders(), polyfem::utils::FileSelection::FileSelection(), polyfem::problem::PointBasedTensorProblem::BCValue::init(), polyfem::mesh::MeshLoader::load_fem(), and polyfem::mesh::MeshLoader::load_surface().
|
pure virtual |
Implemented in polyfem::io::FileSystemIO, and polyfem::io::HDF5IO.
Referenced by polyfem::mesh::load_collision_proxy_displacement_map(), polyfem::mesh::MeshLoader::load_fem(), and polyfem::mesh::MeshLoader::load_surface().
|
pure virtual |
Implemented in polyfem::io::FileSystemIO, and polyfem::io::HDF5IO.
Referenced by polyfem::mesh::MeshLoader::load_fem(), polyfem::mesh::MeshLoader::load_surface(), and polyfem::mesh::MeshLoader::validate_group().
|
pure virtual |
Implemented in polyfem::io::FileSystemIO, and polyfem::io::HDF5IO.
Referenced by polyfem::mesh::MeshLoader::load_fem().
|
pure virtual |
Implemented in polyfem::io::FileSystemIO, and polyfem::io::HDF5IO.
Referenced by polyfem::problem::PointBasedTensorProblem::BCValue::init(), polyfem::utils::ExpressionValue::init(), polyfem::mesh::MeshLoader::load_fem(), polyfem::mesh::MeshLoader::load_surface(), polyfem::solver::NodeTargetForm::NodeTargetForm(), polyfem::assembler::GenericTensorProblem::set_parameters(), and polyfem::assembler::GenericScalarProblem::set_parameters().
|
pure virtual |
Implemented in polyfem::io::FileSystemIO, and polyfem::io::HDF5IO.
Referenced by polyfem::mesh::load_collision_proxy_displacement_map().
|
virtual |
Reimplemented in polyfem::io::HDF5IO.
Definition at line 260 of file ResourceIO.cpp.
References open().
Referenced by polyfem::utils::apply_common_params(), polyfem::utils::apply_common_params(), and polyfem::utils::expand_bc_sidecars().
|
pure virtual |
Implemented in polyfem::io::FileSystemIO, and polyfem::io::HDF5IO.
Referenced by polyfem::mesh::MeshLoader::validate_group().
|
protected |
Definition at line 189 of file ResourceIO.cpp.
References access_tracker_, and canonical_path().
Referenced by polyfem::io::FileSystemIO::materialize(), polyfem::io::HDF5IO::materialize(), polyfem::io::FileSystemIO::open(), polyfem::io::FileSystemIO::read_int_matrix(), polyfem::io::HDF5IO::read_int_matrix(), polyfem::io::HDF5IO::read_integer_attribute(), polyfem::io::FileSystemIO::read_long_vector(), polyfem::io::HDF5IO::read_long_vector(), polyfem::io::FileSystemIO::read_matrix(), polyfem::io::HDF5IO::read_matrix(), polyfem::io::HDF5IO::read_shape_attribute(), polyfem::io::HDF5IO::read_string(), and polyfem::io::HDF5IO::read_string_attribute().
|
pure virtual |
Implemented in polyfem::io::FileSystemIO, and polyfem::io::HDF5IO.
Referenced by polyfem::utils::apply_common_params(), polyfem::OptState::init(), polyfem::State::init(), and polyfem::OptState::run().
|
protected |
Definition at line 60 of file ResourceIO.hpp.
Referenced by accessed_resources(), record_access(), polyfem::io::FileSystemIO::with_root(), and polyfem::io::HDF5IO::with_root().