|
PolyFEM
|
main class that contains the polyfem solver and all its state More...
#include <State.hpp>
Public Member Functions | |
| ~State ()=default | |
| State () | |
| Constructor. | |
| void | set_max_threads (const int max_threads=std::numeric_limits< int >::max()) |
| void | init (const json &args, const bool strict_validation) |
| initialize the polyfem solver with a json settings | |
| void | init_time () |
| initialize time settings if args contains "time" | |
| void | init_logger (const std::string &log_file, const spdlog::level::level_enum log_level, const spdlog::level::level_enum file_log_level, const bool is_quiet) |
| initializing the logger | |
| void | init_logger (std::ostream &os, const spdlog::level::level_enum log_level) |
| initializing the logger writes to an output stream | |
| void | set_log_level (const spdlog::level::level_enum log_level) |
| change log level | |
| std::string | get_log (const Eigen::MatrixXd &sol) |
| gets the output log as json this is not what gets printed but more informative information, e.g., it contains runtimes, errors, etc. | |
| std::string | formulation () const |
| return the formulation (checks if the problem is scalar or not and deals with multiphysics) | |
| bool | iso_parametric () const |
| check if using iso parametric bases | |
| const std::vector< basis::ElementBases > & | geom_bases () const |
| Get a constant reference to the geometry mapping bases. | |
| void | build_basis () |
| builds the bases step 2 of solve modifies bases, pressure_bases, geom_bases_, boundary_nodes, dirichlet_nodes, neumann_nodes, local_boundary, total_local_boundary local_neumann_boundary, polys, poly_edge_to_data, rhs | |
| void | assemble_rhs () |
| compute rhs, step 3 of solve build rhs vector based on defined basis and given rhs of the problem modifies rhs (and maybe more?) | |
| void | assemble_mass_mat () |
| assemble mass, step 4 of solve build mass matrix based on defined basis modifies mass (and maybe more?) | |
| std::shared_ptr< assembler::RhsAssembler > | build_rhs_assembler (const int n_bases, const std::vector< basis::ElementBases > &bases, const assembler::AssemblyValsCache &ass_vals_cache) const |
| build a RhsAssembler for the problem | |
| std::shared_ptr< assembler::RhsAssembler > | build_rhs_assembler () const |
| build a RhsAssembler for the problem | |
| std::shared_ptr< assembler::PressureAssembler > | build_pressure_assembler (const int n_bases_, const std::vector< basis::ElementBases > &bases_) const |
| std::shared_ptr< assembler::PressureAssembler > | build_pressure_assembler () const |
| QuadratureOrders | n_boundary_samples () const |
| quadrature used for projecting boundary conditions | |
| int | ndof () const |
| void | set_materials (std::vector< std::shared_ptr< assembler::Assembler > > &assemblers) const |
| set the material and the problem dimension | |
| void | set_materials (assembler::Assembler &assembler) const |
| utility to set the material and the problem dimension to only 1 assembler | |
| void | solve_problem (Eigen::MatrixXd &sol, Eigen::MatrixXd &pressure, UserPostStepCallback user_post_step={}, const InitialConditionOverride *ic_override=nullptr) |
| solves the problems | |
| void | solve (Eigen::MatrixXd &sol, Eigen::MatrixXd &pressure, UserPostStepCallback user_post_step={}, const InitialConditionOverride *ic_override=nullptr) |
| solves the problem, call other methods | |
| void | init_solve (Eigen::MatrixXd &sol, Eigen::MatrixXd &pressure, const InitialConditionOverride *ic_override=nullptr) |
| initialize solver | |
| void | solve_transient_navier_stokes_split (const int time_steps, const double dt, Eigen::MatrixXd &sol, Eigen::MatrixXd &pressure, UserPostStepCallback user_post_step={}) |
| solves transient navier stokes with operator splitting | |
| void | solve_transient_navier_stokes (const int time_steps, const double t0, const double dt, Eigen::MatrixXd &sol, Eigen::MatrixXd &pressure, UserPostStepCallback user_post_step={}) |
| solves transient navier stokes with FEM | |
| void | solve_transient_linear (const int time_steps, const double t0, const double dt, Eigen::MatrixXd &sol, Eigen::MatrixXd &pressure, UserPostStepCallback user_post_step={}, const InitialConditionOverride *ic_override=nullptr) |
| solves transient linear problem | |
| void | solve_transient_tensor_nonlinear (const int time_steps, const double t0, const double dt, Eigen::MatrixXd &sol, UserPostStepCallback user_post_step={}, const InitialConditionOverride *ic_override=nullptr) |
| solves transient tensor nonlinear problem | |
| void | init_nonlinear_tensor_solve (Eigen::MatrixXd &sol, const double t=1.0, const bool init_time_integrator=true, const InitialConditionOverride *ic_override=nullptr) |
| initialize the nonlinear solver | |
| void | init_linear_solve (Eigen::MatrixXd &sol, const double t=1.0, const InitialConditionOverride *ic_override=nullptr) |
| initialize the linear solve | |
| void | initial_solution (Eigen::MatrixXd &solution, const InitialConditionOverride *ic_override=nullptr) const |
| Load or compute the initial solution. | |
| void | initial_velocity (Eigen::MatrixXd &velocity, const InitialConditionOverride *ic_override=nullptr) const |
| Load or compute the initial velocity. | |
| void | initial_acceleration (Eigen::MatrixXd &acceleration, const InitialConditionOverride *ic_override=nullptr) const |
| Load or compute the initial acceleration. | |
| void | solve_linear (int step, Eigen::MatrixXd &sol, Eigen::MatrixXd &pressure, UserPostStepCallback user_post_step={}) |
| solves a linear problem | |
| void | solve_navier_stokes (int step, Eigen::MatrixXd &sol, Eigen::MatrixXd &pressure, UserPostStepCallback user_post_step={}) |
| solves a navier stokes | |
| void | solve_tensor_nonlinear (int step, Eigen::MatrixXd &sol, const bool init_lagging=true, UserPostStepCallback user_post_step={}) |
| solves nonlinear problems | |
| std::shared_ptr< polysolve::nonlinear::Solver > | make_nl_solver (bool for_al) const |
| factory to create the nl solver depending on input | |
| bool | has_periodic_bc () const |
| void | solve_linear (int step, const std::unique_ptr< polysolve::linear::Solver > &solver, StiffnessMatrix &A, Eigen::VectorXd &b, const bool compute_spectrum, Eigen::MatrixXd &sol, Eigen::MatrixXd &pressure, UserPostStepCallback user_post_step={}) |
| Solve the linear problem with the given solver and system. | |
| bool | is_problem_linear () const |
| Returns whether the system is linear. Collisions and pressure add nonlinearity to the problem. | |
| bool | has_constraints () const |
| void | build_stiffness_mat (StiffnessMatrix &stiffness) |
| utility that builds the stiffness matrix and collects stats, used only for linear problems | |
| std::unordered_map< int, std::array< bool, 3 > > | boundary_conditions_ids (const std::string &bc_type) const |
| Construct a vector of boundary conditions ids with their dimension flags. | |
| std::vector< int > | primitive_to_node () const |
| std::vector< int > | node_to_primitive () const |
| void | load_mesh (bool non_conforming=false, const std::vector< std::string > &names=std::vector< std::string >(), const std::vector< Eigen::MatrixXi > &cells=std::vector< Eigen::MatrixXi >(), const std::vector< Eigen::MatrixXd > &vertices=std::vector< Eigen::MatrixXd >()) |
| loads the mesh from the json arguments | |
| void | load_mesh (GEO::Mesh &meshin, const std::function< int(const size_t, const std::vector< int > &, const RowVectorNd &, bool)> &boundary_marker, bool non_conforming=false, bool skip_boundary_sideset=false) |
| loads the mesh from a geogram mesh | |
| void | load_mesh (const Eigen::MatrixXd &V, const Eigen::MatrixXi &F, bool non_conforming=false) |
| loads the mesh from V and F, | |
| void | reset_mesh () |
| Resets the mesh. | |
| void | build_mesh_matrices (Eigen::MatrixXd &V, Eigen::MatrixXi &F) |
| Build the mesh matrices (vertices and elements) from the mesh using the bases node ordering. | |
| bool | remesh (const double time, const double dt, Eigen::MatrixXd &sol) |
| Remesh the FE space and update solution(s). | |
| void | get_vertices (Eigen::MatrixXd &vertices) const |
| Gather geometry vertices into a dense matrix. | |
| void | get_elements (Eigen::MatrixXi &elements) const |
| Gather geometry elements into a dense matrix. | |
| void | build_collision_mesh () |
| extracts the boundary mesh for collision, called in build_basis | |
| void | build_periodic_collision_mesh () |
| bool | is_obstacle_vertex (const size_t vi) const |
| checks if vertex is obstacle | |
| bool | is_contact_enabled () const |
| does the simulation have contact | |
| bool | is_adhesion_enabled () const |
| does the simulation have adhesion | |
| bool | is_pressure_enabled () const |
| does the simulation has pressure | |
| void | export_data (const Eigen::MatrixXd &sol, const Eigen::MatrixXd &pressure) |
| saves all data on the disk according to the input params | |
| void | save_timestep (const double time, const int t, const double t0, const double dt, const Eigen::MatrixXd &sol, const Eigen::MatrixXd &pressure) |
| saves a timestep | |
| void | save_subsolve (const int i, const int t, const Eigen::MatrixXd &sol, const Eigen::MatrixXd &pressure) |
| saves a subsolve when save_solve_sequence_debug is true | |
| void | save_json (const Eigen::MatrixXd &sol, std::ostream &out) |
| saves the output statistic to a stream | |
| void | save_json (const Eigen::MatrixXd &sol) |
| saves the output statistic to disc according to params | |
| void | compute_errors (const Eigen::MatrixXd &sol) |
| computes all errors | |
| void | save_restart_json (const double t0, const double dt, const int t) const |
| Save a JSON sim file for restarting the simulation at time t. | |
| std::string | root_path () const |
| Get the root path for the state (e.g., args["root_path"] or ".") | |
| std::string | resolve_input_path (const std::string &path, const bool only_if_exists=false) const |
| Resolve input path relative to root_path() if the path is not absolute. | |
| std::string | resolve_output_path (const std::string &path) const |
| Resolve output path relative to output_dir if the path is not absolute. | |
| void | solve_homogenization_step (int step, Eigen::MatrixXd &sol, bool adaptive_initial_weight=false, UserPostStepCallback user_post_step={}) |
| In Elasticity PDE, solve for "min W(disp_grad + \grad u)" instead of "min W(\grad u)". | |
| void | init_homogenization_solve (const double t) |
| void | solve_homogenization (const int time_steps, const double t0, const double dt, Eigen::MatrixXd &sol, UserPostStepCallback user_post_step={}) |
| bool | is_homogenization () const |
Static Public Member Functions | |
| static void | build_collision_mesh (const mesh::Mesh &mesh, const int n_bases, const std::vector< basis::ElementBases > &bases, const std::vector< basis::ElementBases > &geom_bases, const std::vector< mesh::LocalBoundary > &total_local_boundary, const mesh::Obstacle &obstacle, const json &args, const std::function< std::string(const std::string &)> &resolve_input_path, const Eigen::VectorXi &in_node_to_node, ipc::CollisionMesh &collision_mesh) |
| extracts the boundary mesh for collision, called in build_basis | |
Public Attributes | |
| json | args |
| main input arguments containing all defaults | |
| Units | units |
| std::shared_ptr< assembler::Assembler > | assembler = nullptr |
| assemblers | |
| std::shared_ptr< assembler::Mass > | mass_matrix_assembler = nullptr |
| std::shared_ptr< assembler::MixedAssembler > | mixed_assembler = nullptr |
| std::shared_ptr< assembler::Assembler > | pressure_assembler = nullptr |
| std::shared_ptr< assembler::PressureAssembler > | elasticity_pressure_assembler = nullptr |
| std::shared_ptr< assembler::ViscousDamping > | damping_assembler = nullptr |
| std::shared_ptr< assembler::ViscousDampingPrev > | damping_prev_assembler = nullptr |
| std::shared_ptr< assembler::Problem > | problem |
| current problem, it contains rhs and bc | |
| std::vector< basis::ElementBases > | bases |
| FE bases, the size is #elements. | |
| std::vector< basis::ElementBases > | pressure_bases |
| FE pressure bases for mixed elements, the size is #elements. | |
| std::vector< basis::ElementBases > | geom_bases_ |
| Geometric mapping bases, if the elements are isoparametric, this list is empty. | |
| int | n_bases |
| number of bases | |
| int | n_pressure_bases |
| number of pressure bases | |
| int | n_geom_bases |
| number of geometric bases | |
| std::map< int, Eigen::MatrixXd > | polys |
| polygons, used since poly have no geom mapping | |
| std::map< int, std::pair< Eigen::MatrixXd, Eigen::MatrixXi > > | polys_3d |
| polyhedra, used since poly have no geom mapping | |
| Eigen::VectorXi | disc_orders |
| vector of discretization orders, used when not all elements have the same degree, one per element | |
| Eigen::VectorXi | disc_ordersq |
| std::shared_ptr< polyfem::mesh::MeshNodes > | mesh_nodes |
| Mapping from input nodes to FE nodes. | |
| std::shared_ptr< polyfem::mesh::MeshNodes > | geom_mesh_nodes |
| std::shared_ptr< polyfem::mesh::MeshNodes > | pressure_mesh_nodes |
| assembler::AssemblyValsCache | ass_vals_cache |
| used to store assembly values for small problems | |
| assembler::AssemblyValsCache | mass_ass_vals_cache |
| assembler::AssemblyValsCache | pressure_ass_vals_cache |
| used to store assembly values for pressure for small problems | |
| StiffnessMatrix | mass |
| Mass matrix, it is computed only for time dependent problems. | |
| double | avg_mass |
| average system mass, used for contact with IPC | |
| Eigen::MatrixXd | rhs |
| System right-hand side. | |
| bool | use_avg_pressure |
| use average pressure for stokes problem to fix the additional dofs, true by default if false, it will fix one pressure node to zero | |
| solver::SolveData | solve_data |
| timedependent stuff cached | |
| std::unique_ptr< polysolve::linear::Solver > | static_linear_solver_cache |
| Linear solver instance from the most recent static linear solve. | |
| std::shared_ptr< utils::PeriodicBoundary > | periodic_bc |
| periodic BC and periodic mesh utils | |
| std::vector< int > | boundary_nodes |
| list of boundary nodes | |
| std::vector< int > | pressure_boundary_nodes |
| list of neumann boundary nodes | |
| std::vector< mesh::LocalBoundary > | total_local_boundary |
| mapping from elements to nodes for all mesh | |
| std::vector< mesh::LocalBoundary > | local_boundary |
| mapping from elements to nodes for dirichlet boundary conditions | |
| std::vector< mesh::LocalBoundary > | local_neumann_boundary |
| mapping from elements to nodes for neumann boundary conditions | |
| std::vector< mesh::LocalBoundary > | local_pressure_boundary |
| mapping from elements to nodes for pressure boundary conditions | |
| std::unordered_map< int, std::vector< mesh::LocalBoundary > > | local_pressure_cavity |
| mapping from elements to nodes for pressure boundary conditions | |
| std::map< int, basis::InterfaceData > | poly_edge_to_data |
| nodes on the boundary of polygonal elements, used for harmonic bases | |
| std::vector< int > | dirichlet_nodes |
| per node dirichlet | |
| std::vector< RowVectorNd > | dirichlet_nodes_position |
| std::vector< int > | neumann_nodes |
| per node neumann | |
| std::vector< RowVectorNd > | neumann_nodes_position |
| Eigen::VectorXi | in_node_to_node |
| Inpute nodes (including high-order) to polyfem nodes, only for isoparametric. | |
| Eigen::VectorXi | in_primitive_to_primitive |
| maps in vertices/edges/faces/cells to polyfem vertices/edges/faces/cells | |
| std::unique_ptr< mesh::Mesh > | mesh |
| current mesh, it can be a Mesh2D or Mesh3D | |
| mesh::Obstacle | obstacle |
| Obstacles used in collisions. | |
| ipc::CollisionMesh | collision_mesh |
| IPC collision mesh. | |
| ipc::CollisionMesh | periodic_collision_mesh |
| IPC collision mesh under periodic BC. | |
| Eigen::VectorXi | periodic_collision_mesh_to_basis |
| index mapping from periodic 2x2 collision mesh to FE periodic mesh | |
| bool | has_dhat = false |
| stores if input json contains dhat | |
| std::string | output_dir |
| Directory for output files. | |
| io::OutGeometryData | out_geom |
| visualization stuff | |
| io::OutRuntimeData | timings |
| runtime statistics | |
| io::OutStatsData | stats |
| Other statistics. | |
| double | starting_min_edge_length = -1 |
| double | starting_max_edge_length = -1 |
| double | min_boundary_edge_length = -1 |
| std::function< void(int, int, double, double)> | time_callback = nullptr |
| bool | optimization_enabled = false |
| assembler::MacroStrainValue | macro_strain_constraint |
Private Member Functions | |
| void | init_logger (const std::vector< spdlog::sink_ptr > &sinks, const spdlog::level::level_enum log_level) |
| initializing the logger meant for internal usage | |
| void | sol_to_pressure (Eigen::MatrixXd &sol, Eigen::MatrixXd &pressure) |
| splits the solution in solution and pressure for mixed problems | |
| void | build_polygonal_basis () |
| builds bases for polygons, called inside build_basis | |
| void | build_node_mapping () |
| build the mapping from input nodes to polyfem nodes | |
Private Attributes | |
| spdlog::sink_ptr | console_sink_ = nullptr |
| logger sink to stdout | |
| spdlog::sink_ptr | file_sink_ = nullptr |
| bool | has_constraints_ |
main class that contains the polyfem solver and all its state
|
default |
| polyfem::State::State | ( | ) |
Constructor.
Definition at line 56 of file StateInit.cpp.
References polyfem::problem::ProblemFactory::factory(), polyfem::problem::ProblemFactory::get_problem(), polyfem::utils::GeogramUtils::initialize(), polyfem::utils::GeogramUtils::instance(), and problem.
| void polyfem::State::assemble_mass_mat | ( | ) |
assemble mass, step 4 of solve build mass matrix based on defined basis modifies mass (and maybe more?)
Definition at line 1461 of file State.cpp.
References args, assembler, polyfem::io::OutRuntimeData::assembling_mass_mat_time, polyfem::io::OutRuntimeData::assembling_stiffness_mat_time, avg_mass, bases, geom_bases(), polyfem::logger(), polyfem::utils::lump_matrix(), mass, mass_ass_vals_cache, mass_matrix_assembler, polyfem::io::OutStatsData::mat_size, mesh, mixed_assembler, n_bases, polyfem::io::OutStatsData::nn_zero, polyfem::io::OutStatsData::num_dofs, problem, stats, and timings.
Referenced by forward_simulation(), remesh(), and polyfem::solver::AdjointOptUtils::solve_pde().
| void polyfem::State::assemble_rhs | ( | ) |
compute rhs, step 3 of solve build rhs vector based on defined basis and given rhs of the problem modifies rhs (and maybe more?)
Definition at line 1585 of file State.cpp.
References assembler, polyfem::io::OutRuntimeData::assigning_rhs_time, build_rhs_assembler(), local_neumann_boundary, polyfem::logger(), mass_matrix_assembler, mesh, mixed_assembler, n_bases, n_boundary_samples(), n_pressure_bases, pressure_ass_vals_cache, pressure_bases, problem, rhs, polyfem::solver::SolveData::rhs_assembler, root_path(), solve_data, timings, and use_avg_pressure.
Referenced by forward_simulation(), remesh(), and polyfem::solver::AdjointOptUtils::solve_pde().
| std::unordered_map< int, std::array< bool, 3 > > polyfem::State::boundary_conditions_ids | ( | const std::string & | bc_type | ) | const |
Construct a vector of boundary conditions ids with their dimension flags.
Definition at line 182 of file StateLoad.cpp.
References args, polyfem::utils::json_as_array(), and mesh.
| void polyfem::State::build_basis | ( | ) |
builds the bases step 2 of solve modifies bases, pressure_bases, geom_bases_, boundary_nodes, dirichlet_nodes, neumann_nodes, local_boundary, total_local_boundary local_neumann_boundary, polys, poly_edge_to_data, rhs
Definition at line 507 of file State.cpp.
References args, ass_vals_cache, assembler, bases, boundary_nodes, polyfem::basis::LagrangeBasis2d::build_bases(), polyfem::basis::SplineBasis2d::build_bases(), polyfem::basis::LagrangeBasis3d::build_bases(), polyfem::basis::SplineBasis3d::build_bases(), build_collision_mesh(), polyfem::io::OutGeometryData::build_grid(), build_node_mapping(), build_periodic_collision_mesh(), build_polygonal_basis(), polyfem::io::OutRuntimeData::building_basis_time, collision_mesh, polyfem::io::OutStatsData::compute_mesh_size(), polyfem::Units::convert(), polyfem::io::OutStatsData::count_flipped_elements(), dirichlet_nodes, dirichlet_nodes_position, disc_orders, disc_ordersq, geom_bases(), geom_bases_, geom_mesh_nodes, has_dhat, has_periodic_bc(), in_node_to_node, polyfem::assembler::AssemblyValsCache::init(), polyfem::assembler::MacroStrainValue::init(), polyfem::assembler::AssemblyValsCache::init_empty(), is_contact_enabled(), iso_parametric(), polyfem::Units::length(), local_boundary, local_neumann_boundary, local_pressure_boundary, local_pressure_cavity, polyfem::log_and_throw_error(), polyfem::logger(), macro_strain_constraint, mass_ass_vals_cache, mesh, mesh_nodes, polyfem::io::OutStatsData::mesh_size, min_boundary_edge_length, polyfem::io::OutStatsData::min_edge_length, mixed_assembler, n_bases, polyfem::io::OutStatsData::n_flipped, n_geom_bases, n_pressure_bases, polyfem::mesh::Obstacle::n_vertices(), neumann_nodes, neumann_nodes_position, obstacle, out_geom, polyfem::refinement::APriori::p_refine(), periodic_bc, poly_edge_to_data, polys, pressure_ass_vals_cache, pressure_bases, pressure_boundary_nodes, pressure_mesh_nodes, problem, polyfem::io::read_matrix(), polyfem::io::OutStatsData::reset(), polyfem::utils::resolve_path(), rhs, root_path(), starting_max_edge_length, starting_min_edge_length, stats, timings, total_local_boundary, units, use_avg_pressure, and polyfem::Units::velocity().
Referenced by forward_simulation(), and remesh().
| void polyfem::State::build_collision_mesh | ( | ) |
extracts the boundary mesh for collision, called in build_basis
Definition at line 1326 of file State.cpp.
References args, bases, build_collision_mesh(), collision_mesh, geom_bases(), in_node_to_node, mesh, n_bases, obstacle, resolve_input_path(), and total_local_boundary.
Referenced by build_basis(), build_collision_mesh(), polyfem::solver::CollisionBarrierForm::CollisionBarrierForm(), and polyfem::solver::DeformedCollisionBarrierForm::DeformedCollisionBarrierForm().
|
static |
extracts the boundary mesh for collision, called in build_basis
Definition at line 1334 of file State.cpp.
References polyfem::utils::append_rows(), args, bases, polyfem::mesh::build_collision_proxy(), polyfem::mesh::Obstacle::codim_v(), collision_mesh, polyfem::mesh::Obstacle::e(), polyfem::io::OutGeometryData::extract_boundary_mesh(), polyfem::mesh::Obstacle::f(), geom_bases(), in_node_to_node, polyfem::utils::json_as_array(), polyfem::mesh::load_collision_proxy(), polyfem::logger(), mesh, n_bases, polyfem::mesh::Obstacle::n_vertices(), obstacle, polyfem::utils::resolve_path(), root_path(), total_local_boundary, and polyfem::mesh::Obstacle::v().
| void polyfem::State::build_mesh_matrices | ( | Eigen::MatrixXd & | V, |
| Eigen::MatrixXi & | F | ||
| ) |
Build the mesh matrices (vertices and elements) from the mesh using the bases node ordering.
Definition at line 158 of file StateLoad.cpp.
References polyfem::basis::ElementBases::bases, bases, polyfem::F, polyfem::basis::Basis::global(), mesh, n_bases, polyfem::mesh::Obstacle::n_vertices(), obstacle, and V.
Referenced by remesh(), and solve_transient_tensor_nonlinear().
|
private |
build the mapping from input nodes to polyfem nodes
Definition at line 249 of file State.cpp.
References args, disc_orders, in_node_to_node, in_primitive_to_primitive, polyfem::logger(), mesh, and mesh_nodes.
Referenced by build_basis().
| void polyfem::State::build_periodic_collision_mesh | ( | ) |
Definition at line 1192 of file State.cpp.
References args, bases, collision_mesh, polyfem::log_and_throw_error(), mesh, n_bases, periodic_bc, periodic_collision_mesh, periodic_collision_mesh_to_basis, and V.
Referenced by build_basis().
|
private |
builds bases for polygons, called inside build_basis
Definition at line 1029 of file State.cpp.
References args, assembler, bases, polyfem::basis::PolygonalBasis2d::build_bases(), polyfem::basis::PolygonalBasis3d::build_bases(), polyfem::basis::MVPolygonalBasis2d::build_bases(), polyfem::basis::WSPolygonalBasis2d::build_bases(), polyfem::io::OutRuntimeData::computing_poly_basis_time, geom_bases_, iso_parametric(), local_boundary, polyfem::logger(), mesh, n_bases, n_pressure_bases, poly_edge_to_data, polys, polys_3d, rhs, and timings.
Referenced by build_basis().
|
inline |
Definition at line 290 of file State.hpp.
References bases, build_pressure_assembler(), and n_bases.
Referenced by build_pressure_assembler(), and init_nonlinear_tensor_solve().
| std::shared_ptr< PressureAssembler > polyfem::State::build_pressure_assembler | ( | const int | n_bases_, |
| const std::vector< basis::ElementBases > & | bases_ | ||
| ) | const |
Definition at line 1570 of file State.cpp.
References assembler, boundary_nodes, geom_bases(), local_pressure_boundary, local_pressure_cavity, mesh, node_to_primitive(), obstacle, primitive_to_node(), and problem.
|
inline |
build a RhsAssembler for the problem
Definition at line 282 of file State.hpp.
References bases, build_rhs_assembler(), mass_ass_vals_cache, and n_bases.
Referenced by assemble_rhs(), build_rhs_assembler(), init_solve(), and remesh().
| std::shared_ptr< RhsAssembler > polyfem::State::build_rhs_assembler | ( | const int | n_bases, |
| const std::vector< basis::ElementBases > & | bases, | ||
| const assembler::AssemblyValsCache & | ass_vals_cache | ||
| ) | const |
build a RhsAssembler for the problem
Definition at line 1549 of file State.cpp.
References args, assembler, dirichlet_nodes, dirichlet_nodes_position, geom_bases(), mesh, neumann_nodes, neumann_nodes_position, obstacle, and problem.
| void polyfem::State::build_stiffness_mat | ( | StiffnessMatrix & | stiffness | ) |
utility that builds the stiffness matrix and collects stats, used only for linear problems
| [out] | stiffness | matrix |
Definition at line 37 of file StateSolveLinear.cpp.
References args, ass_vals_cache, assembler, polyfem::io::OutRuntimeData::assembling_stiffness_mat_time, bases, geom_bases(), polyfem::logger(), polyfem::io::OutStatsData::mat_size, polyfem::assembler::AssemblerUtils::merge_mixed_matrices(), mesh, mixed_assembler, n_bases, n_pressure_bases, polyfem::io::OutStatsData::nn_zero, polyfem::io::OutStatsData::num_dofs, pressure_ass_vals_cache, pressure_assembler, pressure_bases, problem, stats, timings, and use_avg_pressure.
Referenced by solve_linear(), solve_transient_linear(), and solve_transient_navier_stokes_split().
| void polyfem::State::compute_errors | ( | const Eigen::MatrixXd & | sol | ) |
computes all errors
Definition at line 12 of file StateOutput.cpp.
References args, bases, polyfem::io::OutStatsData::compute_errors(), geom_bases(), mesh, n_bases, problem, and stats.
Referenced by forward_simulation().
| void polyfem::State::export_data | ( | const Eigen::MatrixXd & | sol, |
| const Eigen::MatrixXd & | pressure | ||
| ) |
saves all data on the disk according to the input params
| [in] | sol | solution |
| [in] | pressure | pressure |
Definition at line 131 of file StateOutput.cpp.
References args, ass_vals_cache, assembler, bases, polyfem::io::OutGeometryData::export_data(), geom_bases(), is_contact_enabled(), polyfem::logger(), mesh, n_bases, out_geom, problem, and resolve_output_path().
Referenced by forward_simulation().
| std::string polyfem::State::formulation | ( | ) | const |
return the formulation (checks if the problem is scalar or not and deals with multiphysics)
Definition at line 332 of file State.cpp.
References args, polyfem::assembler::AssemblerUtils::is_elastic_material(), and polyfem::logger().
Referenced by init(), polyfem::mesh::LocalRelaxationData< M >::init_assembler(), polyfem::mesh::LocalRelaxationData< M >::init_bases(), and polyfem::mesh::Remesher::project_quantities().
|
inline |
Get a constant reference to the geometry mapping bases.
Definition at line 257 of file State.hpp.
References bases, geom_bases_, and iso_parametric().
Referenced by assemble_mass_mat(), polyfem::solver::BoundedBiharmonicWeights2Dto3D::BoundedBiharmonicWeights2Dto3D(), build_basis(), build_collision_mesh(), build_collision_mesh(), build_pressure_assembler(), build_rhs_assembler(), build_stiffness_mat(), polyfem::OptState::check_unsupported(), compute_errors(), polyfem::solver::AdjointTools::compute_shape_derivative_functional_term(), polyfem::compute_surface_node_ids(), polyfem::compute_total_surface_node_ids(), polyfem::compute_volume_node_ids(), polyfem::solver::AdjointTools::dJ_du_step(), polyfem::solver::AdjointTools::dJ_shape_transient_adjoint_term(), export_data(), polyfem::io::OutGeometryData::export_data(), get_elements(), init_homogenization_solve(), init_linear_solve(), init_nonlinear_tensor_solve(), polyfem::solver::AdjointTools::integrate_objective(), polyfem::io::OutGeometryData::save_surface(), polyfem::io::OutGeometryData::save_volume(), polyfem::io::OutGeometryData::save_wire(), solve_homogenization_step(), solve_linear(), solve_navier_stokes(), solve_tensor_nonlinear(), solve_transient_navier_stokes(), solve_transient_navier_stokes_split(), polyfem::solver::VariableToBoundaryNodes::VariableToBoundaryNodes(), and polyfem::solver::VariableToBoundaryNodesExclusive::VariableToBoundaryNodesExclusive().
|
inline |
Gather geometry elements into a dense matrix.
Definition at line 641 of file State.hpp.
References geom_bases(), mesh, and node_to_primitive().
|
inline |
gets the output log as json this is not what gets printed but more informative information, e.g., it contains runtimes, errors, etc.
Definition at line 164 of file State.hpp.
References save_json().
|
inline |
Gather geometry vertices into a dense matrix.
Definition at line 632 of file State.hpp.
References mesh.
Referenced by polyfem::solver::BoundedBiharmonicWeights2Dto3D::BoundedBiharmonicWeights2Dto3D().
|
inline |
Definition at line 525 of file State.hpp.
References has_constraints_.
Referenced by is_problem_linear().
|
inline |
Definition at line 500 of file State.hpp.
References args.
Referenced by build_basis(), iso_parametric(), and solve_linear().
| void polyfem::State::init | ( | const json & | args, |
| const bool | strict_validation | ||
| ) |
initialize the polyfem solver with a json settings
| [in] | args | input arguments |
| [in] | strict_validation | strict validation of input |
Definition at line 133 of file StateInit.cpp.
References polyfem::utils::apply_common_params(), args, assembler, polyfem::problem::ProblemFactory::factory(), formulation(), polyfem::problem::ProblemFactory::get_problem(), has_constraints_, has_dhat, polyfem::Units::init(), init_logger(), init_time(), is_contact_enabled(), polyfem::logger(), polyfem::assembler::AssemblerUtils::make_assembler(), polyfem::assembler::AssemblerUtils::make_mixed_assembler(), mass_matrix_assembler, mixed_assembler, polyfem::assembler::AssemblerUtils::other_assembler_name(), output_dir, pressure_assembler, problem, resolve_input_path(), resolve_output_path(), root_path(), set_max_threads(), and units.
Referenced by forward_simulation().
| void polyfem::State::init_homogenization_solve | ( | const double | t | ) |
Definition at line 40 of file StateHomogenization.cpp.
References polyfem::solver::SolveData::al_form, args, ass_vals_cache, assembler, avg_mass, bases, boundary_nodes, collision_mesh, elasticity_pressure_assembler, geom_bases(), polyfem::assembler::MacroStrainValue::get_fixed_entry(), in_node_to_node, polyfem::solver::SolveData::init_forms(), local_boundary, local_neumann_boundary, local_pressure_boundary, local_pressure_cavity, polyfem::logger(), macro_strain_constraint, mass, mass_ass_vals_cache, mass_matrix_assembler, mesh, n_bases, n_boundary_samples(), n_pressure_bases, polyfem::solver::SolveData::named_forms(), polyfem::mesh::Obstacle::ndof(), ndof(), polyfem::solver::SolveData::nl_problem, obstacle, optimization_enabled, periodic_bc, periodic_collision_mesh, periodic_collision_mesh_to_basis, polyfem::solver::SolveData::periodic_contact_form, rhs, solve_data, polyfem::solver::SolveData::strain_al_lagr_form, and units.
Referenced by solve_homogenization().
| void polyfem::State::init_linear_solve | ( | Eigen::MatrixXd & | sol, |
| const double | t = 1.0, |
||
| const InitialConditionOverride * | ic_override = nullptr |
||
| ) |
initialize the linear solve
| [in] | t | (optional) initial time |
| [in] | ic_override | Optional initial condition override (highest priority). Empty by default. |
Definition at line 177 of file StateSolveLinear.cpp.
References args, ass_vals_cache, assembler, bases, polyfem::solver::SolveData::body_form, boundary_nodes, polyfem::time_integrator::ImplicitTimeIntegrator::construct_time_integrator(), polyfem::solver::SolveData::contact_form, polyfem::solver::SolveData::damping_form, polyfem::solver::SolveData::elastic_form, polyfem::solver::SolveData::friction_form, geom_bases(), polyfem::solver::SolveData::inertia_form, initial_acceleration(), initial_solution(), initial_velocity(), is_contact_enabled(), local_boundary, local_neumann_boundary, polyfem::log_and_throw_error(), mass, mass_matrix_assembler, mesh, mixed_assembler, n_bases, n_boundary_samples(), n_pressure_bases, ndof(), POLYFEM_SCOPED_TIMER, problem, rhs, polyfem::solver::SolveData::rhs_assembler, solve_data, polyfem::solver::SolveData::time_integrator, and polyfem::solver::SolveData::update_dt().
Referenced by solve_problem().
| void polyfem::State::init_logger | ( | const std::string & | log_file, |
| const spdlog::level::level_enum | log_level, | ||
| const spdlog::level::level_enum | file_log_level, | ||
| const bool | is_quiet | ||
| ) |
initializing the logger
| [in] | log_file | is to write it to a file (use log_file="") to output to stdout |
| [in] | log_level | 0 all message, 6 no message. 2 is info, 1 is debug |
| [in] | file_log_level | 0 all message, 6 no message. 2 is info, 1 is debug |
| [in] | is_quit | quiets the log |
Definition at line 65 of file StateInit.cpp.
References console_sink_, file_sink_, and init_logger().
Referenced by init(), init_logger(), and init_logger().
|
private |
initializing the logger meant for internal usage
Definition at line 98 of file StateInit.cpp.
References polyfem::utils::GeogramUtils::instance(), polyfem::logger(), set_log_level(), polyfem::utils::GeogramUtils::set_logger(), and polyfem::set_logger().
| void polyfem::State::init_logger | ( | std::ostream & | os, |
| const spdlog::level::level_enum | log_level | ||
| ) |
initializing the logger writes to an output stream
| [in] | os | output stream |
| [in] | log_level | 0 all message, 6 no message. 2 is info, 1 is debug |
Definition at line 91 of file StateInit.cpp.
References init_logger().
| void polyfem::State::init_nonlinear_tensor_solve | ( | Eigen::MatrixXd & | sol, |
| const double | t = 1.0, |
||
| const bool | init_time_integrator = true, |
||
| const InitialConditionOverride * | ic_override = nullptr |
||
| ) |
initialize the nonlinear solver
| [out] | sol | solution |
| [in] | t | (optional) initial time |
| [in] | ic_override | Optional initial condition override (highest priority). Empty by default. |
Definition at line 172 of file StateSolveNonlinear.cpp.
References polyfem::solver::SolveData::al_form, args, ass_vals_cache, assembler, avg_mass, bases, boundary_nodes, build_pressure_assembler(), collision_mesh, polyfem::time_integrator::ImplicitTimeIntegrator::construct_time_integrator(), polyfem::solver::SolveData::contact_form, damping_assembler, damping_prev_assembler, elasticity_pressure_assembler, geom_bases(), in_node_to_node, polyfem::solver::SolveData::init_forms(), initial_acceleration(), initial_solution(), initial_velocity(), is_contact_enabled(), is_problem_linear(), local_boundary, local_neumann_boundary, local_pressure_boundary, local_pressure_cavity, polyfem::log_and_throw_error(), polyfem::logger(), macro_strain_constraint, mass, mass_ass_vals_cache, mass_matrix_assembler, mesh, mixed_assembler, n_bases, n_boundary_samples(), n_pressure_bases, polyfem::mesh::Obstacle::ndof(), ndof(), polyfem::solver::SolveData::nl_problem, obstacle, optimization_enabled, output_dir, periodic_bc, periodic_collision_mesh, periodic_collision_mesh_to_basis, POLYFEM_SCOPED_TIMER, problem, resolve_output_path(), rhs, set_materials(), solve_data, polyfem::io::OutStatsData::solver_info, stats, polyfem::solver::SolveData::time_integrator, polyfem::utils::unflatten(), units, and polyfem::io::OBJWriter::write().
Referenced by remesh(), solve_problem(), and solve_transient_tensor_nonlinear().
| void polyfem::State::init_solve | ( | Eigen::MatrixXd & | sol, |
| Eigen::MatrixXd & | pressure, | ||
| const InitialConditionOverride * | ic_override = nullptr |
||
| ) |
initialize solver
| [out] | sol | solution |
| [out] | pressure | pressure |
| [in] | ic_override | Optional initial condition override (highest priority). Empty by default. |
Definition at line 55 of file StateSolve.cpp.
References build_rhs_assembler(), initial_solution(), mesh, mixed_assembler, n_bases, n_pressure_bases, POLYFEM_SCOPED_TIMER, problem, rhs, polyfem::solver::SolveData::rhs_assembler, save_timestep(), sol_to_pressure(), and solve_data.
Referenced by solve_problem().
| void polyfem::State::init_time | ( | ) |
initialize time settings if args contains "time"
Definition at line 333 of file StateInit.cpp.
References args, polyfem::Units::characteristic_length(), polyfem::Units::convert(), polyfem::utils::is_param_valid(), polyfem::log_and_throw_error(), polyfem::logger(), polyfem::Units::time(), and units.
Referenced by init().
| void polyfem::State::initial_acceleration | ( | Eigen::MatrixXd & | acceleration, |
| const InitialConditionOverride * | ic_override = nullptr |
||
| ) | const |
Load or compute the initial acceleration.
| [out] | acceleration | Output acceleration variable. |
| [in] | ic_override | Optional initial condition override (highest priority). Empty by default. |
Definition at line 146 of file StateSolve.cpp.
References polyfem::InitialConditionOverride::acceleration, args, in_node_to_node, polyfem::log_and_throw_adjoint_error(), polyfem::logger(), mesh, ndof(), resolve_input_path(), polyfem::solver::SolveData::rhs_assembler, and solve_data.
Referenced by polyfem::solver::AdjointTools::dJ_friction_transient_adjoint_term(), init_linear_solve(), init_nonlinear_tensor_solve(), and solve_transient_linear().
| void polyfem::State::initial_solution | ( | Eigen::MatrixXd & | solution, |
| const InitialConditionOverride * | ic_override = nullptr |
||
| ) | const |
Load or compute the initial solution.
| [out] | solution | Output solution variable. |
| [in] | ic_override | Optional initial condition override (highest priority). Empty by default. |
Definition at line 82 of file StateSolve.cpp.
References args, in_node_to_node, polyfem::log_and_throw_adjoint_error(), polyfem::logger(), mesh, ndof(), problem, resolve_input_path(), rhs, polyfem::solver::SolveData::rhs_assembler, polyfem::InitialConditionOverride::solution, and solve_data.
Referenced by init_linear_solve(), init_nonlinear_tensor_solve(), init_solve(), and solve_transient_linear().
| void polyfem::State::initial_velocity | ( | Eigen::MatrixXd & | velocity, |
| const InitialConditionOverride * | ic_override = nullptr |
||
| ) | const |
Load or compute the initial velocity.
| [out] | velocity | Output velocity variable. |
| [in] | ic_override | Optional initial condition override (highest priority). Empty by default. |
Definition at line 118 of file StateSolve.cpp.
References args, in_node_to_node, polyfem::log_and_throw_adjoint_error(), polyfem::logger(), mesh, ndof(), resolve_input_path(), polyfem::solver::SolveData::rhs_assembler, solve_data, and polyfem::InitialConditionOverride::velocity.
Referenced by polyfem::solver::AdjointTools::dJ_friction_transient_adjoint_term(), init_linear_solve(), init_nonlinear_tensor_solve(), and solve_transient_linear().
|
inline |
does the simulation have adhesion
Definition at line 707 of file State.hpp.
References args.
Referenced by polyfem::solver::AdjointTools::dJ_shape_homogenization_adjoint_term(), polyfem::solver::AdjointTools::dJ_shape_static_adjoint_term(), and polyfem::solver::AdjointTools::dJ_shape_transient_adjoint_term().
|
inline |
does the simulation have contact
Definition at line 699 of file State.hpp.
References args.
Referenced by build_basis(), polyfem::OptState::check_unsupported(), polyfem::solver::AdjointTools::dJ_shape_static_adjoint_term(), polyfem::solver::AdjointTools::dJ_shape_transient_adjoint_term(), export_data(), init(), init_linear_solve(), init_nonlinear_tensor_solve(), is_problem_linear(), save_subsolve(), save_timestep(), solve_linear(), solve_linear(), and solve_transient_linear().
|
inline |
Definition at line 811 of file State.hpp.
References args.
Referenced by polyfem::solver::AdjointForm::compute_reduced_adjoint_rhs(), and solve_problem().
|
inline |
checks if vertex is obstacle
| [in] | vi | vertex index |
Definition at line 690 of file State.hpp.
References collision_mesh, polyfem::mesh::Obstacle::n_vertices(), and obstacle.
|
inline |
does the simulation has pressure
Definition at line 715 of file State.hpp.
References args.
Referenced by is_problem_linear().
|
inline |
Returns whether the system is linear. Collisions and pressure add nonlinearity to the problem.
Definition at line 523 of file State.hpp.
References assembler, has_constraints(), is_contact_enabled(), and is_pressure_enabled().
Referenced by polyfem::OptState::check_unsupported(), init_nonlinear_tensor_solve(), and solve_problem().
| bool polyfem::State::iso_parametric | ( | ) | const |
check if using iso parametric bases
Definition at line 466 of file State.cpp.
References args, has_periodic_bc(), and mesh.
Referenced by build_basis(), build_polygonal_basis(), geom_bases(), primitive_to_node(), and save_json().
| void polyfem::State::load_mesh | ( | bool | non_conforming = false, |
| const std::vector< std::string > & | names = std::vector<std::string>(), |
||
| const std::vector< Eigen::MatrixXi > & | cells = std::vector<Eigen::MatrixXi>(), |
||
| const std::vector< Eigen::MatrixXd > & | vertices = std::vector<Eigen::MatrixXd>() |
||
| ) |
loads the mesh from the json arguments
| [in] | non_conforming | creates a conforming/non conforming mesh |
| [in] | names | keys in the hdf5 |
| [in] | cells | list of cells from hdf5 |
| [in] | vertices | list of vertices from hdf5 |
Definition at line 91 of file StateLoad.cpp.
References args, assembler, polyfem::io::OutGeometryData::init_sampler(), polyfem::utils::is_param_valid(), polyfem::utils::json_as_array(), polyfem::log_and_throw_error(), polyfem::logger(), mass_matrix_assembler, mesh, mixed_assembler, obstacle, out_geom, pressure_assembler, polyfem::mesh::read_fem_geometry(), polyfem::mesh::read_obstacle_geometry(), reset_mesh(), set_materials(), and units.
Referenced by forward_simulation(), load_mesh(), and remesh().
|
inline |
loads the mesh from V and F,
| [in] | V | is #vertices x dim |
| [in] | F | is #elements x size (size = 3 for triangle mesh, size=4 for a quad mesh if dim is 2) |
| [in] | non_conforming | creates a conforming/non conforming mesh |
Definition at line 612 of file State.hpp.
References polyfem::mesh::Mesh::create(), polyfem::F, load_mesh(), mesh, and V.
| void polyfem::State::load_mesh | ( | GEO::Mesh & | meshin, |
| const std::function< int(const size_t, const std::vector< int > &, const RowVectorNd &, bool)> & | boundary_marker, | ||
| bool | non_conforming = false, |
||
| bool | skip_boundary_sideset = false |
||
| ) |
loads the mesh from a geogram mesh
| [in] | meshin | geo mesh |
| [in] | boundary_marker | the input of the lambda is the face barycenter, the output is the sideset id |
| [in] | non_conforming | creates a conforming/non conforming mesh |
| [in] | skip_boundary_sideset | skip_boundary_sideset = false it uses the lambda boundary_marker to assign the sideset |
Definition at line 41 of file StateLoad.cpp.
References args, assembler, polyfem::mesh::Mesh::create(), polyfem::io::OutGeometryData::init_sampler(), polyfem::utils::json_as_array(), polyfem::logger(), mass_matrix_assembler, mesh, mixed_assembler, obstacle, out_geom, pressure_assembler, polyfem::mesh::read_obstacle_geometry(), reset_mesh(), set_materials(), and units.
| std::shared_ptr< polysolve::nonlinear::Solver > polyfem::State::make_nl_solver | ( | bool | for_al | ) | const |
factory to create the nl solver depending on input
Definition at line 47 of file StateSolveNonlinear.cpp.
References args, polyfem::Units::characteristic_length(), polyfem::logger(), and units.
Referenced by polyfem::mesh::Remesher::project_quantities(), solve_homogenization_step(), and solve_tensor_nonlinear().
|
inline |
quadrature used for projecting boundary conditions
Definition at line 297 of file State.hpp.
References args, disc_orders, mesh, and polyfem::assembler::AssemblerUtils::quadrature_order().
Referenced by assemble_rhs(), init_homogenization_solve(), init_linear_solve(), init_nonlinear_tensor_solve(), polyfem::mesh::LocalRelaxationData< M >::init_solve_data(), solve_linear(), solve_navier_stokes(), solve_transient_linear(), solve_transient_navier_stokes(), and solve_transient_navier_stokes_split().
|
inline |
Definition at line 309 of file State.hpp.
References mesh, mixed_assembler, n_bases, n_pressure_bases, and problem.
Referenced by polyfem::solver::AdjointForm::compute_adjoint_rhs(), polyfem::solver::StaticForm::compute_adjoint_rhs(), polyfem::solver::MinTargetDistForm::compute_adjoint_rhs(), polyfem::solver::TransientForm::compute_adjoint_rhs(), polyfem::solver::ProxyTransientForm::compute_adjoint_rhs(), polyfem::solver::SpatialIntegralForm::compute_adjoint_rhs_step(), polyfem::solver::BarycenterTargetForm::compute_adjoint_rhs_step(), polyfem::solver::StaticForm::compute_adjoint_rhs_step_prev(), polyfem::solver::AdjointTools::dJ_dirichlet_static_adjoint_term(), polyfem::solver::AdjointTools::dJ_initial_condition_adjoint_term(), init_homogenization_solve(), init_linear_solve(), init_nonlinear_tensor_solve(), initial_acceleration(), initial_solution(), initial_velocity(), remesh(), and solve_homogenization_step().
| std::vector< int > polyfem::State::node_to_primitive | ( | ) | const |
Definition at line 239 of file State.cpp.
References n_geom_bases, and primitive_to_node().
Referenced by polyfem::solver::BoundedBiharmonicWeights2Dto3D::BoundedBiharmonicWeights2Dto3D(), build_pressure_assembler(), get_elements(), and polyfem::solver::AdjointTools::map_node_to_primitive_order().
| std::vector< int > polyfem::State::primitive_to_node | ( | ) | const |
Definition at line 232 of file State.cpp.
References geom_mesh_nodes, iso_parametric(), mesh, and mesh_nodes.
Referenced by build_pressure_assembler(), polyfem::solver::AdjointTools::dJ_dirichlet_static_adjoint_term(), polyfem::solver::AdjointTools::dJ_periodic_shape_adjoint_term(), polyfem::solver::AdjointTools::dJ_shape_homogenization_adjoint_term(), polyfem::solver::AdjointTools::dJ_shape_static_adjoint_term(), polyfem::solver::AdjointTools::dJ_shape_transient_adjoint_term(), polyfem::solver::PeriodicContactForceDerivative::force_shape_derivative(), polyfem::solver::AdjointTools::map_primitive_to_node_order(), and node_to_primitive().
| bool polyfem::State::remesh | ( | const double | time, |
| const double | dt, | ||
| Eigen::MatrixXd & | sol | ||
| ) |
Remesh the FE space and update solution(s).
| time | Current time. |
| dt | Time step size. |
| sol | Current solution. |
Definition at line 159 of file StateRemesh.cpp.
References assemble_mass_mat(), assemble_rhs(), build_basis(), build_mesh_matrices(), build_rhs_assembler(), polyfem::mesh::Remesher::combine_time_integrator_quantities(), polyfem::mesh::Mesh::create(), polyfem::utils::flatten(), in_node_to_node, init_nonlinear_tensor_solve(), load_mesh(), mesh, n_bases, polyfem::mesh::Obstacle::n_vertices(), ndof(), polyfem::solver::SolveData::nl_problem, obstacle, problem, polyfem::utils::reorder_matrix(), polyfem::solver::SolveData::rhs_assembler, solve_data, polyfem::mesh::Remesher::split_time_integrator_quantities(), polyfem::solver::SolveData::time_integrator, and polyfem::utils::unflatten().
Referenced by solve_transient_tensor_nonlinear().
| void polyfem::State::reset_mesh | ( | ) |
Resets the mesh.
Definition at line 22 of file StateLoad.cpp.
References bases, boundary_nodes, polyfem::mesh::Obstacle::clear(), geom_bases_, local_boundary, local_neumann_boundary, mass, n_bases, n_pressure_bases, obstacle, poly_edge_to_data, polys, pressure_bases, and rhs.
Referenced by load_mesh(), and load_mesh().
| std::string polyfem::State::resolve_input_path | ( | const std::string & | path, |
| const bool | only_if_exists = false |
||
| ) | const |
Resolve input path relative to root_path() if the path is not absolute.
| [in] | path | path to resolve |
| [in] | only_if_exists | resolve only if relative path exists |
Definition at line 34 of file StateOutput.cpp.
References polyfem::utils::resolve_path(), and root_path().
Referenced by build_collision_mesh(), init(), initial_acceleration(), initial_solution(), initial_velocity(), and polyfem::solver::VariableToSimulation::set_output_indexing().
| std::string polyfem::State::resolve_output_path | ( | const std::string & | path | ) | const |
Resolve output path relative to output_dir if the path is not absolute.
| [in] | path | path to resolve |
Definition at line 39 of file StateOutput.cpp.
References output_dir.
Referenced by export_data(), init(), init_nonlinear_tensor_solve(), save_json(), save_restart_json(), save_subsolve(), save_timestep(), solve_problem(), solve_transient_linear(), and solve_transient_tensor_nonlinear().
| std::string polyfem::State::root_path | ( | ) | const |
Get the root path for the state (e.g., args["root_path"] or ".")
Definition at line 27 of file StateOutput.cpp.
References args, and polyfem::utils::is_param_valid().
Referenced by assemble_rhs(), build_basis(), build_collision_mesh(), init(), resolve_input_path(), and save_restart_json().
| void polyfem::State::save_json | ( | const Eigen::MatrixXd & | sol | ) |
saves the output statistic to disc according to params
| [in] | sol | solution |
Definition at line 72 of file StateOutput.cpp.
References args, polyfem::logger(), resolve_output_path(), and save_json().
| void polyfem::State::save_json | ( | const Eigen::MatrixXd & | sol, |
| std::ostream & | out | ||
| ) |
saves the output statistic to a stream
| [in] | sol | solution |
| [out] | out | stream to write output |
Definition at line 88 of file StateOutput.cpp.
References args, assembler, disc_orders, disc_ordersq, iso_parametric(), polyfem::logger(), mesh, n_bases, n_pressure_bases, problem, polyfem::io::OutStatsData::save_json(), stats, and timings.
Referenced by forward_simulation(), get_log(), and save_json().
| void polyfem::State::save_restart_json | ( | const double | t0, |
| const double | dt, | ||
| const int | t | ||
| ) | const |
Save a JSON sim file for restarting the simulation at time t.
| t | current time to restart at |
Definition at line 191 of file StateOutput.cpp.
References args, resolve_output_path(), root_path(), and starting_min_edge_length.
Referenced by solve_homogenization(), and solve_transient_tensor_nonlinear().
| void polyfem::State::save_subsolve | ( | const int | i, |
| const int | t, | ||
| const Eigen::MatrixXd & | sol, | ||
| const Eigen::MatrixXd & | pressure | ||
| ) |
saves a subsolve when save_solve_sequence_debug is true
| [in] | i | sub solve index |
| [in] | t | time index |
| [in] | sol | solution |
| [in] | pressure | pressure |
Definition at line 112 of file StateOutput.cpp.
References args, is_contact_enabled(), mesh, out_geom, problem, resolve_output_path(), and polyfem::io::OutGeometryData::save_vtu().
Referenced by solve_tensor_nonlinear().
| void polyfem::State::save_timestep | ( | const double | time, |
| const int | t, | ||
| const double | t0, | ||
| const double | dt, | ||
| const Eigen::MatrixXd & | sol, | ||
| const Eigen::MatrixXd & | pressure | ||
| ) |
saves a timestep
| [in] | time | time in secs |
| [in] | t | time index |
| [in] | t0 | initial time |
| [in] | dt | delta t |
| [in] | sol | solution |
| [in] | pressure | pressure |
Definition at line 48 of file StateOutput.cpp.
References args, is_contact_enabled(), polyfem::logger(), mesh, out_geom, POLYFEM_SCOPED_TIMER, problem, resolve_output_path(), polyfem::io::OutGeometryData::save_pvd(), and polyfem::io::OutGeometryData::save_vtu().
Referenced by init_solve(), solve_homogenization(), solve_transient_linear(), solve_transient_navier_stokes(), solve_transient_navier_stokes_split(), and solve_transient_tensor_nonlinear().
| void polyfem::State::set_log_level | ( | const spdlog::level::level_enum | log_level | ) |
change log level
| [in] | log_level | 0 all message, 6 no message. 2 is info, 1 is debug |
Definition at line 117 of file StateInit.cpp.
References console_sink_, and polyfem::logger().
Referenced by init_logger().
| void polyfem::State::set_materials | ( | assembler::Assembler & | assembler | ) | const |
utility to set the material and the problem dimension to only 1 assembler
| [in/out] | assembler to set |
Definition at line 434 of file StateInit.cpp.
References args, assembler, polyfem::assembler::Assembler::is_fluid(), polyfem::utils::is_param_valid(), polyfem::assembler::Assembler::is_tensor(), mesh, polyfem::assembler::Assembler::set_size(), and units.
| void polyfem::State::set_materials | ( | std::vector< std::shared_ptr< assembler::Assembler > > & | assemblers | ) | const |
set the material and the problem dimension
| [in/out] | list of assembler to set |
Definition at line 417 of file StateInit.cpp.
References args, assembler, polyfem::utils::is_param_valid(), mesh, and units.
Referenced by init_nonlinear_tensor_solve(), load_mesh(), load_mesh(), solve_navier_stokes(), and solve_transient_navier_stokes().
| void polyfem::State::set_max_threads | ( | const int | max_threads = std::numeric_limits<int>::max() | ) |
| [in] | max_threads | max number of threads |
Definition at line 328 of file StateInit.cpp.
References polyfem::utils::NThread::get(), and polyfem::utils::NThread::set_num_threads().
Referenced by init().
|
private |
splits the solution in solution and pressure for mixed problems
| [in/out] | sol solution | |
| [out] | pressure | pressure |
Definition at line 375 of file State.cpp.
References assembler, polyfem::logger(), mesh, mixed_assembler, n_bases, n_pressure_bases, problem, and use_avg_pressure.
Referenced by init_solve(), solve_linear(), solve_navier_stokes(), and solve_transient_navier_stokes().
|
inline |
| void polyfem::State::solve_homogenization | ( | const int | time_steps, |
| const double | t0, | ||
| const double | dt, | ||
| Eigen::MatrixXd & | sol, | ||
| UserPostStepCallback | user_post_step = {} |
||
| ) |
Definition at line 301 of file StateHomogenization.cpp.
References args, polyfem::io::Evaluator::generate_linear_field(), init_homogenization_solve(), polyfem::utils::is_param_valid(), polyfem::log_and_throw_error(), polyfem::logger(), mesh, mesh_nodes, n_bases, polyfem::solver::SolveData::nl_problem, POLYFEM_SCOPED_TIMER, save_restart_json(), save_timestep(), solve_data, solve_homogenization_step(), polyfem::utils::unflatten(), polyfem::solver::SolveData::update_barrier_stiffness(), and polyfem::solver::SolveData::update_dt().
Referenced by solve_problem().
| void polyfem::State::solve_homogenization_step | ( | int | step, |
| Eigen::MatrixXd & | sol, | ||
| bool | adaptive_initial_weight = false, |
||
| UserPostStepCallback | user_post_step = {} |
||
| ) |
In Elasticity PDE, solve for "min W(disp_grad + \grad u)" instead of "min W(\grad u)".
Definition at line 144 of file StateHomogenization.cpp.
References args, bases, polyfem::assembler::MacroStrainValue::eval(), polyfem::utils::flatten(), geom_bases(), polyfem::assembler::MacroStrainValue::get_fixed_entry(), polyfem::io::Evaluator::integrate_function(), polyfem::logger(), macro_strain_constraint, make_nl_solver(), mesh, n_bases, ndof(), polyfem::solver::SolveData::nl_problem, solve_data, polyfem::solver::SolveData::strain_al_lagr_form, polyfem::utils::unflatten(), and x.
Referenced by solve_homogenization().
| void polyfem::State::solve_linear | ( | int | step, |
| const std::unique_ptr< polysolve::linear::Solver > & | solver, | ||
| StiffnessMatrix & | A, | ||
| Eigen::VectorXd & | b, | ||
| const bool | compute_spectrum, | ||
| Eigen::MatrixXd & | sol, | ||
| Eigen::MatrixXd & | pressure, | ||
| UserPostStepCallback | user_post_step = {} |
||
| ) |
Solve the linear problem with the given solver and system.
| [in] | step | current step. |
| solver | Linear solver. | |
| A | Linear system matrix. | |
| b | Right-hand side. | |
| compute_spectrum | If true, compute the spectrum. | |
| [out] | sol | solution |
| [out] | pressure | pressure |
| [in] | user_post_step | optional post step user callback. Empty by default. |
Definition at line 79 of file StateSolveLinear.cpp.
References args, assembler, bases, boundary_nodes, geom_bases(), has_periodic_bc(), polyfem::io::Evaluator::integrate_function(), is_contact_enabled(), polyfem::logger(), mesh, mixed_assembler, n_bases, periodic_bc, problem, polyfem::solver::SolveData::rhs_assembler, sol_to_pressure(), solve_data, polyfem::io::OutStatsData::solver_info, polyfem::io::OutStatsData::spectrum, stats, use_avg_pressure, and x.
| void polyfem::State::solve_linear | ( | int | step, |
| Eigen::MatrixXd & | sol, | ||
| Eigen::MatrixXd & | pressure, | ||
| UserPostStepCallback | user_post_step = {} |
||
| ) |
solves a linear problem
| [in] | step | current step |
| [out] | sol | solution |
| [out] | pressure | pressure |
| [in] | user_post_step | optional post step user callback. Empty by default. |
Definition at line 150 of file StateSolveLinear.cpp.
References args, assembler, boundary_nodes, build_stiffness_mat(), is_contact_enabled(), local_boundary, local_neumann_boundary, polyfem::logger(), n_boundary_samples(), problem, rhs, polyfem::solver::SolveData::rhs_assembler, solve_data, solve_linear(), and static_linear_solver_cache.
Referenced by solve_linear(), solve_problem(), and solve_transient_linear().
| void polyfem::State::solve_navier_stokes | ( | int | step, |
| Eigen::MatrixXd & | sol, | ||
| Eigen::MatrixXd & | pressure, | ||
| UserPostStepCallback | user_post_step = {} |
||
| ) |
solves a navier stokes
| [in] | step | current step |
| [out] | sol | solution |
| [out] | pressure | pressure |
| [in] | user_post_step | optional post step user callback. Empty by default. |
Definition at line 28 of file StateSolveNavierStokes.cpp.
References args, ass_vals_cache, assembler, bases, boundary_nodes, geom_bases(), local_boundary, local_neumann_boundary, mesh, polyfem::solver::NavierStokesSolver::minimize(), mixed_assembler, n_bases, n_boundary_samples(), n_pressure_bases, pressure_ass_vals_cache, pressure_assembler, pressure_bases, problem, rhs, polyfem::solver::SolveData::rhs_assembler, set_materials(), sol_to_pressure(), solve_data, use_avg_pressure, and x.
Referenced by solve_problem().
| void polyfem::State::solve_problem | ( | Eigen::MatrixXd & | sol, |
| Eigen::MatrixXd & | pressure, | ||
| UserPostStepCallback | user_post_step = {}, |
||
| const InitialConditionOverride * | ic_override = nullptr |
||
| ) |
solves the problems
| [out] | sol | solution |
| [out] | pressure | pressure |
| [in] | user_post_step | optional post step user callback. Empty by default. |
| [in] | ic_override | Optional initial condition override (highest priority). Empty by default. |
Definition at line 1657 of file State.cpp.
References args, assembler, init_linear_solve(), init_nonlinear_tensor_solve(), init_solve(), is_homogenization(), is_problem_linear(), polyfem::logger(), mesh, n_bases, problem, resolve_output_path(), solve_homogenization(), solve_linear(), solve_navier_stokes(), solve_tensor_nonlinear(), solve_transient_linear(), solve_transient_navier_stokes(), solve_transient_navier_stokes_split(), solve_transient_tensor_nonlinear(), polyfem::io::OutRuntimeData::solving_time, polyfem::io::OutStatsData::spectrum, stats, timings, and polyfem::io::write_matrix().
Referenced by forward_simulation(), and polyfem::solver::AdjointOptUtils::solve_pde().
| void polyfem::State::solve_tensor_nonlinear | ( | int | step, |
| Eigen::MatrixXd & | sol, | ||
| const bool | init_lagging = true, |
||
| UserPostStepCallback | user_post_step = {} |
||
| ) |
solves nonlinear problems
| [in] | step | current step |
| [out] | sol | solution |
| [in] | user_post_step | optional post step user callback. Empty by default. |
Definition at line 326 of file StateSolveNonlinear.cpp.
References polyfem::solver::SolveData::al_form, args, bases, polyfem::Units::characteristic_length(), polyfem::utils::count_invalid(), polyfem::solver::FullNLProblem::finish(), polyfem::solver::NLProblem::full_to_reduced(), geom_bases(), polyfem::solver::NLProblem::gradient(), polyfem::solver::FullNLProblem::init(), polyfem::solver::NLProblem::init_lagging(), polyfem::logger(), make_nl_solver(), polyfem::solver::FullNLProblem::max_lagging_iterations(), mesh, polyfem::solver::SolveData::nl_problem, polyfem::solver::NLProblem::normalize_forms(), optimization_enabled, POLYFEM_SCOPED_TIMER, polyfem::solver::ALSolver::post_subsolve, polyfem::solver::NLProblem::reduced_to_full(), rhs, save_subsolve(), polyfem::solver::ALSolver::solve_al(), solve_data, polyfem::solver::ALSolver::solve_reduced(), polyfem::io::OutStatsData::solver_info, stats, units, polyfem::solver::SolveData::update_barrier_stiffness(), polyfem::solver::NLProblem::update_lagging(), polyfem::solver::FullNLProblem::uses_lagging(), and x.
Referenced by solve_problem(), and solve_transient_tensor_nonlinear().
| void polyfem::State::solve_transient_linear | ( | const int | time_steps, |
| const double | t0, | ||
| const double | dt, | ||
| Eigen::MatrixXd & | sol, | ||
| Eigen::MatrixXd & | pressure, | ||
| UserPostStepCallback | user_post_step = {}, |
||
| const InitialConditionOverride * | ic_override = nullptr |
||
| ) |
solves transient linear problem
| [in] | time_steps | number of time steps |
| [in] | t0 | initial times |
| [in] | dt | timestep size |
| [out] | sol | solution |
| [out] | pressure | pressure |
| [in] | user_post_step | optional post step user callback. Empty by default. |
| [in] | ic_override | Optional initial condition override (highest priority). Empty by default. |
Definition at line 241 of file StateSolveLinear.cpp.
References args, assembler, boundary_nodes, build_stiffness_mat(), polyfem::time_integrator::ImplicitTimeIntegrator::construct_time_integrator(), initial_acceleration(), initial_solution(), initial_velocity(), is_contact_enabled(), local_boundary, local_neumann_boundary, polyfem::log_and_throw_error(), polyfem::logger(), mass, mass_matrix_assembler, mixed_assembler, n_boundary_samples(), n_pressure_bases, problem, resolve_output_path(), rhs, polyfem::solver::SolveData::rhs_assembler, save_timestep(), solve_data, solve_linear(), and use_avg_pressure.
Referenced by solve_problem().
| void polyfem::State::solve_transient_navier_stokes | ( | const int | time_steps, |
| const double | t0, | ||
| const double | dt, | ||
| Eigen::MatrixXd & | sol, | ||
| Eigen::MatrixXd & | pressure, | ||
| UserPostStepCallback | user_post_step = {} |
||
| ) |
solves transient navier stokes with FEM
| [in] | time_steps | number of time steps |
| [in] | t0 | initial times |
| [in] | dt | timestep size |
| [out] | sol | solution |
| [out] | pressure | pressure |
| [in] | user_post_step | optional post step user callback. Empty by default. |
Definition at line 193 of file StateSolveNavierStokes.cpp.
References polyfem::time_integrator::BDF::acceleration_scaling(), args, ass_vals_cache, assembler, bases, boundary_nodes, geom_bases(), polyfem::time_integrator::ImplicitTimeIntegrator::init(), local_boundary, local_neumann_boundary, polyfem::logger(), mass_ass_vals_cache, mass_matrix_assembler, mesh, polyfem::solver::TransientNavierStokesSolver::minimize(), mixed_assembler, n_bases, n_boundary_samples(), n_pressure_bases, pressure_ass_vals_cache, pressure_assembler, pressure_bases, problem, rhs, polyfem::solver::SolveData::rhs_assembler, save_timestep(), set_materials(), polyfem::time_integrator::BDF::set_parameters(), sol_to_pressure(), solve_data, polyfem::time_integrator::BDF::update_quantities(), use_avg_pressure, and polyfem::time_integrator::BDF::weighted_sum_x_prevs().
Referenced by solve_problem().
| void polyfem::State::solve_transient_navier_stokes_split | ( | const int | time_steps, |
| const double | dt, | ||
| Eigen::MatrixXd & | sol, | ||
| Eigen::MatrixXd & | pressure, | ||
| UserPostStepCallback | user_post_step = {} |
||
| ) |
solves transient navier stokes with operator splitting
| [in] | time_steps | number of time steps |
| [in] | dt | timestep size |
| [out] | sol | solution |
| [out] | pressure | pressure |
| [in] | user_post_step | optional post step user callback. Empty by default. |
Definition at line 66 of file StateSolveNavierStokes.cpp.
References polyfem::solver::OperatorSplittingSolver::advection(), polyfem::solver::OperatorSplittingSolver::advection_FLIP(), args, ass_vals_cache, polyfem::assembler::Laplacian::assemble(), assembler, bases, boundary_nodes, build_stiffness_mat(), polyfem::solver::OperatorSplittingSolver::external_force(), geom_bases(), local_boundary, local_neumann_boundary, polyfem::log_and_throw_error(), polyfem::logger(), mass, mass_ass_vals_cache, mass_matrix_assembler, mesh, mixed_assembler, n_bases, n_boundary_samples(), n_pressure_bases, polyfem::autogen::p_nodes_2d(), polyfem::autogen::p_nodes_3d(), pressure_ass_vals_cache, pressure_bases, pressure_boundary_nodes, problem, polyfem::solver::OperatorSplittingSolver::projection(), polyfem::autogen::q_nodes_2d(), polyfem::autogen::q_nodes_3d(), polyfem::solver::SolveData::rhs_assembler, save_timestep(), polyfem::assembler::Assembler::set_size(), solve_data, polyfem::solver::OperatorSplittingSolver::solve_diffusion_1st(), and polyfem::solver::OperatorSplittingSolver::solve_pressure().
Referenced by solve_problem().
| void polyfem::State::solve_transient_tensor_nonlinear | ( | const int | time_steps, |
| const double | t0, | ||
| const double | dt, | ||
| Eigen::MatrixXd & | sol, | ||
| UserPostStepCallback | user_post_step = {}, |
||
| const InitialConditionOverride * | ic_override = nullptr |
||
| ) |
solves transient tensor nonlinear problem
| [in] | time_steps | number of time steps |
| [in] | t0 | initial times |
| [in] | dt | timestep size |
| [out] | sol | solution |
| [in] | user_post_step | optional post step user callback. Empty by default. |
| [in] | ic_override | Optional initial condition override (highest priority). Empty by default. |
Definition at line 52 of file StateSolveNonlinear.cpp.
References args, build_mesh_matrices(), polyfem::F, init_nonlinear_tensor_solve(), polyfem::logger(), mesh, polyfem::solver::SolveData::nl_problem, POLYFEM_SCOPED_TIMER, remesh(), resolve_output_path(), save_restart_json(), save_timestep(), solve_data, solve_tensor_nonlinear(), time_callback, polyfem::solver::SolveData::time_integrator, polyfem::solver::SolveData::update_barrier_stiffness(), polyfem::solver::SolveData::update_dt(), V, and polyfem::io::MshWriter::write().
Referenced by solve_problem().
| json polyfem::State::args |
main input arguments containing all defaults
Definition at line 135 of file State.hpp.
Referenced by assemble_mass_mat(), boundary_conditions_ids(), build_basis(), build_collision_mesh(), build_collision_mesh(), build_node_mapping(), build_periodic_collision_mesh(), build_polygonal_basis(), build_rhs_assembler(), build_stiffness_mat(), polyfem::OptState::check_unsupported(), compute_errors(), polyfem::solver::AdjointTools::compute_shape_derivative_functional_term(), polyfem::solver::AdjointTools::dJ_damping_transient_adjoint_term(), polyfem::solver::AdjointTools::dJ_dirichlet_transient_adjoint_term(), polyfem::solver::AdjointTools::dJ_du_step(), polyfem::solver::AdjointTools::dJ_friction_transient_adjoint_term(), polyfem::solver::AdjointTools::dJ_material_transient_adjoint_term(), polyfem::solver::AdjointTools::dJ_pressure_transient_adjoint_term(), polyfem::solver::AdjointTools::dJ_shape_transient_adjoint_term(), export_data(), formulation(), has_periodic_bc(), init(), polyfem::mesh::LocalRelaxationData< M >::init_assembler(), init_homogenization_solve(), init_linear_solve(), init_nonlinear_tensor_solve(), polyfem::mesh::LocalRelaxationData< M >::init_solve_data(), init_time(), initial_acceleration(), initial_solution(), initial_velocity(), polyfem::solver::AdjointTools::integrate_objective(), is_adhesion_enabled(), is_contact_enabled(), is_homogenization(), is_pressure_enabled(), iso_parametric(), load_mesh(), load_mesh(), make_nl_solver(), n_boundary_samples(), polyfem::mesh::Remesher::project_quantities(), root_path(), polyfem::io::OutGeometryData::save_contact_surface(), save_json(), save_json(), save_restart_json(), save_subsolve(), save_timestep(), set_materials(), set_materials(), polyfem::solver::DirichletVariableToSimulation::set_output_indexing(), polyfem::solver::PressureVariableToSimulation::set_output_indexing(), polyfem::mesh::WildRemesher< wmtk::TetMesh >::smooth_vertices(), solve_homogenization(), solve_homogenization_step(), solve_linear(), solve_linear(), solve_navier_stokes(), solve_problem(), solve_tensor_nonlinear(), solve_transient_linear(), solve_transient_navier_stokes(), solve_transient_navier_stokes_split(), and solve_transient_tensor_nonlinear().
| assembler::AssemblyValsCache polyfem::State::ass_vals_cache |
used to store assembly values for small problems
Definition at line 230 of file State.hpp.
Referenced by build_basis(), build_stiffness_mat(), polyfem::solver::AdjointTools::compute_shape_derivative_functional_term(), polyfem::solver::AdjointTools::dJ_du_step(), export_data(), init_homogenization_solve(), init_linear_solve(), init_nonlinear_tensor_solve(), polyfem::solver::AdjointTools::integrate_objective(), solve_navier_stokes(), solve_transient_navier_stokes(), and solve_transient_navier_stokes_split().
| std::shared_ptr<assembler::Assembler> polyfem::State::assembler = nullptr |
assemblers
assembler corresponding to governing physical equations
Definition at line 189 of file State.hpp.
Referenced by assemble_mass_mat(), assemble_rhs(), build_basis(), build_polygonal_basis(), build_pressure_assembler(), build_rhs_assembler(), build_stiffness_mat(), polyfem::solver::AdjointTools::compute_shape_derivative_functional_term(), polyfem::solver::AdjointTools::dJ_du_step(), export_data(), polyfem::io::OutGeometryData::export_data(), init(), init_homogenization_solve(), init_linear_solve(), init_nonlinear_tensor_solve(), polyfem::solver::AdjointTools::integrate_objective(), is_problem_linear(), load_mesh(), load_mesh(), save_json(), polyfem::io::OutGeometryData::save_surface(), polyfem::io::OutGeometryData::save_volume(), polyfem::io::OutGeometryData::save_wire(), set_materials(), set_materials(), sol_to_pressure(), solve_linear(), solve_linear(), solve_navier_stokes(), solve_problem(), solve_transient_linear(), solve_transient_navier_stokes(), and solve_transient_navier_stokes_split().
| double polyfem::State::avg_mass |
average system mass, used for contact with IPC
Definition at line 238 of file State.hpp.
Referenced by assemble_mass_mat(), init_homogenization_solve(), polyfem::mesh::LocalRelaxationData< M >::init_mass_matrix(), init_nonlinear_tensor_solve(), and polyfem::mesh::LocalRelaxationData< M >::init_solve_data().
| std::vector<basis::ElementBases> polyfem::State::bases |
FE bases, the size is #elements.
Definition at line 205 of file State.hpp.
Referenced by assemble_mass_mat(), polyfem::solver::BoundedBiharmonicWeights2Dto3D::BoundedBiharmonicWeights2Dto3D(), build_basis(), build_collision_mesh(), build_collision_mesh(), build_mesh_matrices(), build_periodic_collision_mesh(), build_polygonal_basis(), build_pressure_assembler(), build_rhs_assembler(), build_stiffness_mat(), compute_errors(), polyfem::solver::AdjointTools::compute_shape_derivative_functional_term(), polyfem::solver::AdjointTools::dJ_du_step(), polyfem::solver::AdjointTools::dJ_material_transient_adjoint_term(), polyfem::solver::AdjointTools::dJ_shape_transient_adjoint_term(), export_data(), polyfem::io::OutGeometryData::export_data(), geom_bases(), init_homogenization_solve(), init_linear_solve(), init_nonlinear_tensor_solve(), polyfem::solver::AdjointTools::integrate_objective(), reset_mesh(), polyfem::io::OutGeometryData::save_surface(), polyfem::io::OutGeometryData::save_volume(), polyfem::io::OutGeometryData::save_volume_vector_field(), polyfem::io::OutGeometryData::save_wire(), solve_homogenization_step(), solve_linear(), solve_navier_stokes(), solve_tensor_nonlinear(), solve_transient_navier_stokes(), solve_transient_navier_stokes_split(), polyfem::solver::VariableToBoundaryNodes::VariableToBoundaryNodes(), and polyfem::solver::VariableToBoundaryNodesExclusive::VariableToBoundaryNodesExclusive().
| std::vector<int> polyfem::State::boundary_nodes |
list of boundary nodes
Definition at line 548 of file State.hpp.
Referenced by build_basis(), build_pressure_assembler(), polyfem::solver::AdjointTools::dJ_damping_transient_adjoint_term(), polyfem::solver::AdjointTools::dJ_dirichlet_static_adjoint_term(), polyfem::solver::AdjointTools::dJ_dirichlet_transient_adjoint_term(), polyfem::solver::AdjointTools::dJ_friction_transient_adjoint_term(), polyfem::solver::AdjointTools::dJ_initial_condition_adjoint_term(), polyfem::solver::AdjointTools::dJ_material_static_adjoint_term(), polyfem::solver::AdjointTools::dJ_material_transient_adjoint_term(), polyfem::solver::AdjointTools::dJ_pressure_transient_adjoint_term(), polyfem::solver::AdjointTools::dJ_shape_static_adjoint_term(), polyfem::solver::AdjointTools::dJ_shape_transient_adjoint_term(), init_homogenization_solve(), init_linear_solve(), init_nonlinear_tensor_solve(), reset_mesh(), solve_linear(), solve_linear(), solve_navier_stokes(), solve_transient_linear(), solve_transient_navier_stokes(), and solve_transient_navier_stokes_split().
| ipc::CollisionMesh polyfem::State::collision_mesh |
IPC collision mesh.
Definition at line 663 of file State.hpp.
Referenced by build_basis(), build_collision_mesh(), build_collision_mesh(), build_periodic_collision_mesh(), polyfem::solver::AdjointTools::dJ_friction_transient_adjoint_term(), init_homogenization_solve(), init_nonlinear_tensor_solve(), is_obstacle_vertex(), and polyfem::io::OutGeometryData::save_contact_surface().
|
private |
logger sink to stdout
Definition at line 176 of file State.hpp.
Referenced by init_logger(), and set_log_level().
| std::shared_ptr<assembler::ViscousDamping> polyfem::State::damping_assembler = nullptr |
Definition at line 198 of file State.hpp.
Referenced by init_nonlinear_tensor_solve().
| std::shared_ptr<assembler::ViscousDampingPrev> polyfem::State::damping_prev_assembler = nullptr |
Definition at line 199 of file State.hpp.
Referenced by init_nonlinear_tensor_solve().
| std::vector<int> polyfem::State::dirichlet_nodes |
per node dirichlet
Definition at line 564 of file State.hpp.
Referenced by build_basis(), build_rhs_assembler(), and polyfem::io::OutGeometryData::save_points().
| std::vector<RowVectorNd> polyfem::State::dirichlet_nodes_position |
Definition at line 565 of file State.hpp.
Referenced by build_basis(), build_rhs_assembler(), and polyfem::io::OutGeometryData::save_points().
| Eigen::VectorXi polyfem::State::disc_orders |
vector of discretization orders, used when not all elements have the same degree, one per element
Definition at line 224 of file State.hpp.
Referenced by build_basis(), build_node_mapping(), polyfem::io::OutGeometryData::export_data(), n_boundary_samples(), save_json(), polyfem::io::OutGeometryData::save_surface(), polyfem::io::OutGeometryData::save_volume(), polyfem::io::OutGeometryData::save_volume_vector_field(), and polyfem::io::OutGeometryData::save_wire().
| Eigen::VectorXi polyfem::State::disc_ordersq |
Definition at line 224 of file State.hpp.
Referenced by build_basis(), polyfem::io::OutGeometryData::export_data(), save_json(), polyfem::io::OutGeometryData::save_volume(), polyfem::io::OutGeometryData::save_volume_vector_field(), and polyfem::io::OutGeometryData::save_wire().
| std::shared_ptr<assembler::PressureAssembler> polyfem::State::elasticity_pressure_assembler = nullptr |
Definition at line 196 of file State.hpp.
Referenced by init_homogenization_solve(), and init_nonlinear_tensor_solve().
|
private |
Definition at line 177 of file State.hpp.
Referenced by init_logger().
| std::vector<basis::ElementBases> polyfem::State::geom_bases_ |
Geometric mapping bases, if the elements are isoparametric, this list is empty.
Definition at line 209 of file State.hpp.
Referenced by build_basis(), build_polygonal_basis(), geom_bases(), and reset_mesh().
| std::shared_ptr<polyfem::mesh::MeshNodes> polyfem::State::geom_mesh_nodes |
Definition at line 227 of file State.hpp.
Referenced by build_basis(), and primitive_to_node().
|
private |
Definition at line 531 of file State.hpp.
Referenced by has_constraints(), and init().
| bool polyfem::State::has_dhat = false |
stores if input json contains dhat
Definition at line 722 of file State.hpp.
Referenced by build_basis(), and init().
| Eigen::VectorXi polyfem::State::in_node_to_node |
Inpute nodes (including high-order) to polyfem nodes, only for isoparametric.
Definition at line 571 of file State.hpp.
Referenced by build_basis(), build_collision_mesh(), build_collision_mesh(), build_node_mapping(), polyfem::io::OutGeometryData::export_data(), init_homogenization_solve(), init_nonlinear_tensor_solve(), polyfem::mesh::LocalRelaxationData< M >::init_solve_data(), initial_acceleration(), initial_solution(), initial_velocity(), and remesh().
| Eigen::VectorXi polyfem::State::in_primitive_to_primitive |
maps in vertices/edges/faces/cells to polyfem vertices/edges/faces/cells
Definition at line 573 of file State.hpp.
Referenced by build_node_mapping().
| std::vector<mesh::LocalBoundary> polyfem::State::local_boundary |
mapping from elements to nodes for dirichlet boundary conditions
Definition at line 554 of file State.hpp.
Referenced by build_basis(), build_polygonal_basis(), init_homogenization_solve(), init_linear_solve(), init_nonlinear_tensor_solve(), reset_mesh(), solve_linear(), solve_navier_stokes(), solve_transient_linear(), solve_transient_navier_stokes(), and solve_transient_navier_stokes_split().
| std::vector<mesh::LocalBoundary> polyfem::State::local_neumann_boundary |
mapping from elements to nodes for neumann boundary conditions
Definition at line 556 of file State.hpp.
Referenced by assemble_rhs(), build_basis(), init_homogenization_solve(), init_linear_solve(), init_nonlinear_tensor_solve(), reset_mesh(), solve_linear(), solve_navier_stokes(), solve_transient_linear(), solve_transient_navier_stokes(), and solve_transient_navier_stokes_split().
| std::vector<mesh::LocalBoundary> polyfem::State::local_pressure_boundary |
mapping from elements to nodes for pressure boundary conditions
Definition at line 558 of file State.hpp.
Referenced by build_basis(), build_pressure_assembler(), init_homogenization_solve(), and init_nonlinear_tensor_solve().
| std::unordered_map<int, std::vector<mesh::LocalBoundary> > polyfem::State::local_pressure_cavity |
mapping from elements to nodes for pressure boundary conditions
Definition at line 560 of file State.hpp.
Referenced by build_basis(), build_pressure_assembler(), init_homogenization_solve(), and init_nonlinear_tensor_solve().
| assembler::MacroStrainValue polyfem::State::macro_strain_constraint |
Definition at line 805 of file State.hpp.
Referenced by build_basis(), init_homogenization_solve(), init_nonlinear_tensor_solve(), and solve_homogenization_step().
| StiffnessMatrix polyfem::State::mass |
Mass matrix, it is computed only for time dependent problems.
Definition at line 236 of file State.hpp.
Referenced by assemble_mass_mat(), init_homogenization_solve(), init_linear_solve(), init_nonlinear_tensor_solve(), reset_mesh(), solve_transient_linear(), and solve_transient_navier_stokes_split().
| assembler::AssemblyValsCache polyfem::State::mass_ass_vals_cache |
Definition at line 231 of file State.hpp.
Referenced by assemble_mass_mat(), build_basis(), build_rhs_assembler(), polyfem::solver::AdjointTools::dJ_shape_transient_adjoint_term(), init_homogenization_solve(), init_nonlinear_tensor_solve(), solve_transient_navier_stokes(), and solve_transient_navier_stokes_split().
| std::shared_ptr<assembler::Mass> polyfem::State::mass_matrix_assembler = nullptr |
Definition at line 191 of file State.hpp.
Referenced by assemble_mass_mat(), assemble_rhs(), polyfem::solver::AdjointTools::dJ_shape_transient_adjoint_term(), init(), init_homogenization_solve(), init_linear_solve(), init_nonlinear_tensor_solve(), load_mesh(), load_mesh(), polyfem::io::OutGeometryData::save_surface(), polyfem::io::OutGeometryData::save_volume(), solve_transient_linear(), solve_transient_navier_stokes(), and solve_transient_navier_stokes_split().
| std::unique_ptr<mesh::Mesh> polyfem::State::mesh |
current mesh, it can be a Mesh2D or Mesh3D
Definition at line 587 of file State.hpp.
Referenced by assemble_mass_mat(), assemble_rhs(), boundary_conditions_ids(), polyfem::solver::BoundedBiharmonicWeights2Dto3D::BoundedBiharmonicWeights2Dto3D(), build_basis(), build_collision_mesh(), build_collision_mesh(), build_mesh_matrices(), build_node_mapping(), build_periodic_collision_mesh(), build_polygonal_basis(), build_pressure_assembler(), build_rhs_assembler(), build_stiffness_mat(), compute_errors(), polyfem::solver::AdjointTools::compute_shape_derivative_functional_term(), polyfem::solver::NLHomoProblem::constraint_grad(), polyfem::solver::AdjointTools::dJ_dirichlet_static_adjoint_term(), polyfem::solver::AdjointTools::dJ_du_step(), polyfem::solver::AdjointTools::dJ_friction_transient_adjoint_term(), polyfem::solver::AdjointTools::dJ_periodic_shape_adjoint_term(), polyfem::solver::AdjointTools::dJ_shape_homogenization_adjoint_term(), polyfem::solver::AdjointTools::dJ_shape_static_adjoint_term(), polyfem::solver::AdjointTools::dJ_shape_transient_adjoint_term(), export_data(), polyfem::io::OutGeometryData::export_data(), polyfem::solver::NLHomoProblem::extended_hessian_to_reduced_hessian(), polyfem::solver::NLHomoProblem::extended_to_reduced(), polyfem::solver::NLHomoProblem::extended_to_reduced_grad(), forward_simulation(), polyfem::solver::NLHomoProblem::full_hessian_to_reduced_hessian(), polyfem::solver::NLHomoProblem::full_to_reduced(), polyfem::solver::NLHomoProblem::full_to_reduced_grad(), get_elements(), get_vertices(), init_homogenization_solve(), init_linear_solve(), init_nonlinear_tensor_solve(), polyfem::solver::NLHomoProblem::init_projection(), init_solve(), initial_acceleration(), initial_solution(), initial_velocity(), polyfem::solver::AdjointTools::integrate_objective(), iso_parametric(), load_mesh(), load_mesh(), load_mesh(), polyfem::solver::AdjointTools::map_node_to_primitive_order(), polyfem::solver::AdjointTools::map_primitive_to_node_order(), n_boundary_samples(), ndof(), primitive_to_node(), polyfem::solver::NLHomoProblem::reduced_to_disp_grad(), polyfem::solver::NLHomoProblem::reduced_to_extended(), polyfem::solver::NLHomoProblem::reduced_to_full(), remesh(), polyfem::io::OutGeometryData::save_contact_surface(), save_json(), polyfem::io::OutGeometryData::save_points(), save_subsolve(), polyfem::io::OutGeometryData::save_surface(), save_timestep(), polyfem::io::OutGeometryData::save_volume(), polyfem::io::OutGeometryData::save_volume_vector_field(), polyfem::io::OutGeometryData::save_vtu(), polyfem::io::OutGeometryData::save_wire(), polyfem::solver::NLHomoProblem::set_fixed_entry(), set_materials(), set_materials(), polyfem::solver::ShapeVariableToSimulation::set_output_indexing(), polyfem::solver::DirichletVariableToSimulation::set_output_indexing(), sol_to_pressure(), solve_homogenization(), solve_homogenization_step(), solve_linear(), solve_navier_stokes(), solve_problem(), solve_tensor_nonlinear(), solve_transient_navier_stokes(), solve_transient_navier_stokes_split(), solve_transient_tensor_nonlinear(), polyfem::solver::VariableToBoundaryNodes::VariableToBoundaryNodes(), polyfem::solver::VariableToBoundaryNodesExclusive::VariableToBoundaryNodesExclusive(), polyfem::solver::VariableToInteriorNodes::VariableToInteriorNodes(), polyfem::solver::VariableToNodes::VariableToNodes(), polyfem::io::RuntimeStatsCSVWriter::write(), and polyfem::mesh::Remesher::write_mesh().
| std::shared_ptr<polyfem::mesh::MeshNodes> polyfem::State::mesh_nodes |
Mapping from input nodes to FE nodes.
Definition at line 227 of file State.hpp.
Referenced by build_basis(), build_node_mapping(), polyfem::solver::NLHomoProblem::constraint_grad(), polyfem::solver::AdjointTools::dJ_periodic_shape_adjoint_term(), polyfem::solver::AdjointTools::dJ_shape_homogenization_adjoint_term(), polyfem::solver::NLHomoProblem::full_to_reduced(), primitive_to_node(), polyfem::solver::NLHomoProblem::reduced_to_full(), and solve_homogenization().
| double polyfem::State::min_boundary_edge_length = -1 |
Definition at line 738 of file State.hpp.
Referenced by build_basis().
| std::shared_ptr<assembler::MixedAssembler> polyfem::State::mixed_assembler = nullptr |
Definition at line 193 of file State.hpp.
Referenced by assemble_mass_mat(), assemble_rhs(), build_basis(), build_stiffness_mat(), init(), init_linear_solve(), init_nonlinear_tensor_solve(), init_solve(), load_mesh(), load_mesh(), ndof(), polyfem::io::OutGeometryData::save_surface(), polyfem::io::OutGeometryData::save_volume(), sol_to_pressure(), solve_linear(), solve_navier_stokes(), solve_transient_linear(), solve_transient_navier_stokes(), and solve_transient_navier_stokes_split().
| int polyfem::State::n_bases |
number of bases
Definition at line 212 of file State.hpp.
Referenced by assemble_mass_mat(), assemble_rhs(), build_basis(), build_collision_mesh(), build_collision_mesh(), build_mesh_matrices(), build_periodic_collision_mesh(), build_polygonal_basis(), build_pressure_assembler(), build_rhs_assembler(), build_stiffness_mat(), compute_errors(), polyfem::solver::NLHomoProblem::constraint_grad(), polyfem::solver::AdjointTools::dJ_du_step(), polyfem::solver::AdjointTools::dJ_periodic_shape_adjoint_term(), polyfem::solver::AdjointTools::dJ_shape_homogenization_adjoint_term(), export_data(), polyfem::io::OutGeometryData::export_data(), polyfem::solver::NLHomoProblem::full_to_reduced(), init_homogenization_solve(), init_linear_solve(), init_nonlinear_tensor_solve(), init_solve(), ndof(), polyfem::solver::NLHomoProblem::reduced_to_full(), remesh(), reset_mesh(), save_json(), polyfem::io::OutGeometryData::save_volume(), polyfem::io::OutGeometryData::save_vtu(), sol_to_pressure(), solve_homogenization(), solve_homogenization_step(), solve_linear(), solve_navier_stokes(), solve_problem(), solve_transient_navier_stokes(), solve_transient_navier_stokes_split(), and polyfem::io::RuntimeStatsCSVWriter::write().
| int polyfem::State::n_geom_bases |
number of geometric bases
Definition at line 216 of file State.hpp.
Referenced by build_basis(), polyfem::solver::AdjointTools::compute_shape_derivative_functional_term(), polyfem::solver::AdjointTools::dJ_pressure_static_adjoint_term(), polyfem::solver::AdjointTools::dJ_pressure_transient_adjoint_term(), polyfem::solver::AdjointTools::dJ_shape_homogenization_adjoint_term(), polyfem::solver::AdjointTools::dJ_shape_static_adjoint_term(), polyfem::solver::AdjointTools::dJ_shape_transient_adjoint_term(), polyfem::solver::PeriodicContactForceDerivative::force_shape_derivative(), polyfem::solver::AdjointTools::map_node_to_primitive_order(), polyfem::solver::AdjointTools::map_primitive_to_node_order(), and node_to_primitive().
| int polyfem::State::n_pressure_bases |
number of pressure bases
Definition at line 214 of file State.hpp.
Referenced by assemble_rhs(), build_basis(), build_polygonal_basis(), build_stiffness_mat(), init_homogenization_solve(), init_linear_solve(), init_nonlinear_tensor_solve(), init_solve(), ndof(), reset_mesh(), save_json(), sol_to_pressure(), solve_navier_stokes(), solve_transient_linear(), solve_transient_navier_stokes(), and solve_transient_navier_stokes_split().
| std::vector<int> polyfem::State::neumann_nodes |
per node neumann
Definition at line 567 of file State.hpp.
Referenced by build_basis(), and build_rhs_assembler().
| std::vector<RowVectorNd> polyfem::State::neumann_nodes_position |
Definition at line 568 of file State.hpp.
Referenced by build_basis(), and build_rhs_assembler().
| mesh::Obstacle polyfem::State::obstacle |
Obstacles used in collisions.
Definition at line 589 of file State.hpp.
Referenced by build_basis(), build_collision_mesh(), build_collision_mesh(), build_mesh_matrices(), build_pressure_assembler(), build_rhs_assembler(), polyfem::mesh::LocalRelaxationData< M >::init_boundary_conditions(), init_homogenization_solve(), init_nonlinear_tensor_solve(), is_obstacle_vertex(), load_mesh(), load_mesh(), polyfem::mesh::Remesher::obstacle(), remesh(), reset_mesh(), polyfem::io::OutGeometryData::save_volume(), and polyfem::io::OutGeometryData::save_volume_vector_field().
| bool polyfem::State::optimization_enabled = false |
Definition at line 799 of file State.hpp.
Referenced by init_homogenization_solve(), init_nonlinear_tensor_solve(), and solve_tensor_nonlinear().
| io::OutGeometryData polyfem::State::out_geom |
visualization stuff
Definition at line 731 of file State.hpp.
Referenced by build_basis(), export_data(), load_mesh(), load_mesh(), save_subsolve(), and save_timestep().
| std::string polyfem::State::output_dir |
Directory for output files.
Definition at line 729 of file State.hpp.
Referenced by init(), init_nonlinear_tensor_solve(), and resolve_output_path().
| std::shared_ptr<utils::PeriodicBoundary> polyfem::State::periodic_bc |
periodic BC and periodic mesh utils
Definition at line 499 of file State.hpp.
Referenced by build_basis(), build_periodic_collision_mesh(), init_homogenization_solve(), init_nonlinear_tensor_solve(), and solve_linear().
| ipc::CollisionMesh polyfem::State::periodic_collision_mesh |
IPC collision mesh under periodic BC.
Definition at line 666 of file State.hpp.
Referenced by build_periodic_collision_mesh(), init_homogenization_solve(), and init_nonlinear_tensor_solve().
| Eigen::VectorXi polyfem::State::periodic_collision_mesh_to_basis |
index mapping from periodic 2x2 collision mesh to FE periodic mesh
Definition at line 668 of file State.hpp.
Referenced by build_periodic_collision_mesh(), init_homogenization_solve(), and init_nonlinear_tensor_solve().
| std::map<int, basis::InterfaceData> polyfem::State::poly_edge_to_data |
nodes on the boundary of polygonal elements, used for harmonic bases
Definition at line 562 of file State.hpp.
Referenced by build_basis(), build_polygonal_basis(), and reset_mesh().
| std::map<int, Eigen::MatrixXd> polyfem::State::polys |
polygons, used since poly have no geom mapping
Definition at line 219 of file State.hpp.
Referenced by build_basis(), build_polygonal_basis(), reset_mesh(), polyfem::io::OutGeometryData::save_volume(), polyfem::io::OutGeometryData::save_volume_vector_field(), and polyfem::io::OutGeometryData::save_wire().
| std::map<int, std::pair<Eigen::MatrixXd, Eigen::MatrixXi> > polyfem::State::polys_3d |
polyhedra, used since poly have no geom mapping
Definition at line 221 of file State.hpp.
Referenced by build_polygonal_basis(), polyfem::io::OutGeometryData::save_volume(), polyfem::io::OutGeometryData::save_volume_vector_field(), and polyfem::io::OutGeometryData::save_wire().
| assembler::AssemblyValsCache polyfem::State::pressure_ass_vals_cache |
used to store assembly values for pressure for small problems
Definition at line 233 of file State.hpp.
Referenced by assemble_rhs(), build_basis(), build_stiffness_mat(), solve_navier_stokes(), solve_transient_navier_stokes(), and solve_transient_navier_stokes_split().
| std::shared_ptr<assembler::Assembler> polyfem::State::pressure_assembler = nullptr |
Definition at line 194 of file State.hpp.
Referenced by build_stiffness_mat(), init(), load_mesh(), load_mesh(), solve_navier_stokes(), and solve_transient_navier_stokes().
| std::vector<basis::ElementBases> polyfem::State::pressure_bases |
FE pressure bases for mixed elements, the size is #elements.
Definition at line 207 of file State.hpp.
Referenced by assemble_rhs(), build_basis(), build_stiffness_mat(), reset_mesh(), polyfem::io::OutGeometryData::save_surface(), polyfem::io::OutGeometryData::save_volume(), solve_navier_stokes(), solve_transient_navier_stokes(), and solve_transient_navier_stokes_split().
| std::vector<int> polyfem::State::pressure_boundary_nodes |
list of neumann boundary nodes
Definition at line 550 of file State.hpp.
Referenced by build_basis(), and solve_transient_navier_stokes_split().
| std::shared_ptr<polyfem::mesh::MeshNodes> polyfem::State::pressure_mesh_nodes |
Definition at line 227 of file State.hpp.
Referenced by build_basis().
| std::shared_ptr<assembler::Problem> polyfem::State::problem |
current problem, it contains rhs and bc
Definition at line 202 of file State.hpp.
Referenced by assemble_mass_mat(), assemble_rhs(), build_basis(), build_pressure_assembler(), build_rhs_assembler(), build_stiffness_mat(), polyfem::OptState::check_unsupported(), compute_errors(), polyfem::solver::AdjointForm::compute_reduced_adjoint_rhs(), polyfem::solver::AdjointTools::compute_shape_derivative_functional_term(), polyfem::solver::AdjointTools::dJ_du_step(), export_data(), polyfem::io::OutGeometryData::export_data(), init(), polyfem::mesh::LocalRelaxationData< M >::init_boundary_conditions(), init_linear_solve(), init_nonlinear_tensor_solve(), init_solve(), polyfem::mesh::LocalRelaxationData< M >::init_solve_data(), initial_solution(), polyfem::solver::AdjointTools::integrate_objective(), ndof(), remesh(), save_json(), polyfem::io::OutGeometryData::save_points(), save_subsolve(), polyfem::io::OutGeometryData::save_surface(), save_timestep(), polyfem::io::OutGeometryData::save_volume(), polyfem::io::OutGeometryData::save_volume_vector_field(), polyfem::io::OutGeometryData::save_wire(), sol_to_pressure(), solve_linear(), solve_linear(), solve_navier_stokes(), solve_problem(), solve_transient_linear(), solve_transient_navier_stokes(), solve_transient_navier_stokes_split(), and State().
| Eigen::MatrixXd polyfem::State::rhs |
System right-hand side.
Definition at line 241 of file State.hpp.
Referenced by assemble_rhs(), build_basis(), build_polygonal_basis(), polyfem::io::OutGeometryData::export_data(), init_homogenization_solve(), init_linear_solve(), init_nonlinear_tensor_solve(), init_solve(), initial_solution(), reset_mesh(), polyfem::io::OutGeometryData::save_vtu(), solve_linear(), solve_navier_stokes(), solve_tensor_nonlinear(), solve_transient_linear(), and solve_transient_navier_stokes().
| solver::SolveData polyfem::State::solve_data |
timedependent stuff cached
Definition at line 375 of file State.hpp.
Referenced by assemble_rhs(), polyfem::solver::AdjointForm::compute_reduced_adjoint_rhs(), polyfem::solver::AdjointTools::dJ_damping_transient_adjoint_term(), polyfem::solver::AdjointTools::dJ_friction_transient_adjoint_term(), polyfem::solver::AdjointTools::dJ_material_static_adjoint_term(), polyfem::solver::AdjointTools::dJ_material_transient_adjoint_term(), polyfem::solver::AdjointTools::dJ_periodic_shape_adjoint_term(), polyfem::solver::AdjointTools::dJ_pressure_static_adjoint_term(), polyfem::solver::AdjointTools::dJ_pressure_transient_adjoint_term(), polyfem::solver::AdjointTools::dJ_shape_homogenization_adjoint_term(), polyfem::solver::AdjointTools::dJ_shape_static_adjoint_term(), polyfem::solver::AdjointTools::dJ_shape_transient_adjoint_term(), init_homogenization_solve(), init_linear_solve(), init_nonlinear_tensor_solve(), init_solve(), polyfem::mesh::LocalRelaxationData< M >::init_solve_data(), initial_acceleration(), initial_solution(), initial_velocity(), polyfem::mesh::Remesher::project_quantities(), remesh(), polyfem::io::OutGeometryData::save_contact_surface(), polyfem::io::OutGeometryData::save_volume(), polyfem::mesh::WildRemesher< wmtk::TetMesh >::smooth_vertices(), solve_homogenization(), solve_homogenization_step(), solve_linear(), solve_linear(), solve_navier_stokes(), solve_tensor_nonlinear(), solve_transient_linear(), solve_transient_navier_stokes(), solve_transient_navier_stokes_split(), and solve_transient_tensor_nonlinear().
| double polyfem::State::starting_max_edge_length = -1 |
Definition at line 737 of file State.hpp.
Referenced by build_basis().
| double polyfem::State::starting_min_edge_length = -1 |
Definition at line 736 of file State.hpp.
Referenced by build_basis(), and save_restart_json().
| std::unique_ptr<polysolve::linear::Solver> polyfem::State::static_linear_solver_cache |
Linear solver instance from the most recent static linear solve.
This cache is meant for library user to resue the factorization. Polyfem core itself does not rely on this cache. For example, adjoint optimization benefits from this as they sometime solve the same lhs.
Definition at line 382 of file State.hpp.
Referenced by solve_linear().
| io::OutStatsData polyfem::State::stats |
Other statistics.
Definition at line 735 of file State.hpp.
Referenced by assemble_mass_mat(), build_basis(), build_stiffness_mat(), compute_errors(), forward_simulation(), init_nonlinear_tensor_solve(), save_json(), solve_linear(), solve_problem(), and solve_tensor_nonlinear().
| std::function<void(int, int, double, double)> polyfem::State::time_callback = nullptr |
Definition at line 740 of file State.hpp.
Referenced by solve_transient_tensor_nonlinear().
| io::OutRuntimeData polyfem::State::timings |
runtime statistics
Definition at line 733 of file State.hpp.
Referenced by assemble_mass_mat(), assemble_rhs(), build_basis(), build_polygonal_basis(), build_stiffness_mat(), forward_simulation(), save_json(), and solve_problem().
| std::vector<mesh::LocalBoundary> polyfem::State::total_local_boundary |
mapping from elements to nodes for all mesh
Definition at line 552 of file State.hpp.
Referenced by polyfem::solver::BoundedBiharmonicWeights2Dto3D::BoundedBiharmonicWeights2Dto3D(), build_basis(), build_collision_mesh(), build_collision_mesh(), polyfem::solver::AdjointTools::compute_shape_derivative_functional_term(), polyfem::solver::AdjointTools::dJ_du_step(), polyfem::solver::AdjointTools::integrate_objective(), polyfem::io::OutGeometryData::save_surface(), polyfem::solver::VariableToBoundaryNodes::VariableToBoundaryNodes(), and polyfem::solver::VariableToBoundaryNodesExclusive::VariableToBoundaryNodesExclusive().
| Units polyfem::State::units |
Definition at line 184 of file State.hpp.
Referenced by build_basis(), init(), polyfem::mesh::LocalRelaxationData< M >::init_assembler(), init_homogenization_solve(), init_nonlinear_tensor_solve(), polyfem::mesh::LocalRelaxationData< M >::init_solve_data(), init_time(), load_mesh(), load_mesh(), make_nl_solver(), set_materials(), set_materials(), and solve_tensor_nonlinear().
| bool polyfem::State::use_avg_pressure |
use average pressure for stokes problem to fix the additional dofs, true by default if false, it will fix one pressure node to zero
Definition at line 245 of file State.hpp.
Referenced by assemble_rhs(), build_basis(), build_stiffness_mat(), sol_to_pressure(), solve_linear(), solve_navier_stokes(), solve_transient_linear(), and solve_transient_navier_stokes().