PolyFEM
|
Functions | |
double | integrate_objective (const State &state, const IntegrableFunctional &j, const Eigen::MatrixXd &solution, const std::set< int > &interested_ids, const SpatialIntegralType spatial_integral_type, const int cur_step=0) |
void | dJ_du_step (const State &state, const IntegrableFunctional &j, const Eigen::MatrixXd &solution, const std::set< int > &interested_ids, const SpatialIntegralType spatial_integral_type, const int cur_step, Eigen::VectorXd &term) |
void | compute_shape_derivative_functional_term (const State &state, const Eigen::MatrixXd &solution, const IntegrableFunctional &j, const std::set< int > &interested_ids, const SpatialIntegralType spatial_integral_type, Eigen::VectorXd &term, const int cur_time_step) |
void | dJ_shape_static_adjoint_term (const State &state, const Eigen::MatrixXd &sol, const Eigen::MatrixXd &adjoint, Eigen::VectorXd &one_form) |
void | dJ_shape_homogenization_adjoint_term (const State &state, const Eigen::MatrixXd &sol, const Eigen::MatrixXd &adjoint, Eigen::VectorXd &one_form) |
void | dJ_periodic_shape_adjoint_term (const State &state, const PeriodicMeshToMesh &periodic_mesh_map, const Eigen::VectorXd &periodic_mesh_representation, const Eigen::MatrixXd &sol, const Eigen::MatrixXd &adjoint, Eigen::VectorXd &one_form) |
void | dJ_shape_transient_adjoint_term (const State &state, const Eigen::MatrixXd &adjoint_nu, const Eigen::MatrixXd &adjoint_p, Eigen::VectorXd &one_form) |
void | dJ_material_static_adjoint_term (const State &state, const Eigen::MatrixXd &sol, const Eigen::MatrixXd &adjoint, Eigen::VectorXd &one_form) |
void | dJ_material_transient_adjoint_term (const State &state, const Eigen::MatrixXd &adjoint_nu, const Eigen::MatrixXd &adjoint_p, Eigen::VectorXd &one_form) |
void | dJ_friction_transient_adjoint_term (const State &state, const Eigen::MatrixXd &adjoint_nu, const Eigen::MatrixXd &adjoint_p, Eigen::VectorXd &one_form) |
void | dJ_damping_transient_adjoint_term (const State &state, const Eigen::MatrixXd &adjoint_nu, const Eigen::MatrixXd &adjoint_p, Eigen::VectorXd &one_form) |
void | dJ_initial_condition_adjoint_term (const State &state, const Eigen::MatrixXd &adjoint_nu, const Eigen::MatrixXd &adjoint_p, Eigen::VectorXd &one_form) |
void | dJ_dirichlet_transient_adjoint_term (const State &state, const Eigen::MatrixXd &adjoint_nu, const Eigen::MatrixXd &adjoint_p, Eigen::VectorXd &one_form) |
void | dJ_pressure_static_adjoint_term (const State &state, const std::vector< int > &boundary_ids, const Eigen::MatrixXd &sol, const Eigen::MatrixXd &adjoint, Eigen::VectorXd &one_form) |
void | dJ_pressure_transient_adjoint_term (const State &state, const std::vector< int > &boundary_ids, const Eigen::MatrixXd &adjoint_nu, const Eigen::MatrixXd &adjoint_p, Eigen::VectorXd &one_form) |
Eigen::VectorXd | map_primitive_to_node_order (const State &state, const Eigen::VectorXd &primitives) |
Eigen::VectorXd | map_node_to_primitive_order (const State &state, const Eigen::VectorXd &nodes) |
Eigen::MatrixXd | edge_normal_gradient (const Eigen::MatrixXd &V) |
Eigen::MatrixXd | face_normal_gradient (const Eigen::MatrixXd &V) |
Eigen::MatrixXd | edge_velocity_divergence (const Eigen::MatrixXd &V) |
Eigen::MatrixXd | face_velocity_divergence (const Eigen::MatrixXd &V) |
double | triangle_jacobian (const Eigen::VectorXd &v1, const Eigen::VectorXd &v2, const Eigen::VectorXd &v3) |
double | tet_determinant (const Eigen::VectorXd &v1, const Eigen::VectorXd &v2, const Eigen::VectorXd &v3, const Eigen::VectorXd &v4) |
void | scaled_jacobian (const Eigen::MatrixXd &V, const Eigen::MatrixXi &F, Eigen::VectorXd &quality) |
bool | is_flipped (const Eigen::MatrixXd &V, const Eigen::MatrixXi &F) |
void polyfem::solver::AdjointTools::compute_shape_derivative_functional_term | ( | const State & | state, |
const Eigen::MatrixXd & | solution, | ||
const IntegrableFunctional & | j, | ||
const std::set< int > & | interested_ids, | ||
const SpatialIntegralType | spatial_integral_type, | ||
Eigen::VectorXd & | term, | ||
const int | cur_time_step | ||
) |
Definition at line 316 of file AdjointTools.cpp.
References polyfem::State::args, polyfem::State::ass_vals_cache, polyfem::State::assembler, polyfem::State::bases, polyfem::IntegrableFunctional::ParameterType::body_id, polyfem::assembler::AssemblyValsCache::compute(), polyfem::assembler::ElementAssemblyValues::compute(), polyfem::IntegrableFunctional::depend_on_gradu(), polyfem::IntegrableFunctional::depend_on_x(), polyfem::IntegrableFunctional::dj_dgradu(), polyfem::IntegrableFunctional::dj_dx(), polyfem::IntegrableFunctional::ParameterType::elem, polyfem::IntegrableFunctional::evaluate(), polyfem::State::geom_bases(), gvals, polyfem::State::mesh, polyfem::State::n_geom_bases, polyfem::quadrature::Quadrature::points, polyfem::State::problem, quadrature, polyfem::IntegrableFunctional::ParameterType::step, polyfem::IntegrableFunctional::ParameterType::t, polyfem::State::total_local_boundary, vals, polyfem::utils::vector2matrix(), and polyfem::quadrature::Quadrature::weights.
Referenced by polyfem::solver::SpatialIntegralForm::compute_partial_gradient_step().
void polyfem::solver::AdjointTools::dJ_damping_transient_adjoint_term | ( | const State & | state, |
const Eigen::MatrixXd & | adjoint_nu, | ||
const Eigen::MatrixXd & | adjoint_p, | ||
Eigen::VectorXd & | one_form | ||
) |
Definition at line 847 of file AdjointTools.cpp.
References polyfem::State::args, polyfem::State::boundary_nodes, polyfem::solver::SolveData::damping_form, polyfem::State::diff_cached, polyfem::State::solve_data, and polyfem::solver::DiffCache::u().
Referenced by polyfem::solver::DampingCoeffientVariableToSimulation::compute_adjoint_term().
void polyfem::solver::AdjointTools::dJ_dirichlet_transient_adjoint_term | ( | const State & | state, |
const Eigen::MatrixXd & | adjoint_nu, | ||
const Eigen::MatrixXd & | adjoint_p, | ||
Eigen::VectorXd & | one_form | ||
) |
Definition at line 903 of file AdjointTools.cpp.
References polyfem::State::args, and polyfem::State::boundary_nodes.
Referenced by polyfem::solver::DirichletVariableToSimulation::compute_adjoint_term().
void polyfem::solver::AdjointTools::dJ_du_step | ( | const State & | state, |
const IntegrableFunctional & | j, | ||
const Eigen::MatrixXd & | solution, | ||
const std::set< int > & | interested_ids, | ||
const SpatialIntegralType | spatial_integral_type, | ||
const int | cur_step, | ||
Eigen::VectorXd & | term | ||
) |
Definition at line 990 of file AdjointTools.cpp.
References polyfem::State::args, polyfem::State::ass_vals_cache, polyfem::State::assembler, polyfem::State::bases, polyfem::IntegrableFunctional::ParameterType::body_id, polyfem::assembler::AssemblyValsCache::compute(), polyfem::IntegrableFunctional::depend_on_gradu(), polyfem::IntegrableFunctional::depend_on_gradu_local(), polyfem::IntegrableFunctional::depend_on_u(), polyfem::IntegrableFunctional::dj_dgradu(), polyfem::IntegrableFunctional::dj_du(), polyfem::IntegrableFunctional::ParameterType::elem, polyfem::State::geom_bases(), polyfem::assembler::AssemblyValues::global, polyfem::assembler::AssemblyValues::grad_t_m, polyfem::State::mesh, polyfem::State::n_bases, polyfem::quadrature::Quadrature::points, polyfem::State::problem, quadrature, polyfem::IntegrableFunctional::ParameterType::step, polyfem::IntegrableFunctional::ParameterType::t, polyfem::State::total_local_boundary, polyfem::assembler::AssemblyValues::val, val, vals, and polyfem::quadrature::Quadrature::weights.
Referenced by polyfem::solver::SpatialIntegralForm::compute_adjoint_rhs_step().
void polyfem::solver::AdjointTools::dJ_friction_transient_adjoint_term | ( | const State & | state, |
const Eigen::MatrixXd & | adjoint_nu, | ||
const Eigen::MatrixXd & | adjoint_p, | ||
Eigen::VectorXd & | one_form | ||
) |
Definition at line 791 of file AdjointTools.cpp.
References polyfem::State::args, polyfem::State::boundary_nodes, polyfem::State::collision_mesh, polyfem::solver::SolveData::contact_form, polyfem::State::diff_cached, polyfem::solver::DiffCache::friction_collision_set(), polyfem::solver::SolveData::friction_form, polyfem::State::initial_acceleration(), polyfem::State::initial_vel_update, polyfem::State::initial_velocity(), polyfem::State::mesh, polyfem::State::ndof(), polyfem::State::solve_data, and polyfem::solver::DiffCache::u().
Referenced by polyfem::solver::FrictionCoeffientVariableToSimulation::compute_adjoint_term().
void polyfem::solver::AdjointTools::dJ_initial_condition_adjoint_term | ( | const State & | state, |
const Eigen::MatrixXd & | adjoint_nu, | ||
const Eigen::MatrixXd & | adjoint_p, | ||
Eigen::VectorXd & | one_form | ||
) |
Definition at line 883 of file AdjointTools.cpp.
References polyfem::State::boundary_nodes, and polyfem::State::ndof().
Referenced by polyfem::solver::InitialConditionVariableToSimulation::compute_adjoint_term().
void polyfem::solver::AdjointTools::dJ_material_static_adjoint_term | ( | const State & | state, |
const Eigen::MatrixXd & | sol, | ||
const Eigen::MatrixXd & | adjoint, | ||
Eigen::VectorXd & | one_form | ||
) |
Definition at line 746 of file AdjointTools.cpp.
References polyfem::solver::SolveData::elastic_form, and polyfem::State::solve_data.
Referenced by polyfem::solver::ElasticVariableToSimulation::compute_adjoint_term().
void polyfem::solver::AdjointTools::dJ_material_transient_adjoint_term | ( | const State & | state, |
const Eigen::MatrixXd & | adjoint_nu, | ||
const Eigen::MatrixXd & | adjoint_p, | ||
Eigen::VectorXd & | one_form | ||
) |
Definition at line 755 of file AdjointTools.cpp.
References polyfem::State::args, polyfem::State::bases, polyfem::State::boundary_nodes, polyfem::State::diff_cached, polyfem::solver::SolveData::elastic_form, polyfem::State::solve_data, and polyfem::solver::DiffCache::u().
Referenced by polyfem::solver::ElasticVariableToSimulation::compute_adjoint_term().
void polyfem::solver::AdjointTools::dJ_periodic_shape_adjoint_term | ( | const State & | state, |
const PeriodicMeshToMesh & | periodic_mesh_map, | ||
const Eigen::VectorXd & | periodic_mesh_representation, | ||
const Eigen::MatrixXd & | sol, | ||
const Eigen::MatrixXd & | adjoint, | ||
Eigen::VectorXd & | one_form | ||
) |
Definition at line 624 of file AdjointTools.cpp.
References polyfem::solver::PeriodicMeshToMesh::apply_jacobian(), polyfem::State::basis_nodes_to_gbasis_nodes, polyfem::State::diff_cached, polyfem::solver::DiffCache::disp_grad(), dJ_shape_homogenization_adjoint_term(), polyfem::State::mesh, polyfem::State::mesh_nodes, polyfem::State::n_bases, polyfem::solver::SolveData::nl_problem, polyfem::solver::SolveData::periodic_contact_form, polyfem::State::primitive_to_node(), and polyfem::State::solve_data.
Referenced by polyfem::solver::PeriodicShapeVariableToSimulation::compute_adjoint_term().
void polyfem::solver::AdjointTools::dJ_pressure_static_adjoint_term | ( | const State & | state, |
const std::vector< int > & | boundary_ids, | ||
const Eigen::MatrixXd & | sol, | ||
const Eigen::MatrixXd & | adjoint, | ||
Eigen::VectorXd & | one_form | ||
) |
Definition at line 926 of file AdjointTools.cpp.
References polyfem::State::n_geom_bases, polyfem::solver::SolveData::pressure_form, and polyfem::State::solve_data.
Referenced by polyfem::solver::PressureVariableToSimulation::compute_adjoint_term().
void polyfem::solver::AdjointTools::dJ_pressure_transient_adjoint_term | ( | const State & | state, |
const std::vector< int > & | boundary_ids, | ||
const Eigen::MatrixXd & | adjoint_nu, | ||
const Eigen::MatrixXd & | adjoint_p, | ||
Eigen::VectorXd & | one_form | ||
) |
Definition at line 949 of file AdjointTools.cpp.
References polyfem::State::args, polyfem::State::boundary_nodes, polyfem::State::diff_cached, polyfem::State::n_geom_bases, polyfem::solver::SolveData::pressure_form, polyfem::State::solve_data, and polyfem::solver::DiffCache::u().
Referenced by polyfem::solver::PressureVariableToSimulation::compute_adjoint_term().
void polyfem::solver::AdjointTools::dJ_shape_homogenization_adjoint_term | ( | const State & | state, |
const Eigen::MatrixXd & | sol, | ||
const Eigen::MatrixXd & | adjoint, | ||
Eigen::VectorXd & | one_form | ||
) |
Definition at line 588 of file AdjointTools.cpp.
References polyfem::State::basis_nodes_to_gbasis_nodes, polyfem::solver::DiffCache::collision_set(), polyfem::solver::SolveData::contact_form, polyfem::State::diff_cached, polyfem::solver::SolveData::elastic_form, polyfem::State::mesh, polyfem::State::mesh_nodes, polyfem::State::n_bases, polyfem::State::n_geom_bases, polyfem::solver::SolveData::nl_problem, polyfem::State::primitive_to_node(), and polyfem::State::solve_data.
Referenced by polyfem::solver::ShapeVariableToSimulation::compute_adjoint_term(), and dJ_periodic_shape_adjoint_term().
void polyfem::solver::AdjointTools::dJ_shape_static_adjoint_term | ( | const State & | state, |
const Eigen::MatrixXd & | sol, | ||
const Eigen::MatrixXd & | adjoint, | ||
Eigen::VectorXd & | one_form | ||
) |
Definition at line 550 of file AdjointTools.cpp.
References polyfem::State::basis_nodes_to_gbasis_nodes, polyfem::solver::SolveData::body_form, polyfem::solver::DiffCache::collision_set(), polyfem::solver::SolveData::contact_form, polyfem::State::diff_cached, polyfem::solver::SolveData::elastic_form, polyfem::State::is_contact_enabled(), polyfem::State::mesh, polyfem::State::n_geom_bases, polyfem::solver::SolveData::pressure_form, polyfem::State::primitive_to_node(), and polyfem::State::solve_data.
Referenced by polyfem::solver::ShapeVariableToSimulation::compute_adjoint_term().
void polyfem::solver::AdjointTools::dJ_shape_transient_adjoint_term | ( | const State & | state, |
const Eigen::MatrixXd & | adjoint_nu, | ||
const Eigen::MatrixXd & | adjoint_p, | ||
Eigen::VectorXd & | one_form | ||
) |
Definition at line 664 of file AdjointTools.cpp.
References polyfem::State::args, polyfem::State::bases, polyfem::State::basis_nodes_to_gbasis_nodes, polyfem::solver::SolveData::body_form, polyfem::State::boundary_nodes, polyfem::solver::DiffCache::collision_set(), polyfem::solver::SolveData::contact_form, polyfem::solver::SolveData::damping_form, polyfem::State::diff_cached, polyfem::solver::SolveData::elastic_form, polyfem::solver::DiffCache::friction_collision_set(), polyfem::solver::SolveData::friction_form, polyfem::State::geom_bases(), polyfem::solver::SolveData::inertia_form, polyfem::State::is_contact_enabled(), polyfem::State::mass_ass_vals_cache, polyfem::State::mass_matrix_assembler, polyfem::State::mesh, polyfem::State::n_geom_bases, polyfem::solver::SolveData::pressure_form, polyfem::State::primitive_to_node(), polyfem::State::solve_data, polyfem::solver::DiffCache::u(), and polyfem::solver::DiffCache::v().
Referenced by polyfem::solver::ShapeVariableToSimulation::compute_adjoint_term().
Eigen::MatrixXd polyfem::solver::AdjointTools::edge_normal_gradient | ( | const Eigen::MatrixXd & | V | ) |
Definition at line 1254 of file AdjointTools.cpp.
References DiffScalarBase::setVariableCount(), and V.
Eigen::MatrixXd polyfem::solver::AdjointTools::edge_velocity_divergence | ( | const Eigen::MatrixXd & | V | ) |
Definition at line 1286 of file AdjointTools.cpp.
References V.
Eigen::MatrixXd polyfem::solver::AdjointTools::face_normal_gradient | ( | const Eigen::MatrixXd & | V | ) |
Definition at line 1270 of file AdjointTools.cpp.
References DiffScalarBase::setVariableCount(), and V.
Eigen::MatrixXd polyfem::solver::AdjointTools::face_velocity_divergence | ( | const Eigen::MatrixXd & | V | ) |
Definition at line 1291 of file AdjointTools.cpp.
References V.
double polyfem::solver::AdjointTools::integrate_objective | ( | const State & | state, |
const IntegrableFunctional & | j, | ||
const Eigen::MatrixXd & | solution, | ||
const std::set< int > & | interested_ids, | ||
const SpatialIntegralType | spatial_integral_type, | ||
const int | cur_step = 0 |
||
) |
Definition at line 181 of file AdjointTools.cpp.
References polyfem::State::args, polyfem::State::ass_vals_cache, polyfem::State::assembler, polyfem::State::bases, polyfem::IntegrableFunctional::ParameterType::body_id, polyfem::assembler::AssemblyValsCache::compute(), polyfem::utils::create_thread_storage(), polyfem::assembler::ElementAssemblyValues::det, polyfem::IntegrableFunctional::ParameterType::elem, polyfem::IntegrableFunctional::evaluate(), polyfem::State::geom_bases(), polyfem::utils::get_local_thread_storage(), polyfem::io::Evaluator::interpolate_at_local_vals(), polyfem::utils::maybe_parallel_for(), polyfem::State::mesh, polyfem::quadrature::Quadrature::points, polyfem::State::problem, polyfem::assembler::ElementAssemblyValues::quadrature, quadrature, polyfem::IntegrableFunctional::ParameterType::step, polyfem::solver::Surface, polyfem::IntegrableFunctional::ParameterType::t, polyfem::State::total_local_boundary, polyfem::assembler::ElementAssemblyValues::val, vals, polyfem::solver::Volume, and polyfem::quadrature::Quadrature::weights.
Referenced by polyfem::solver::SpatialIntegralForm::value_unweighted_step().
bool polyfem::solver::AdjointTools::is_flipped | ( | const Eigen::MatrixXd & | V, |
const Eigen::MatrixXi & | F | ||
) |
Definition at line 1371 of file AdjointTools.cpp.
References tet_determinant(), triangle_jacobian(), and V.
Referenced by polyfem::mesh::apply_slim(), and polyfem::solver::AdjointNLProblem::is_step_valid().
Eigen::VectorXd polyfem::solver::AdjointTools::map_node_to_primitive_order | ( | const State & | state, |
const Eigen::VectorXd & | nodes | ||
) |
Definition at line 1243 of file AdjointTools.cpp.
References polyfem::State::mesh, polyfem::State::n_geom_bases, and polyfem::State::node_to_primitive().
Referenced by polyfem::solver::AMIPSForm::compute_partial_gradient(), polyfem::solver::CollisionBarrierForm::compute_partial_gradient(), polyfem::solver::DeformedCollisionBarrierForm::compute_partial_gradient(), and polyfem::solver::ProxyContactForceForm::compute_partial_gradient_step().
Eigen::VectorXd polyfem::solver::AdjointTools::map_primitive_to_node_order | ( | const State & | state, |
const Eigen::VectorXd & | primitives | ||
) |
Definition at line 1232 of file AdjointTools.cpp.
References polyfem::State::mesh, polyfem::State::n_geom_bases, and polyfem::State::primitive_to_node().
Referenced by polyfem::solver::AMIPSForm::compute_partial_gradient(), polyfem::solver::CollisionBarrierForm::get_updated_mesh_nodes(), polyfem::solver::DeformedCollisionBarrierForm::get_updated_mesh_nodes(), and polyfem::solver::AMIPSForm::value_unweighted().
void polyfem::solver::AdjointTools::scaled_jacobian | ( | const Eigen::MatrixXd & | V, |
const Eigen::MatrixXi & | F, | ||
Eigen::VectorXd & | quality | ||
) |
Definition at line 1311 of file AdjointTools.cpp.
References V.
double polyfem::solver::AdjointTools::tet_determinant | ( | const Eigen::VectorXd & | v1, |
const Eigen::VectorXd & | v2, | ||
const Eigen::VectorXd & | v3, | ||
const Eigen::VectorXd & | v4 | ||
) |
Definition at line 1302 of file AdjointTools.cpp.
Referenced by is_flipped().
double polyfem::solver::AdjointTools::triangle_jacobian | ( | const Eigen::VectorXd & | v1, |
const Eigen::VectorXd & | v2, | ||
const Eigen::VectorXd & | v3 | ||
) |
Definition at line 1296 of file AdjointTools.cpp.
Referenced by is_flipped().