PolyFEM
|
#include <GenericProblem.hpp>
Public Member Functions | |
GenericTensorProblem (const std::string &name) | |
void | set_units (const assembler::Assembler &assembler, const Units &units) override |
void | rhs (const assembler::Assembler &assembler, const Eigen::MatrixXd &pts, const double t, Eigen::MatrixXd &val) const override |
bool | is_rhs_zero () const override |
void | dirichlet_bc (const mesh::Mesh &mesh, const Eigen::MatrixXi &global_ids, const Eigen::MatrixXd &uv, const Eigen::MatrixXd &pts, const double t, Eigen::MatrixXd &val) const override |
void | neumann_bc (const mesh::Mesh &mesh, const Eigen::MatrixXi &global_ids, const Eigen::MatrixXd &uv, const Eigen::MatrixXd &pts, const Eigen::MatrixXd &normals, const double t, Eigen::MatrixXd &val) const override |
void | pressure_bc (const mesh::Mesh &mesh, const Eigen::MatrixXi &global_ids, const Eigen::MatrixXd &uv, const Eigen::MatrixXd &pts, const Eigen::MatrixXd &normals, const double t, Eigen::MatrixXd &val) const override |
double | pressure_cavity_bc (const int boundary_id, const double t) const override |
void | dirichlet_nodal_value (const mesh::Mesh &mesh, const int node_id, const RowVectorNd &pt, const double t, Eigen::MatrixXd &val) const override |
void | neumann_nodal_value (const mesh::Mesh &mesh, const int node_id, const RowVectorNd &pt, const Eigen::MatrixXd &normal, const double t, Eigen::MatrixXd &val) const override |
bool | is_nodal_dirichlet_boundary (const int n_id, const int tag) override |
bool | is_nodal_neumann_boundary (const int n_id, const int tag) override |
bool | has_nodal_dirichlet () override |
bool | has_nodal_neumann () override |
bool | is_nodal_dimension_dirichlet (const int n_id, const int tag, const int dim) const override |
void | update_nodes (const Eigen::VectorXi &in_node_to_node) override |
bool | has_exact_sol () const override |
bool | is_scalar () const override |
bool | is_time_dependent () const override |
void | set_time_dependent (const bool val) |
bool | is_constant_in_time () const override |
bool | might_have_no_dirichlet () override |
void | initial_solution (const mesh::Mesh &mesh, const Eigen::MatrixXi &global_ids, const Eigen::MatrixXd &pts, Eigen::MatrixXd &val) const override |
void | initial_velocity (const mesh::Mesh &mesh, const Eigen::MatrixXi &global_ids, const Eigen::MatrixXd &pts, Eigen::MatrixXd &val) const override |
void | initial_acceleration (const mesh::Mesh &mesh, const Eigen::MatrixXi &global_ids, const Eigen::MatrixXd &pts, Eigen::MatrixXd &val) const override |
void | set_parameters (const json ¶ms) override |
bool | is_dimension_dirichet (const int tag, const int dim) const override |
bool | all_dimensions_dirichlet () const override |
void | exact (const Eigen::MatrixXd &pts, const double t, Eigen::MatrixXd &val) const override |
void | exact_grad (const Eigen::MatrixXd &pts, const double t, Eigen::MatrixXd &val) const override |
void | clear () override |
void | update_dirichlet_boundary (const int id, const int time_step, const Eigen::VectorXd &val) |
void | update_pressure_boundary (const int id, const int time_step, const double val) |
Public Member Functions inherited from polyfem::assembler::Problem | |
Problem (const std::string &name) | |
virtual | ~Problem () |
virtual void | init (const mesh::Mesh &mesh) |
const std::string & | name () const |
virtual bool | is_boundary_pressure (const int boundary_id) const |
virtual void | initial_density (const Eigen::MatrixXd &pts, Eigen::MatrixXd &val) const |
void | setup_bc (const mesh::Mesh &mesh, const int n_bases, const std::vector< basis::ElementBases > &bases, const std::vector< basis::ElementBases > &geom_bases, const std::vector< basis::ElementBases > &pressure_bases, std::vector< mesh::LocalBoundary > &local_boundary, std::vector< int > &boundary_nodes, std::vector< mesh::LocalBoundary > &local_neumann_boundary, std::vector< mesh::LocalBoundary > &local_pressure_boundary, std::unordered_map< int, std::vector< mesh::LocalBoundary > > &local_pressure_cavity, std::vector< int > &pressure_boundary_nodes, std::vector< int > &dirichlet_nodes, std::vector< int > &neumann_nodes) |
Private Attributes | |
bool | all_dimensions_dirichlet_ = true |
bool | has_exact_ = false |
bool | has_exact_grad_ = false |
bool | is_time_dept_ = false |
std::vector< TensorBCValue > | forces_ |
std::vector< TensorBCValue > | displacements_ |
std::vector< ScalarBCValue > | normal_aligned_forces_ |
std::vector< ScalarBCValue > | pressures_ |
std::unordered_map< int, ScalarBCValue > | cavity_pressures_ |
std::vector< std::pair< int, std::array< utils::ExpressionValue, 3 > > > | initial_position_ |
std::vector< std::pair< int, std::array< utils::ExpressionValue, 3 > > > | initial_velocity_ |
std::vector< std::pair< int, std::array< utils::ExpressionValue, 3 > > > | initial_acceleration_ |
std::array< utils::ExpressionValue, 3 > | rhs_ |
std::array< utils::ExpressionValue, 3 > | exact_ |
std::array< utils::ExpressionValue, 9 > | exact_grad_ |
std::map< int, TensorBCValue > | nodal_dirichlet_ |
std::map< int, TensorBCValue > | nodal_neumann_ |
std::vector< Eigen::MatrixXd > | nodal_dirichlet_mat_ |
bool | is_all_ |
Additional Inherited Members | |
Protected Attributes inherited from polyfem::assembler::Problem | |
std::vector< int > | boundary_ids_ |
std::vector< int > | neumann_boundary_ids_ |
std::vector< int > | normal_aligned_neumann_boundary_ids_ |
std::vector< int > | pressure_boundary_ids_ |
std::vector< int > | pressure_cavity_ids_ |
std::vector< int > | splitting_pressure_boundary_ids_ |
Definition at line 39 of file GenericProblem.hpp.
polyfem::assembler::GenericTensorProblem::GenericTensorProblem | ( | const std::string & | name | ) |
Definition at line 80 of file GenericProblem.cpp.
|
inlineoverridevirtual |
Reimplemented from polyfem::assembler::Problem.
Definition at line 84 of file GenericProblem.hpp.
References all_dimensions_dirichlet_.
Referenced by is_dimension_dirichet().
|
overridevirtual |
Reimplemented from polyfem::assembler::Problem.
Definition at line 858 of file GenericProblem.cpp.
References all_dimensions_dirichlet_, cavity_pressures_, clear(), displacements_, exact_, exact_grad_, forces_, has_exact_, has_exact_grad_, initial_acceleration_, initial_position_, initial_velocity_, is_all_, is_time_dept_, nodal_dirichlet_, nodal_dirichlet_mat_, nodal_neumann_, normal_aligned_forces_, pressures_, and rhs_.
Referenced by clear().
|
overridevirtual |
Implements polyfem::assembler::Problem.
Definition at line 220 of file GenericProblem.cpp.
References polyfem::assembler::Problem::boundary_ids_, polyfem::mesh::Mesh::dimension(), displacements_, polyfem::mesh::Mesh::get_boundary_id(), is_all_, and val.
|
overridevirtual |
Reimplemented from polyfem::assembler::Problem.
Definition at line 348 of file GenericProblem.cpp.
References polyfem::mesh::Mesh::dimension(), polyfem::mesh::Mesh::get_node_id(), is_all_, nodal_dirichlet_, nodal_dirichlet_mat_, and val.
|
overridevirtual |
Reimplemented from polyfem::assembler::Problem.
Definition at line 314 of file GenericProblem.cpp.
References exact_, has_exact_sol(), val, x, y, and z.
|
overridevirtual |
Reimplemented from polyfem::assembler::Problem.
Definition at line 330 of file GenericProblem.cpp.
References exact_grad_, has_exact_grad_, val, x, y, and z.
|
inlineoverridevirtual |
Implements polyfem::assembler::Problem.
Definition at line 70 of file GenericProblem.hpp.
References has_exact_.
Referenced by exact().
|
overridevirtual |
Reimplemented from polyfem::assembler::Problem.
Definition at line 424 of file GenericProblem.cpp.
References nodal_dirichlet_mat_.
|
overridevirtual |
Reimplemented from polyfem::assembler::Problem.
Definition at line 429 of file GenericProblem.cpp.
|
overridevirtual |
Reimplemented from polyfem::assembler::Problem.
Definition at line 825 of file GenericProblem.cpp.
References polyfem::mesh::Mesh::get_body_id(), initial_acceleration_, and val.
|
overridevirtual |
Reimplemented from polyfem::assembler::Problem.
Definition at line 759 of file GenericProblem.cpp.
References polyfem::mesh::Mesh::get_body_id(), initial_position_, and val.
|
overridevirtual |
Reimplemented from polyfem::assembler::Problem.
Definition at line 792 of file GenericProblem.cpp.
References polyfem::mesh::Mesh::get_body_id(), initial_velocity_, and val.
|
inlineoverridevirtual |
Reimplemented from polyfem::assembler::Problem.
Definition at line 74 of file GenericProblem.hpp.
References is_time_dept_.
|
overridevirtual |
Reimplemented from polyfem::assembler::Problem.
Definition at line 196 of file GenericProblem.cpp.
References all_dimensions_dirichlet(), polyfem::assembler::Problem::boundary_ids_, displacements_, and is_all_.
|
overridevirtual |
Reimplemented from polyfem::assembler::Problem.
Definition at line 434 of file GenericProblem.cpp.
References nodal_dirichlet_, and nodal_dirichlet_mat_.
|
overridevirtual |
Reimplemented from polyfem::assembler::Problem.
Definition at line 402 of file GenericProblem.cpp.
References nodal_dirichlet_, and nodal_dirichlet_mat_.
|
overridevirtual |
Reimplemented from polyfem::assembler::Problem.
Definition at line 419 of file GenericProblem.cpp.
References nodal_neumann_.
|
inlineoverridevirtual |
Implements polyfem::assembler::Problem.
Definition at line 46 of file GenericProblem.hpp.
References rhs_.
Referenced by rhs().
|
inlineoverridevirtual |
Implements polyfem::assembler::Problem.
Definition at line 71 of file GenericProblem.hpp.
|
inlineoverridevirtual |
Reimplemented from polyfem::assembler::Problem.
Definition at line 72 of file GenericProblem.hpp.
References is_time_dept_.
|
inlineoverridevirtual |
Reimplemented from polyfem::assembler::Problem.
Definition at line 75 of file GenericProblem.hpp.
References is_all_.
|
overridevirtual |
Reimplemented from polyfem::assembler::Problem.
Definition at line 253 of file GenericProblem.cpp.
References polyfem::mesh::Mesh::dimension(), forces_, polyfem::mesh::Mesh::get_boundary_id(), polyfem::assembler::Problem::neumann_boundary_ids_, normal_aligned_forces_, polyfem::assembler::Problem::normal_aligned_neumann_boundary_ids_, and val.
|
overridevirtual |
Reimplemented from polyfem::assembler::Problem.
Definition at line 396 of file GenericProblem.cpp.
References polyfem::log_and_throw_error().
|
overridevirtual |
Reimplemented from polyfem::assembler::Problem.
Definition at line 288 of file GenericProblem.cpp.
References polyfem::mesh::Mesh::get_boundary_id(), polyfem::assembler::Problem::pressure_boundary_ids_, pressures_, and val.
|
overridevirtual |
Reimplemented from polyfem::assembler::Problem.
Definition at line 307 of file GenericProblem.cpp.
References cavity_pressures_.
|
overridevirtual |
Implements polyfem::assembler::Problem.
Definition at line 175 of file GenericProblem.cpp.
References is_rhs_zero(), rhs_, val, x, y, and z.
|
overridevirtual |
Reimplemented from polyfem::assembler::Problem.
Definition at line 469 of file GenericProblem.cpp.
References all_dimensions_dirichlet_, polyfem::assembler::Problem::boundary_ids_, polyfem::utils::Interpolation::build(), cavity_pressures_, displacements_, exact_, exact_grad_, forces_, has_exact_, has_exact_grad_, polyfem::assembler::Problem::init(), initial_acceleration_, initial_position_, initial_velocity_, is_all_, polyfem::utils::is_param_valid(), is_time_dept_, polyfem::log_and_throw_error(), polyfem::logger(), polyfem::assembler::Problem::neumann_boundary_ids_, nodal_dirichlet_, nodal_dirichlet_mat_, normal_aligned_forces_, polyfem::assembler::Problem::normal_aligned_neumann_boundary_ids_, polyfem::assembler::Problem::pressure_boundary_ids_, polyfem::assembler::Problem::pressure_cavity_ids_, pressures_, polyfem::io::read_matrix(), polyfem::utils::resolve_path(), and rhs_.
|
inline |
Definition at line 73 of file GenericProblem.hpp.
References is_time_dept_, and val.
|
overridevirtual |
Reimplemented from polyfem::assembler::Problem.
Definition at line 85 of file GenericProblem.cpp.
References polyfem::Units::acceleration(), cavity_pressures_, displacements_, exact_, exact_grad_, polyfem::Units::force(), forces_, initial_acceleration_, initial_position_, initial_velocity_, polyfem::assembler::Assembler::is_fluid(), polyfem::Units::length(), nodal_dirichlet_, nodal_neumann_, normal_aligned_forces_, polyfem::Units::pressure(), pressures_, rhs_, and polyfem::Units::velocity().
void polyfem::assembler::GenericTensorProblem::update_dirichlet_boundary | ( | const int | id, |
const int | time_step, | ||
const Eigen::VectorXd & | val | ||
) |
Definition at line 1067 of file GenericProblem.cpp.
References polyfem::assembler::Problem::boundary_ids_, displacements_, and val.
|
overridevirtual |
Reimplemented from polyfem::assembler::Problem.
Definition at line 457 of file GenericProblem.cpp.
References nodal_dirichlet_mat_.
void polyfem::assembler::GenericTensorProblem::update_pressure_boundary | ( | const int | id, |
const int | time_step, | ||
const double | val | ||
) |
Definition at line 1037 of file GenericProblem.cpp.
References polyfem::assembler::Problem::pressure_boundary_ids_, pressures_, and val.
|
private |
Definition at line 95 of file GenericProblem.hpp.
Referenced by all_dimensions_dirichlet(), clear(), and set_parameters().
|
private |
Definition at line 105 of file GenericProblem.hpp.
Referenced by clear(), pressure_cavity_bc(), set_parameters(), and set_units().
|
private |
Definition at line 102 of file GenericProblem.hpp.
Referenced by clear(), dirichlet_bc(), is_dimension_dirichet(), set_parameters(), set_units(), and update_dirichlet_boundary().
|
private |
Definition at line 112 of file GenericProblem.hpp.
Referenced by clear(), exact(), set_parameters(), and set_units().
|
private |
Definition at line 113 of file GenericProblem.hpp.
Referenced by clear(), exact_grad(), set_parameters(), and set_units().
|
private |
Definition at line 101 of file GenericProblem.hpp.
Referenced by clear(), neumann_bc(), set_parameters(), and set_units().
|
private |
Definition at line 96 of file GenericProblem.hpp.
Referenced by clear(), has_exact_sol(), and set_parameters().
|
private |
Definition at line 97 of file GenericProblem.hpp.
Referenced by clear(), exact_grad(), and set_parameters().
|
private |
Definition at line 109 of file GenericProblem.hpp.
Referenced by clear(), initial_acceleration(), set_parameters(), and set_units().
|
private |
Definition at line 107 of file GenericProblem.hpp.
Referenced by clear(), initial_solution(), set_parameters(), and set_units().
|
private |
Definition at line 108 of file GenericProblem.hpp.
Referenced by clear(), initial_velocity(), set_parameters(), and set_units().
|
private |
Definition at line 119 of file GenericProblem.hpp.
Referenced by clear(), dirichlet_bc(), dirichlet_nodal_value(), is_dimension_dirichet(), might_have_no_dirichlet(), and set_parameters().
|
private |
Definition at line 98 of file GenericProblem.hpp.
Referenced by clear(), is_constant_in_time(), is_time_dependent(), set_parameters(), and set_time_dependent().
|
private |
Definition at line 115 of file GenericProblem.hpp.
Referenced by clear(), dirichlet_nodal_value(), is_nodal_dimension_dirichlet(), is_nodal_dirichlet_boundary(), set_parameters(), and set_units().
|
private |
Definition at line 117 of file GenericProblem.hpp.
Referenced by clear(), dirichlet_nodal_value(), has_nodal_dirichlet(), is_nodal_dimension_dirichlet(), is_nodal_dirichlet_boundary(), set_parameters(), and update_nodes().
|
private |
Definition at line 116 of file GenericProblem.hpp.
Referenced by clear(), is_nodal_neumann_boundary(), and set_units().
|
private |
Definition at line 103 of file GenericProblem.hpp.
Referenced by clear(), neumann_bc(), set_parameters(), and set_units().
|
private |
Definition at line 104 of file GenericProblem.hpp.
Referenced by clear(), pressure_bc(), set_parameters(), set_units(), and update_pressure_boundary().
|
private |
Definition at line 111 of file GenericProblem.hpp.
Referenced by clear(), is_rhs_zero(), rhs(), set_parameters(), and set_units().