PolyFEM
Loading...
Searching...
No Matches
polyfem::solver::AdjointTools Namespace Reference

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)
 

Function Documentation

◆ compute_shape_derivative_functional_term()

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 
)

◆ dJ_damping_transient_adjoint_term()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dJ_dirichlet_transient_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().

Here is the caller graph for this function:

◆ dJ_du_step()

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 
)

◆ dJ_friction_transient_adjoint_term()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dJ_initial_condition_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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dJ_material_static_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().

Here is the caller graph for this function:

◆ dJ_material_transient_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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dJ_periodic_shape_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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dJ_pressure_static_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().

Here is the caller graph for this function:

◆ dJ_pressure_transient_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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dJ_shape_homogenization_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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dJ_shape_static_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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dJ_shape_transient_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 
)

◆ edge_normal_gradient()

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.

Here is the call graph for this function:

◆ edge_velocity_divergence()

Eigen::MatrixXd polyfem::solver::AdjointTools::edge_velocity_divergence ( const Eigen::MatrixXd &  V)

Definition at line 1286 of file AdjointTools.cpp.

References V.

◆ face_normal_gradient()

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.

Here is the call graph for this function:

◆ face_velocity_divergence()

Eigen::MatrixXd polyfem::solver::AdjointTools::face_velocity_divergence ( const Eigen::MatrixXd &  V)

Definition at line 1291 of file AdjointTools.cpp.

References V.

◆ integrate_objective()

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 
)

◆ is_flipped()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ map_node_to_primitive_order()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ map_primitive_to_node_order()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ scaled_jacobian()

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.

◆ tet_determinant()

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().

Here is the caller graph for this function:

◆ triangle_jacobian()

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().

Here is the caller graph for this function: