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 |
int | n_boundary_samples () const |
quadrature used for projecting boundary conditions | |
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) |
solves the problems | |
void | solve (Eigen::MatrixXd &sol, Eigen::MatrixXd &pressure) |
solves the problem, call other methods | |
void | init_solve (Eigen::MatrixXd &sol, Eigen::MatrixXd &pressure) |
initialize solver | |
void | solve_transient_navier_stokes_split (const int time_steps, const double dt, Eigen::MatrixXd &sol, Eigen::MatrixXd &pressure) |
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) |
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) |
solves transient linear problem | |
void | solve_transient_tensor_nonlinear (const int time_steps, const double t0, const double dt, Eigen::MatrixXd &sol) |
solves transient tensor nonlinear problem | |
void | init_nonlinear_tensor_solve (Eigen::MatrixXd &sol, const double t=1.0, const bool init_time_integrator=true) |
initialize the nonlinear solver | |
void | init_linear_solve (Eigen::MatrixXd &sol, const double t=1.0) |
initialize the linear solve | |
void | initial_solution (Eigen::MatrixXd &solution) const |
Load or compute the initial solution. | |
void | initial_velocity (Eigen::MatrixXd &velocity) const |
Load or compute the initial velocity. | |
void | initial_acceleration (Eigen::MatrixXd &acceleration) const |
Load or compute the initial acceleration. | |
void | solve_linear (Eigen::MatrixXd &sol, Eigen::MatrixXd &pressure) |
solves a linear problem | |
void | solve_navier_stokes (Eigen::MatrixXd &sol, Eigen::MatrixXd &pressure) |
solves a navier stokes | |
void | solve_tensor_nonlinear (Eigen::MatrixXd &sol, const int t=0, const bool init_lagging=true) |
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 (const std::unique_ptr< polysolve::linear::Solver > &solver, StiffnessMatrix &A, Eigen::VectorXd &b, const bool compute_spectrum, Eigen::MatrixXd &sol, Eigen::MatrixXd &pressure) |
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. | |
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 | 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 has contact | |
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 | cache_transient_adjoint_quantities (const int current_step, const Eigen::MatrixXd &sol, const Eigen::MatrixXd &disp_grad) |
int | ndof () const |
void | compute_force_jacobian (const Eigen::MatrixXd &sol, const Eigen::MatrixXd &disp_grad, StiffnessMatrix &hessian) |
void | compute_force_jacobian_prev (const int force_step, const int sol_step, StiffnessMatrix &hessian_prev) const |
void | solve_adjoint_cached (const Eigen::MatrixXd &rhs) |
Eigen::MatrixXd | solve_adjoint (const Eigen::MatrixXd &rhs) const |
Eigen::MatrixXd | get_adjoint_mat (int type) const |
Eigen::MatrixXd | solve_static_adjoint (const Eigen::MatrixXd &adjoint_rhs) const |
Eigen::MatrixXd | solve_transient_adjoint (const Eigen::MatrixXd &adjoint_rhs) const |
void | set_mesh_vertex (int v_id, const Eigen::VectorXd &vertex) |
void | get_vertices (Eigen::MatrixXd &vertices) const |
void | get_elements (Eigen::MatrixXi &elements) const |
void | compute_surface_node_ids (const int surface_selection, std::vector< int > &node_ids) const |
void | compute_total_surface_node_ids (std::vector< int > &node_ids) const |
void | compute_volume_node_ids (const int volume_selection, std::vector< int > &node_ids) const |
void | solve_homogenization_step (Eigen::MatrixXd &sol, const int t=0, bool adaptive_initial_weight=false) |
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) |
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 | |
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::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. | |
bool | solve_export_to_file = true |
flag to decide if exporting the time dependent solution to files or save it in the solution_frames array | |
std::vector< io::SolutionFrame > | solution_frames |
saves the frames in a vector instead of VTU | |
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 |
solver::CacheLevel | optimization_enabled = solver::CacheLevel::None |
solver::DiffCache | diff_cached |
std::unique_ptr< polysolve::linear::Solver > | lin_solver_cached |
Eigen::MatrixXd | initial_sol_update |
Eigen::MatrixXd | initial_vel_update |
StiffnessMatrix | basis_nodes_to_gbasis_nodes |
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 |
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 1475 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(), solve(), 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 1599 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(), solve(), 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 518 of file State.cpp.
References args, ass_vals_cache, assembler, bases, basis_nodes_to_gbasis_nodes, 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, polyfem::assembler::AssemblyValsCache::clear(), collision_mesh, polyfem::assembler::ElementAssemblyValues::compute(), polyfem::io::OutStatsData::compute_mesh_size(), polyfem::Units::convert(), polyfem::io::OutStatsData::count_flipped_elements(), polyfem::solver::Derivatives, dirichlet_nodes, dirichlet_nodes_position, disc_orders, geom_bases(), geom_bases_, geom_mesh_nodes, has_dhat, has_periodic_bc(), in_node_to_node, polyfem::assembler::AssemblyValsCache::init(), polyfem::assembler::MacroStrainValue::init(), 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, optimization_enabled, out_geom, polyfem::autogen::p_nodes_2d(), polyfem::autogen::p_nodes_3d(), 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::autogen::q_nodes_2d(), polyfem::autogen::q_nodes_3d(), polyfem::io::read_matrix(), polyfem::io::OutStatsData::reset(), rhs, starting_max_edge_length, starting_min_edge_length, stats, timings, total_local_boundary, units, use_avg_pressure, vals, and polyfem::Units::velocity().
Referenced by forward_simulation(), remesh(), and solve().
void polyfem::State::build_collision_mesh | ( | ) |
extracts the boundary mesh for collision, called in build_basis
Definition at line 1352 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 1360 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 245 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 1219 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 1056 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 256 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 1584 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 248 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 1563 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 27 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 compute_force_jacobian(), solve_linear(), solve_transient_linear(), and solve_transient_navier_stokes_split().
void polyfem::State::cache_transient_adjoint_quantities | ( | const int | current_step, |
const Eigen::MatrixXd & | sol, | ||
const Eigen::MatrixXd & | disp_grad | ||
) |
Definition at line 100 of file StateDiff.cpp.
References args, polyfem::solver::DiffCache::cache_quantities_quasistatic(), polyfem::solver::DiffCache::cache_quantities_static(), polyfem::solver::DiffCache::cache_quantities_transient(), compute_force_jacobian(), polyfem::solver::SolveData::contact_form, polyfem::solver::Derivatives, diff_cached, polyfem::solver::SolveData::friction_form, polyfem::solver::DiffCache::init(), polyfem::log_and_throw_error(), mesh, ndof(), optimization_enabled, problem, solve_data, polyfem::solver::SolveData::time_integrator, polyfem::time_integrator::ImplicitTimeIntegrator::v_prev(), and polyfem::time_integrator::BDF::weighted_sum_v_prevs().
Referenced by solve_homogenization_step(), solve_problem(), solve_transient_linear(), and solve_transient_tensor_nonlinear().
void polyfem::State::compute_errors | ( | const Eigen::MatrixXd & | sol | ) |
computes all errors
Definition at line 10 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::compute_force_jacobian | ( | const Eigen::MatrixXd & | sol, |
const Eigen::MatrixXd & | disp_grad, | ||
StiffnessMatrix & | hessian | ||
) |
Definition at line 164 of file StateDiff.cpp.
References assembler, boundary_nodes, build_stiffness_mat(), is_contact_enabled(), is_homogenization(), polyfem::log_and_throw_adjoint_error(), polyfem::solver::SolveData::nl_problem, problem, and solve_data.
Referenced by cache_transient_adjoint_quantities().
void polyfem::State::compute_force_jacobian_prev | ( | const int | force_step, |
const int | sol_step, | ||
StiffnessMatrix & | hessian_prev | ||
) | const |
Definition at line 205 of file StateDiff.cpp.
References args, ass_vals_cache, assembler, bases, polyfem::solver::DiffCache::bdf_order(), polyfem::time_integrator::BDF::betas(), polyfem::solver::SolveData::body_form, collision_mesh, polyfem::solver::SolveData::contact_form, damping_assembler, damping_prev_assembler, diff_cached, polyfem::solver::DiffCache::friction_collision_set(), polyfem::solver::SolveData::friction_form, geom_bases(), is_contact_enabled(), mesh, n_bases, ndof(), problem, solve_data, polyfem::solver::SolveData::time_integrator, polyfem::solver::DiffCache::u(), and polyfem::utils::unflatten().
Referenced by solve_transient_adjoint().
void polyfem::State::compute_surface_node_ids | ( | const int | surface_selection, |
std::vector< int > & | node_ids | ||
) | const |
Definition at line 513 of file StateDiff.cpp.
References geom_bases(), mesh, and total_local_boundary.
void polyfem::State::compute_total_surface_node_ids | ( | std::vector< int > & | node_ids | ) | const |
Definition at line 541 of file StateDiff.cpp.
References geom_bases(), mesh, and total_local_boundary.
void polyfem::State::compute_volume_node_ids | ( | const int | volume_selection, |
std::vector< int > & | node_ids | ||
) | const |
Definition at line 565 of file StateDiff.cpp.
References geom_bases(), and mesh.
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 129 of file StateOutput.cpp.
References args, polyfem::io::OutGeometryData::export_data(), is_contact_enabled(), polyfem::logger(), mesh, n_bases, out_geom, problem, resolve_output_path(), solution_frames, and solve_export_to_file.
Referenced by forward_simulation(), and solve_homogenization_step().
std::string polyfem::State::formulation | ( | ) | const |
return the formulation (checks if the problem is scalar or not and deals with multiphysics)
Definition at line 328 of file State.cpp.
References args, and polyfem::logger().
Referenced by polyfem::solver::ElasticEnergyForm::get_integral_functional(), polyfem::solver::StressNormForm::get_integral_functional(), polyfem::solver::ComplianceForm::get_integral_functional(), polyfem::solver::StressForm::get_integral_functional(), 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 223 of file State.hpp.
References bases, geom_bases_, and iso_parametric().
Referenced by polyfem::solver::AMIPSForm::AMIPSForm(), assemble_mass_mat(), polyfem::solver::BoundedBiharmonicWeights2Dto3D::BoundedBiharmonicWeights2Dto3D(), build_basis(), polyfem::solver::LayerThicknessForm::build_collision_mesh(), polyfem::solver::ProxyContactForceForm::build_collision_mesh(), build_collision_mesh(), build_collision_mesh(), build_pressure_assembler(), build_rhs_assembler(), build_stiffness_mat(), polyfem::solver::CollisionBarrierForm::CollisionBarrierForm(), compute_errors(), compute_force_jacobian_prev(), polyfem::solver::ComplianceForm::compute_partial_gradient_step(), polyfem::solver::WeightedVolumeForm::compute_partial_gradient_with_param(), polyfem::solver::AdjointTools::compute_shape_derivative_functional_term(), compute_surface_node_ids(), compute_total_surface_node_ids(), compute_volume_node_ids(), polyfem::solver::DeformedCollisionBarrierForm::DeformedCollisionBarrierForm(), polyfem::solver::AdjointTools::dJ_du_step(), polyfem::solver::AdjointTools::dJ_shape_transient_adjoint_term(), polyfem::io::OutGeometryData::export_data(), get_elements(), polyfem::solver::KineticForm::get_integral_functional(), 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(), polyfem::solver::SDFTargetForm::solution_changed_step(), polyfem::solver::MeshTargetForm::solution_changed_step(), solve_homogenization_step(), solve_linear(), solve_navier_stokes(), solve_transient_navier_stokes(), solve_transient_navier_stokes_split(), polyfem::solver::MinJacobianForm::value_unweighted(), polyfem::solver::WeightedVolumeForm::value_unweighted_with_param(), polyfem::solver::VariableToBoundaryNodes::VariableToBoundaryNodes(), and polyfem::solver::VariableToBoundaryNodesExclusive::VariableToBoundaryNodesExclusive().
|
inline |
Definition at line 669 of file State.hpp.
References polyfem::solver::DiffCache::adjoint_mat(), diff_cached, polyfem::log_and_throw_adjoint_error(), and problem.
void polyfem::State::get_elements | ( | Eigen::MatrixXi & | elements | ) | const |
Definition at line 77 of file StateDiff.cpp.
References geom_bases(), mesh, and node_to_primitive().
Referenced by polyfem::solver::AMIPSForm::AMIPSForm().
|
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 130 of file State.hpp.
References save_json().
void polyfem::State::get_vertices | ( | Eigen::MatrixXd & | vertices | ) | const |
Definition at line 69 of file StateDiff.cpp.
References mesh.
Referenced by polyfem::solver::AMIPSForm::AMIPSForm(), polyfem::solver::BoundedBiharmonicWeights2Dto3D::BoundedBiharmonicWeights2Dto3D(), polyfem::solver::CollisionBarrierForm::CollisionBarrierForm(), polyfem::solver::BoundarySmoothingForm::compute_partial_gradient(), polyfem::solver::DeformedCollisionBarrierForm::DeformedCollisionBarrierForm(), and polyfem::solver::BoundarySmoothingForm::value_unweighted().
|
inline |
Definition at line 390 of file State.hpp.
References args.
Referenced by build_basis(), iso_parametric(), solve_linear(), and solve_static_adjoint().
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::solver::Derivatives, polyfem::problem::ProblemFactory::factory(), formulation(), polyfem::problem::ProblemFactory::get_problem(), 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, optimization_enabled, polyfem::assembler::AssemblerUtils::other_assembler_name(), output_dir, pressure_assembler, problem, resolve_input_path(), resolve_output_path(), rhs, root_path(), set_max_threads(), and units.
Referenced by forward_simulation().
void polyfem::State::init_homogenization_solve | ( | const double | t | ) |
Definition at line 31 of file StateHomogenization.cpp.
References args, ass_vals_cache, assembler, avg_mass, bases, boundary_nodes, collision_mesh, polyfem::solver::Derivatives, elasticity_pressure_assembler, geom_bases(), polyfem::assembler::MacroStrainValue::get_fixed_entry(), 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_collision_mesh, periodic_collision_mesh_to_basis, polyfem::solver::SolveData::periodic_contact_form, rhs, polyfem::solver::SolveData::rhs_assembler, solve_data, polyfem::solver::SolveData::strain_al_lagr_form, polyfem::solver::SolveData::strain_al_pen_form, and units.
Referenced by solve_homogenization().
void polyfem::State::init_linear_solve | ( | Eigen::MatrixXd & | sol, |
const double | t = 1.0 |
||
) |
initialize the linear solve
[in] | t | (optional) initial time |
Definition at line 163 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, 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 |
||
) |
initialize the nonlinear solver
[out] | sol | solution |
[in] | t | (optional) initial time |
Definition at line 139 of file StateSolveNonlinear.cpp.
References 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, polyfem::solver::Derivatives, elasticity_pressure_assembler, geom_bases(), polyfem::solver::SolveData::init_forms(), initial_acceleration(), initial_sol_update, initial_solution(), initial_vel_update, initial_velocity(), is_contact_enabled(), local_boundary, local_neumann_boundary, local_pressure_boundary, local_pressure_cavity, polyfem::log_and_throw_error(), 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, polyfem::solver::None, obstacle, optimization_enabled, output_dir, periodic_bc, periodic_collision_mesh, periodic_collision_mesh_to_basis, POLYFEM_SCOPED_TIMER, problem, resolve_output_path(), rhs, polyfem::solver::SolveData::rhs_assembler, 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 | ||
) |
initialize solver
[out] | sol | solution |
[out] | pressure | pressure |
Definition at line 12 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 334 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 |
Load or compute the initial acceleration.
[out] | solution | Output acceleration variable. |
Definition at line 103 of file StateSolve.cpp.
References args, in_node_to_node, mesh, 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 |
Load or compute the initial solution.
[out] | solution | Output solution variable. |
Definition at line 69 of file StateSolve.cpp.
References args, in_node_to_node, mesh, problem, resolve_input_path(), rhs, polyfem::solver::SolveData::rhs_assembler, 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 |
Load or compute the initial velocity.
[out] | solution | Output velocity variable. |
Definition at line 90 of file StateSolve.cpp.
References args, in_node_to_node, mesh, 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().
|
inline |
does the simulation has contact
Definition at line 551 of file State.hpp.
References args.
Referenced by build_basis(), compute_force_jacobian(), compute_force_jacobian_prev(), 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 711 of file State.hpp.
References args.
Referenced by compute_force_jacobian(), solve_problem(), and solve_static_adjoint().
|
inline |
checks if vertex is obstacle
[in] | vi | vertex index |
Definition at line 542 of file State.hpp.
References collision_mesh, polyfem::mesh::Obstacle::n_vertices(), and obstacle.
|
inline |
does the simulation has pressure
Definition at line 559 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 410 of file State.hpp.
References assembler, is_contact_enabled(), and is_pressure_enabled().
Referenced by solve_problem().
bool polyfem::State::iso_parametric | ( | ) | const |
check if using iso parametric bases
Definition at line 477 of file State.cpp.
References args, polyfem::solver::Derivatives, has_periodic_bc(), mesh, and optimization_enabled.
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 491 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 36 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 263 of file State.hpp.
References args, disc_orders, mesh, and polyfem::assembler::AssemblerUtils::quadrature_order().
Referenced by assemble_rhs(), polyfem::solver::LayerThicknessForm::build_collision_mesh(), polyfem::solver::ProxyContactForceForm::build_collision_mesh(), 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 653 of file State.hpp.
References mesh, mixed_assembler, n_bases, n_pressure_bases, and problem.
Referenced by cache_transient_adjoint_quantities(), 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(), compute_force_jacobian_prev(), polyfem::solver::AdjointTools::dJ_friction_transient_adjoint_term(), polyfem::solver::AdjointTools::dJ_initial_condition_adjoint_term(), init_homogenization_solve(), init_linear_solve(), init_nonlinear_tensor_solve(), remesh(), solve_homogenization_step(), solve_static_adjoint(), and solve_transient_adjoint().
std::vector< int > polyfem::State::node_to_primitive | ( | ) | const |
Definition at line 235 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 228 of file State.cpp.
References geom_mesh_nodes, iso_parametric(), mesh, and mesh_nodes.
Referenced by build_pressure_assembler(), polyfem::solver::SpatialIntegralForm::compute_partial_gradient_step(), 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::PeriodicContactForm::force_periodic_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 32 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 37 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 25 of file StateOutput.cpp.
References args, and polyfem::utils::is_param_valid().
Referenced by assemble_rhs(), 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 70 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 86 of file StateOutput.cpp.
References args, assembler, disc_orders, 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 178 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 110 of file StateOutput.cpp.
References args, is_contact_enabled(), mesh, out_geom, problem, resolve_output_path(), polyfem::io::OutGeometryData::save_vtu(), solution_frames, and solve_export_to_file.
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 46 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(), polyfem::io::OutGeometryData::save_vtu(), solution_frames, and solve_export_to_file.
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 505 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 418 of file StateInit.cpp.
References args, assembler, polyfem::mesh::Mesh3D::compute_cell_jacobian(), polyfem::mesh::Mesh2D::compute_face_jacobian(), 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 329 of file StateInit.cpp.
References polyfem::utils::NThread::get(), and polyfem::utils::NThread::set_num_threads().
Referenced by init().
void polyfem::State::set_mesh_vertex | ( | int | v_id, |
const Eigen::VectorXd & | vertex | ||
) |
Definition at line 94 of file StateDiff.cpp.
References mesh.
|
private |
splits the solution in solution and pressure for mixed problems
[in/out] | sol solution | |
[out] | pressure | pressure |
Definition at line 386 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 |
solves the problem, call other methods
[out] | sol | solution |
[out] | pressure | pressure |
Definition at line 303 of file State.hpp.
References assemble_mass_mat(), assemble_rhs(), build_basis(), polyfem::io::OutStatsData::compute_mesh_stats(), polyfem::logger(), mesh, solution_frames, solve_export_to_file, solve_problem(), and stats.
Eigen::MatrixXd polyfem::State::solve_adjoint | ( | const Eigen::MatrixXd & | rhs | ) | const |
Definition at line 325 of file StateDiff.cpp.
References problem, rhs, solve_static_adjoint(), and solve_transient_adjoint().
Referenced by solve_adjoint_cached().
void polyfem::State::solve_adjoint_cached | ( | const Eigen::MatrixXd & | rhs | ) |
Definition at line 320 of file StateDiff.cpp.
References polyfem::solver::DiffCache::cache_adjoints(), diff_cached, rhs, and solve_adjoint().
void polyfem::State::solve_homogenization | ( | const int | time_steps, |
const double | t0, | ||
const double | dt, | ||
Eigen::MatrixXd & | sol | ||
) |
Definition at line 275 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 | ( | Eigen::MatrixXd & | sol, |
const int | t = 0 , |
||
bool | adaptive_initial_weight = false |
||
) |
In Elasticity PDE, solve for "min W(disp_grad + \grad u)" instead of "min W(\grad u)".
Definition at line 121 of file StateHomogenization.cpp.
References args, bases, cache_transient_adjoint_quantities(), polyfem::assembler::MacroStrainValue::eval(), export_data(), 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, polyfem::solver::None, optimization_enabled, solve_data, polyfem::solver::SolveData::strain_al_lagr_form, polyfem::solver::SolveData::strain_al_pen_form, polyfem::utils::unflatten(), and x.
Referenced by solve_homogenization().
void polyfem::State::solve_linear | ( | const std::unique_ptr< polysolve::linear::Solver > & | solver, |
StiffnessMatrix & | A, | ||
Eigen::VectorXd & | b, | ||
const bool | compute_spectrum, | ||
Eigen::MatrixXd & | sol, | ||
Eigen::MatrixXd & | pressure | ||
) |
Solve the linear problem with the given solver and system.
solver | Linear solver. | |
A | Linear system matrix. | |
b | Right-hand side. | |
compute_spectrum | If true, compute the spectrum. | |
[out] | sol | solution |
[out] | pressure | pressure |
Definition at line 69 of file StateSolveLinear.cpp.
References args, assembler, bases, boundary_nodes, polyfem::solver::Derivatives, geom_bases(), has_periodic_bc(), polyfem::io::Evaluator::integrate_function(), is_contact_enabled(), polyfem::logger(), mesh, mixed_assembler, n_bases, optimization_enabled, 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 | ( | Eigen::MatrixXd & | sol, |
Eigen::MatrixXd & | pressure | ||
) |
solves a linear problem
[out] | sol | solution |
[out] | pressure | pressure |
Definition at line 134 of file StateSolveLinear.cpp.
References args, assembler, boundary_nodes, build_stiffness_mat(), is_contact_enabled(), lin_solver_cached, local_boundary, local_neumann_boundary, polyfem::logger(), n_boundary_samples(), problem, rhs, polyfem::solver::SolveData::rhs_assembler, solve_data, and solve_linear().
Referenced by solve_linear(), solve_problem(), and solve_transient_linear().
void polyfem::State::solve_navier_stokes | ( | Eigen::MatrixXd & | sol, |
Eigen::MatrixXd & | pressure | ||
) |
solves a navier stokes
[out] | sol | solution |
[out] | pressure | pressure |
Definition at line 20 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 | ||
) |
solves the problems
[out] | sol | solution |
[out] | pressure | pressure |
Definition at line 1671 of file State.cpp.
References args, assembler, cache_transient_adjoint_quantities(), init_linear_solve(), init_nonlinear_tensor_solve(), init_solve(), is_homogenization(), is_problem_linear(), polyfem::logger(), mesh, n_bases, polyfem::solver::None, optimization_enabled, 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(), solve(), and polyfem::solver::AdjointOptUtils::solve_pde().
Eigen::MatrixXd polyfem::State::solve_static_adjoint | ( | const Eigen::MatrixXd & | adjoint_rhs | ) | const |
Definition at line 333 of file StateDiff.cpp.
References polyfem::adjoint_logger(), args, boundary_nodes, diff_cached, polyfem::solver::DiffCache::gradu_h(), has_periodic_bc(), is_homogenization(), lin_solver_cached, mesh, n_bases, ndof(), polyfem::solver::SolveData::nl_problem, periodic_bc, problem, solve_data, and x.
Referenced by solve_adjoint().
void polyfem::State::solve_tensor_nonlinear | ( | Eigen::MatrixXd & | sol, |
const int | t = 0 , |
||
const bool | init_lagging = true |
||
) |
solves nonlinear problems
[out] | sol | solution |
[in] | t | (optional) time step id |
Definition at line 279 of file StateSolveNonlinear.cpp.
References polyfem::solver::SolveData::al_lagr_form, polyfem::solver::SolveData::al_pen_form, args, polyfem::Units::characteristic_length(), polyfem::solver::Derivatives, polyfem::solver::NLProblem::full_to_reduced(), polyfem::solver::NLProblem::gradient(), polyfem::solver::FullNLProblem::init(), polyfem::solver::NLProblem::init_lagging(), polyfem::logger(), make_nl_solver(), polyfem::solver::FullNLProblem::max_lagging_iterations(), polyfem::solver::SolveData::nl_problem, 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().
Eigen::MatrixXd polyfem::State::solve_transient_adjoint | ( | const Eigen::MatrixXd & | adjoint_rhs | ) | const |
Definition at line 420 of file StateDiff.cpp.
References polyfem::adjoint_logger(), polyfem::time_integrator::BDF::alphas(), args, polyfem::solver::DiffCache::bdf_order(), polyfem::time_integrator::BDF::betas(), boundary_nodes, compute_force_jacobian_prev(), diff_cached, polyfem::solver::DiffCache::gradu_h(), polyfem::log_and_throw_adjoint_error(), mass, ndof(), and x.
Referenced by solve_adjoint().
void polyfem::State::solve_transient_linear | ( | const int | time_steps, |
const double | t0, | ||
const double | dt, | ||
Eigen::MatrixXd & | sol, | ||
Eigen::MatrixXd & | pressure | ||
) |
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 |
Definition at line 219 of file StateSolveLinear.cpp.
References args, assembler, boundary_nodes, build_stiffness_mat(), cache_transient_adjoint_quantities(), 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_adjoint_error(), polyfem::logger(), mass, mass_matrix_assembler, mesh, mixed_assembler, n_boundary_samples(), n_pressure_bases, polyfem::solver::None, optimization_enabled, 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 | ||
) |
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 |
Definition at line 169 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 | ||
) |
solves transient navier stokes with operator splitting
[in] | time_steps | number of time steps |
[in] | dt | timestep size |
[out] | sol | solution |
[out] | pressure | pressure |
Definition at line 53 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 | ||
) |
solves transient tensor nonlinear problem
[in] | time_steps | number of time steps |
[in] | t0 | initial times |
[in] | dt | timestep size |
[out] | sol | solution |
Definition at line 41 of file StateSolveNonlinear.cpp.
References args, build_mesh_matrices(), cache_transient_adjoint_quantities(), polyfem::F, init_nonlinear_tensor_solve(), polyfem::logger(), mesh, polyfem::solver::SolveData::nl_problem, polyfem::solver::None, optimization_enabled, POLYFEM_SCOPED_TIMER, remesh(), resolve_output_path(), save_restart_json(), save_timestep(), solve_data, solve_tensor_nonlinear(), polyfem::solver::SolveData::time_integrator, polyfem::solver::SolveData::update_barrier_stiffness(), polyfem::solver::SolveData::update_dt(), V, polyfem::io::EnergyCSVWriter::write(), polyfem::io::RuntimeStatsCSVWriter::write(), and polyfem::io::MshWriter::write().
Referenced by solve_problem().
json polyfem::State::args |
main input arguments containing all defaults
Definition at line 101 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(), cache_transient_adjoint_quantities(), polyfem::solver::CollisionBarrierForm::CollisionBarrierForm(), compute_errors(), compute_force_jacobian_prev(), polyfem::solver::ComplianceForm::compute_partial_gradient_step(), polyfem::solver::AdjointTools::compute_shape_derivative_functional_term(), polyfem::solver::DeformedCollisionBarrierForm::DeformedCollisionBarrierForm(), 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_contact_enabled(), is_homogenization(), is_pressure_enabled(), iso_parametric(), load_mesh(), load_mesh(), make_nl_solver(), n_boundary_samples(), polyfem::mesh::Remesher::project_quantities(), polyfem::solver::ProxyContactForceForm::ProxyContactForceForm(), 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_static_adjoint(), solve_tensor_nonlinear(), solve_transient_adjoint(), solve_transient_linear(), solve_transient_navier_stokes(), solve_transient_navier_stokes_split(), solve_transient_tensor_nonlinear(), and polyfem::solver::MaxStressForm::value_unweighted_step().
assembler::AssemblyValsCache polyfem::State::ass_vals_cache |
used to store assembly values for small problems
Definition at line 196 of file State.hpp.
Referenced by build_basis(), build_stiffness_mat(), compute_force_jacobian_prev(), polyfem::solver::ComplianceForm::compute_partial_gradient_step(), polyfem::solver::WeightedVolumeForm::compute_partial_gradient_with_param(), polyfem::solver::AdjointTools::compute_shape_derivative_functional_term(), polyfem::solver::AdjointTools::dJ_du_step(), init_homogenization_solve(), init_linear_solve(), init_nonlinear_tensor_solve(), polyfem::solver::AdjointTools::integrate_objective(), polyfem::io::OutGeometryData::save_volume(), solve_navier_stokes(), solve_transient_navier_stokes(), solve_transient_navier_stokes_split(), and polyfem::solver::WeightedVolumeForm::value_unweighted_with_param().
std::shared_ptr<assembler::Assembler> polyfem::State::assembler = nullptr |
assemblers
assembler corresponding to governing physical equations
Definition at line 155 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(), compute_force_jacobian(), compute_force_jacobian_prev(), polyfem::solver::ComplianceForm::compute_partial_gradient_step(), polyfem::solver::AdjointTools::compute_shape_derivative_functional_term(), polyfem::solver::AdjointTools::dJ_du_step(), 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 204 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 171 of file State.hpp.
Referenced by assemble_mass_mat(), polyfem::solver::BoundedBiharmonicWeights2Dto3D::BoundedBiharmonicWeights2Dto3D(), build_basis(), polyfem::solver::ProxyContactForceForm::build_collision_mesh(), 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(), compute_force_jacobian_prev(), polyfem::solver::ComplianceForm::compute_partial_gradient_step(), polyfem::solver::WeightedVolumeForm::compute_partial_gradient_with_param(), 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(), polyfem::io::OutGeometryData::export_data(), geom_bases(), polyfem::solver::KineticForm::get_integral_functional(), 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(), polyfem::solver::TargetForm::set_reference(), polyfem::solver::SDFTargetForm::solution_changed_step(), polyfem::solver::MeshTargetForm::solution_changed_step(), solve_homogenization_step(), solve_linear(), solve_navier_stokes(), solve_transient_navier_stokes(), solve_transient_navier_stokes_split(), polyfem::solver::MaxStressForm::value_unweighted_step(), polyfem::solver::WeightedVolumeForm::value_unweighted_with_param(), polyfem::solver::VariableToBoundaryNodes::VariableToBoundaryNodes(), and polyfem::solver::VariableToBoundaryNodesExclusive::VariableToBoundaryNodesExclusive().
StiffnessMatrix polyfem::State::basis_nodes_to_gbasis_nodes |
Definition at line 699 of file State.hpp.
Referenced by build_basis(), polyfem::solver::ProxyContactForceForm::compute_partial_gradient_step(), 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::PeriodicContactForm::force_periodic_shape_derivative(), and polyfem::solver::NLHomoProblem::reduced_to_full_shape_derivative().
std::vector<int> polyfem::State::boundary_nodes |
list of boundary nodes
Definition at line 427 of file State.hpp.
Referenced by build_basis(), build_pressure_assembler(), compute_force_jacobian(), polyfem::solver::AdjointTools::dJ_damping_transient_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_transient_adjoint_term(), polyfem::solver::AdjointTools::dJ_pressure_transient_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_static_adjoint(), solve_transient_adjoint(), 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 515 of file State.hpp.
Referenced by build_basis(), build_collision_mesh(), build_collision_mesh(), build_periodic_collision_mesh(), compute_force_jacobian_prev(), 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 142 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 164 of file State.hpp.
Referenced by compute_force_jacobian_prev(), and init_nonlinear_tensor_solve().
std::shared_ptr<assembler::ViscousDampingPrev> polyfem::State::damping_prev_assembler = nullptr |
Definition at line 165 of file State.hpp.
Referenced by compute_force_jacobian_prev(), and init_nonlinear_tensor_solve().
solver::DiffCache polyfem::State::diff_cached |
Definition at line 649 of file State.hpp.
Referenced by cache_transient_adjoint_quantities(), polyfem::solver::AdjointForm::compute_adjoint_rhs(), polyfem::solver::StaticForm::compute_adjoint_rhs(), polyfem::solver::MinTargetDistForm::compute_adjoint_rhs(), polyfem::solver::SpatialIntegralForm::compute_adjoint_rhs_step(), polyfem::solver::ProxyContactForceForm::compute_adjoint_rhs_step(), polyfem::solver::NodeTargetForm::compute_adjoint_rhs_step(), compute_force_jacobian_prev(), polyfem::solver::SpatialIntegralForm::compute_partial_gradient_step(), polyfem::solver::ComplianceForm::compute_partial_gradient_step(), polyfem::solver::ProxyContactForceForm::compute_partial_gradient_step(), polyfem::solver::AdjointTools::dJ_damping_transient_adjoint_term(), polyfem::solver::AdjointTools::dJ_friction_transient_adjoint_term(), polyfem::solver::AdjointTools::dJ_material_transient_adjoint_term(), polyfem::solver::AdjointTools::dJ_periodic_shape_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(), get_adjoint_mat(), polyfem::solver::KineticForm::get_integral_functional(), polyfem::solver::DeformedCollisionBarrierForm::get_updated_mesh_nodes(), solve_adjoint_cached(), solve_static_adjoint(), solve_transient_adjoint(), polyfem::solver::SpatialIntegralForm::value_unweighted_step(), polyfem::solver::ProxyContactForceForm::value_unweighted_step(), and polyfem::solver::NodeTargetForm::value_unweighted_step().
std::vector<int> polyfem::State::dirichlet_nodes |
per node dirichlet
Definition at line 443 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 444 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 190 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().
std::shared_ptr<assembler::PressureAssembler> polyfem::State::elasticity_pressure_assembler = nullptr |
Definition at line 162 of file State.hpp.
Referenced by init_homogenization_solve(), and init_nonlinear_tensor_solve().
|
private |
Definition at line 143 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 175 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 193 of file State.hpp.
Referenced by build_basis(), and primitive_to_node().
bool polyfem::State::has_dhat = false |
stores if input json contains dhat
Definition at line 566 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 450 of file State.hpp.
Referenced by build_basis(), build_collision_mesh(), build_collision_mesh(), build_node_mapping(), polyfem::solver::CollisionBarrierForm::CollisionBarrierForm(), polyfem::solver::DeformedCollisionBarrierForm::DeformedCollisionBarrierForm(), polyfem::io::OutGeometryData::export_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 452 of file State.hpp.
Referenced by build_node_mapping().
Eigen::MatrixXd polyfem::State::initial_sol_update |
Definition at line 697 of file State.hpp.
Referenced by init_nonlinear_tensor_solve().
Eigen::MatrixXd polyfem::State::initial_vel_update |
Definition at line 697 of file State.hpp.
Referenced by polyfem::solver::AdjointTools::dJ_friction_transient_adjoint_term(), and init_nonlinear_tensor_solve().
std::unique_ptr<polysolve::linear::Solver> polyfem::State::lin_solver_cached |
Definition at line 651 of file State.hpp.
Referenced by polyfem::solver::AdjointForm::compute_reduced_adjoint_rhs(), solve_linear(), and solve_static_adjoint().
std::vector<mesh::LocalBoundary> polyfem::State::local_boundary |
mapping from elements to nodes for dirichlet boundary conditions
Definition at line 433 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 435 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 437 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 439 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 705 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 202 of file State.hpp.
Referenced by assemble_mass_mat(), init_homogenization_solve(), init_linear_solve(), init_nonlinear_tensor_solve(), reset_mesh(), solve_transient_adjoint(), solve_transient_linear(), and solve_transient_navier_stokes_split().
assembler::AssemblyValsCache polyfem::State::mass_ass_vals_cache |
Definition at line 197 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 157 of file State.hpp.
Referenced by assemble_mass_mat(), assemble_rhs(), polyfem::solver::AdjointTools::dJ_shape_transient_adjoint_term(), polyfem::solver::KineticForm::get_integral_functional(), 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 466 of file State.hpp.
Referenced by polyfem::solver::AMIPSForm::AMIPSForm(), assemble_mass_mat(), assemble_rhs(), boundary_conditions_ids(), polyfem::solver::BoundarySmoothingForm::BoundarySmoothingForm(), polyfem::solver::BoundedBiharmonicWeights2Dto3D::BoundedBiharmonicWeights2Dto3D(), build_basis(), polyfem::solver::LayerThicknessForm::build_collision_mesh(), polyfem::solver::ProxyContactForceForm::build_collision_mesh(), 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(), cache_transient_adjoint_quantities(), polyfem::solver::CollisionBarrierForm::CollisionBarrierForm(), polyfem::solver::NodeTargetForm::compute_adjoint_rhs_step(), compute_errors(), compute_force_jacobian_prev(), polyfem::solver::AMIPSForm::compute_partial_gradient(), polyfem::solver::CollisionBarrierForm::compute_partial_gradient(), polyfem::solver::DeformedCollisionBarrierForm::compute_partial_gradient(), polyfem::solver::BoundarySmoothingForm::compute_partial_gradient(), polyfem::solver::SpatialIntegralForm::compute_partial_gradient_step(), polyfem::solver::ComplianceForm::compute_partial_gradient_step(), polyfem::solver::WeightedVolumeForm::compute_partial_gradient_with_param(), polyfem::solver::AdjointTools::compute_shape_derivative_functional_term(), compute_surface_node_ids(), compute_total_surface_node_ids(), compute_volume_node_ids(), polyfem::solver::NLHomoProblem::constraint_grad(), polyfem::solver::DeformedCollisionBarrierForm::DeformedCollisionBarrierForm(), 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(), polyfem::solver::KineticForm::get_integral_functional(), polyfem::solver::StressForm::get_integral_functional(), polyfem::solver::TargetForm::get_integral_functional(), 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(), polyfem::solver::CollisionBarrierForm::is_step_collision_free(), polyfem::solver::AMIPSForm::is_step_valid(), iso_parametric(), load_mesh(), load_mesh(), load_mesh(), polyfem::solver::AdjointTools::map_node_to_primitive_order(), polyfem::solver::AdjointTools::map_primitive_to_node_order(), polyfem::solver::CollisionBarrierForm::max_step_size(), n_boundary_samples(), ndof(), polyfem::solver::NodeTargetForm::NodeTargetForm(), primitive_to_node(), polyfem::solver::NLHomoProblem::reduced_to_disp_grad(), polyfem::solver::NLHomoProblem::reduced_to_extended(), polyfem::solver::NLHomoProblem::reduced_to_full(), polyfem::solver::NLHomoProblem::reduced_to_full_shape_derivative(), 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::SDFTargetForm::set_bspline_target(), polyfem::solver::SDFTargetForm::set_bspline_target(), polyfem::solver::NLHomoProblem::set_fixed_entry(), set_materials(), set_materials(), set_mesh_vertex(), polyfem::solver::DirichletVariableToSimulation::set_output_indexing(), polyfem::solver::TargetForm::set_reference(), polyfem::solver::MeshTargetForm::set_surface_mesh_target(), sol_to_pressure(), polyfem::solver::CollisionBarrierForm::solution_changed(), polyfem::solver::DeformedCollisionBarrierForm::solution_changed(), solve(), solve_homogenization(), solve_homogenization_step(), solve_linear(), solve_navier_stokes(), solve_problem(), solve_static_adjoint(), solve_transient_linear(), solve_transient_navier_stokes(), solve_transient_navier_stokes_split(), solve_transient_tensor_nonlinear(), polyfem::solver::MinJacobianForm::value_unweighted(), polyfem::solver::AMIPSForm::value_unweighted(), polyfem::solver::CollisionBarrierForm::value_unweighted(), polyfem::solver::DeformedCollisionBarrierForm::value_unweighted(), polyfem::solver::BoundarySmoothingForm::value_unweighted(), polyfem::solver::NodeTargetForm::value_unweighted_step(), polyfem::solver::WeightedVolumeForm::value_unweighted_with_param(), polyfem::solver::VariableToBoundaryNodes::VariableToBoundaryNodes(), polyfem::solver::VariableToBoundaryNodesExclusive::VariableToBoundaryNodesExclusive(), polyfem::solver::VariableToInteriorNodes::VariableToInteriorNodes(), polyfem::solver::VariableToNodes::VariableToNodes(), and polyfem::io::RuntimeStatsCSVWriter::write().
std::shared_ptr<polyfem::mesh::MeshNodes> polyfem::State::mesh_nodes |
Mapping from input nodes to FE nodes.
Definition at line 193 of file State.hpp.
Referenced by build_basis(), build_node_mapping(), polyfem::solver::NodeTargetForm::compute_adjoint_rhs_step(), 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(), polyfem::solver::NodeTargetForm::NodeTargetForm(), primitive_to_node(), polyfem::solver::NLHomoProblem::reduced_to_full(), solve_homogenization(), and polyfem::solver::NodeTargetForm::value_unweighted_step().
double polyfem::State::min_boundary_edge_length = -1 |
Definition at line 588 of file State.hpp.
Referenced by build_basis().
std::shared_ptr<assembler::MixedAssembler> polyfem::State::mixed_assembler = nullptr |
Definition at line 159 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 178 of file State.hpp.
Referenced by assemble_mass_mat(), assemble_rhs(), build_basis(), polyfem::solver::ProxyContactForceForm::build_collision_mesh(), 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(), compute_force_jacobian_prev(), polyfem::solver::NLHomoProblem::constraint_grad(), polyfem::solver::DeformedCollisionBarrierForm::DeformedCollisionBarrierForm(), 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(), polyfem::solver::NLHomoProblem::reduced_to_full_shape_derivative(), 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_static_adjoint(), 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 182 of file State.hpp.
Referenced by build_basis(), polyfem::solver::LayerThicknessForm::build_collision_mesh(), polyfem::solver::CollisionBarrierForm::CollisionBarrierForm(), polyfem::solver::AMIPSForm::compute_partial_gradient(), polyfem::solver::AdjointTools::compute_shape_derivative_functional_term(), polyfem::solver::DeformedCollisionBarrierForm::DeformedCollisionBarrierForm(), 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::PeriodicContactForm::force_periodic_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 180 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 446 of file State.hpp.
Referenced by build_basis(), and build_rhs_assembler().
std::vector<RowVectorNd> polyfem::State::neumann_nodes_position |
Definition at line 447 of file State.hpp.
Referenced by build_basis(), and build_rhs_assembler().
mesh::Obstacle polyfem::State::obstacle |
Obstacles used in collisions.
Definition at line 468 of file State.hpp.
Referenced by build_basis(), build_collision_mesh(), build_collision_mesh(), build_mesh_matrices(), build_pressure_assembler(), build_rhs_assembler(), polyfem::solver::CollisionBarrierForm::CollisionBarrierForm(), polyfem::solver::DeformedCollisionBarrierForm::DeformedCollisionBarrierForm(), 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().
solver::CacheLevel polyfem::State::optimization_enabled = solver::CacheLevel::None |
Definition at line 647 of file State.hpp.
Referenced by build_basis(), cache_transient_adjoint_quantities(), init(), init_homogenization_solve(), init_nonlinear_tensor_solve(), iso_parametric(), solve_homogenization_step(), solve_linear(), solve_problem(), solve_tensor_nonlinear(), solve_transient_linear(), and solve_transient_tensor_nonlinear().
io::OutGeometryData polyfem::State::out_geom |
visualization stuff
Definition at line 581 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 573 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 389 of file State.hpp.
Referenced by build_basis(), build_periodic_collision_mesh(), init_nonlinear_tensor_solve(), solve_linear(), and solve_static_adjoint().
ipc::CollisionMesh polyfem::State::periodic_collision_mesh |
IPC collision mesh under periodic BC.
Definition at line 518 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 520 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 441 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 185 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 187 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 199 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 160 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 173 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 429 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 193 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 168 of file State.hpp.
Referenced by assemble_mass_mat(), assemble_rhs(), build_basis(), build_pressure_assembler(), build_rhs_assembler(), build_stiffness_mat(), cache_transient_adjoint_quantities(), compute_errors(), compute_force_jacobian(), compute_force_jacobian_prev(), polyfem::solver::ComplianceForm::compute_partial_gradient_step(), 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(), get_adjoint_mat(), polyfem::solver::KineticForm::get_integral_functional(), 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(), polyfem::solver::ProxyContactForceForm::ProxyContactForceForm(), 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(), polyfem::solver::SDFTargetForm::solution_changed_step(), polyfem::solver::MeshTargetForm::solution_changed_step(), solve_adjoint(), solve_linear(), solve_linear(), solve_navier_stokes(), solve_problem(), solve_static_adjoint(), solve_transient_linear(), solve_transient_navier_stokes(), solve_transient_navier_stokes_split(), State(), and polyfem::solver::MaxStressForm::value_unweighted_step().
Eigen::MatrixXd polyfem::State::rhs |
System right-hand side.
Definition at line 207 of file State.hpp.
Referenced by assemble_rhs(), build_basis(), build_polygonal_basis(), polyfem::io::OutGeometryData::export_data(), init(), init_homogenization_solve(), init_linear_solve(), init_nonlinear_tensor_solve(), init_solve(), initial_solution(), reset_mesh(), polyfem::io::OutGeometryData::save_vtu(), solve_adjoint(), solve_adjoint_cached(), solve_linear(), solve_navier_stokes(), solve_tensor_nonlinear(), solve_transient_linear(), and solve_transient_navier_stokes().
std::vector<io::SolutionFrame> polyfem::State::solution_frames |
saves the frames in a vector instead of VTU
Definition at line 579 of file State.hpp.
Referenced by export_data(), save_subsolve(), save_timestep(), and solve().
solver::SolveData polyfem::State::solve_data |
timedependent stuff cached
Definition at line 324 of file State.hpp.
Referenced by assemble_rhs(), cache_transient_adjoint_quantities(), polyfem::solver::ProxyContactForceForm::compute_adjoint_rhs_step(), compute_force_jacobian(), compute_force_jacobian_prev(), polyfem::solver::SpatialIntegralForm::compute_partial_gradient_step(), polyfem::solver::ProxyContactForceForm::compute_partial_gradient_step(), 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_static_adjoint(), solve_tensor_nonlinear(), solve_transient_linear(), solve_transient_navier_stokes(), solve_transient_navier_stokes_split(), solve_transient_tensor_nonlinear(), and polyfem::solver::ProxyContactForceForm::value_unweighted_step().
bool polyfem::State::solve_export_to_file = true |
flag to decide if exporting the time dependent solution to files or save it in the solution_frames array
Definition at line 577 of file State.hpp.
Referenced by export_data(), save_subsolve(), save_timestep(), and solve().
double polyfem::State::starting_max_edge_length = -1 |
Definition at line 587 of file State.hpp.
Referenced by build_basis().
double polyfem::State::starting_min_edge_length = -1 |
Definition at line 586 of file State.hpp.
Referenced by build_basis(), and save_restart_json().
io::OutStatsData polyfem::State::stats |
Other statistics.
Definition at line 585 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(), solve_linear(), solve_problem(), and solve_tensor_nonlinear().
io::OutRuntimeData polyfem::State::timings |
runtime statistics
Definition at line 583 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 431 of file State.hpp.
Referenced by polyfem::solver::BoundedBiharmonicWeights2Dto3D::BoundedBiharmonicWeights2Dto3D(), build_basis(), polyfem::solver::LayerThicknessForm::build_collision_mesh(), polyfem::solver::ProxyContactForceForm::build_collision_mesh(), build_collision_mesh(), build_collision_mesh(), polyfem::solver::CollisionBarrierForm::CollisionBarrierForm(), polyfem::solver::AdjointTools::compute_shape_derivative_functional_term(), compute_surface_node_ids(), compute_total_surface_node_ids(), polyfem::solver::DeformedCollisionBarrierForm::DeformedCollisionBarrierForm(), polyfem::solver::AdjointTools::dJ_du_step(), polyfem::solver::AdjointTools::integrate_objective(), polyfem::io::OutGeometryData::save_surface(), polyfem::solver::SDFTargetForm::solution_changed_step(), polyfem::solver::MeshTargetForm::solution_changed_step(), polyfem::solver::VariableToBoundaryNodes::VariableToBoundaryNodes(), and polyfem::solver::VariableToBoundaryNodesExclusive::VariableToBoundaryNodesExclusive().
Units polyfem::State::units |
Definition at line 150 of file State.hpp.
Referenced by polyfem::solver::AMIPSForm::AMIPSForm(), 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 211 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().