PolyFEM
Loading...
Searching...
No Matches
polyfem::assembler::Problem Class Referenceabstract

#include <Problem.hpp>

Inheritance diagram for polyfem::assembler::Problem:
[legend]

Public Member Functions

 Problem (const std::string &name)
 
virtual void set_units (const assembler::Assembler &assembler, const Units &units)
 
virtual ~Problem ()
 
virtual void init (const mesh::Mesh &mesh)
 
const std::string & name () const
 
virtual bool is_scalar () const =0
 
virtual void rhs (const assembler::Assembler &assembler, const Eigen::MatrixXd &pts, const double t, Eigen::MatrixXd &val) const =0
 
virtual bool is_rhs_zero () const =0
 
virtual 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 =0
 
virtual 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
 
virtual 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
 
virtual double pressure_cavity_bc (const int boundary_id, const double t) const
 
virtual bool is_boundary_pressure (const int boundary_id) const
 
virtual void dirichlet_nodal_value (const mesh::Mesh &mesh, const int node_id, const RowVectorNd &pt, const double t, Eigen::MatrixXd &val) const
 
virtual 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
 
virtual bool is_nodal_dirichlet_boundary (const int n_id, const int tag)
 
virtual bool is_nodal_neumann_boundary (const int n_id, const int tag)
 
virtual bool has_nodal_dirichlet ()
 
virtual bool has_nodal_neumann ()
 
virtual bool has_exact_sol () const =0
 
virtual void exact (const Eigen::MatrixXd &pts, const double t, Eigen::MatrixXd &val) const
 
virtual void exact_grad (const Eigen::MatrixXd &pts, const double t, Eigen::MatrixXd &val) const
 
virtual void clear ()
 
virtual bool is_time_dependent () const
 
virtual bool is_constant_in_time () const
 
virtual void initial_solution (const mesh::Mesh &mesh, const Eigen::MatrixXi &global_ids, const Eigen::MatrixXd &pts, Eigen::MatrixXd &val) const
 
virtual void initial_velocity (const mesh::Mesh &mesh, const Eigen::MatrixXi &global_ids, const Eigen::MatrixXd &pts, Eigen::MatrixXd &val) const
 
virtual void initial_acceleration (const mesh::Mesh &mesh, const Eigen::MatrixXi &global_ids, const Eigen::MatrixXd &pts, Eigen::MatrixXd &val) const
 
virtual void initial_density (const Eigen::MatrixXd &pts, Eigen::MatrixXd &val) const
 
virtual void set_parameters (const json &params)
 
virtual bool might_have_no_dirichlet ()
 
virtual bool is_dimension_dirichet (const int tag, const int dim) const
 
virtual bool is_nodal_dimension_dirichlet (const int n_id, const int tag, const int dim) const
 
virtual bool all_dimensions_dirichlet () 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)
 
virtual void update_nodes (const Eigen::VectorXi &in_node_to_node)
 

Protected Attributes

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_
 

Private Attributes

std::string name_
 

Detailed Description

Definition at line 14 of file Problem.hpp.

Constructor & Destructor Documentation

◆ Problem()

polyfem::assembler::Problem::Problem ( const std::string &  name)

Definition at line 11 of file Problem.cpp.

◆ ~Problem()

virtual polyfem::assembler::Problem::~Problem ( )
inlinevirtual

Definition at line 20 of file Problem.hpp.

Member Function Documentation

◆ all_dimensions_dirichlet()

virtual bool polyfem::assembler::Problem::all_dimensions_dirichlet ( ) const
inlinevirtual

Reimplemented in polyfem::assembler::GenericTensorProblem, polyfem::problem::NodeProblem, and polyfem::problem::PointBasedTensorProblem.

Definition at line 64 of file Problem.hpp.

Referenced by polyfem::assembler::RhsAssembler::lsq_bc(), and polyfem::assembler::RhsAssembler::sample_bc().

Here is the caller graph for this function:

◆ clear()

virtual void polyfem::assembler::Problem::clear ( )
inlinevirtual

Reimplemented in polyfem::assembler::GenericTensorProblem, and polyfem::assembler::GenericScalarProblem.

Definition at line 48 of file Problem.hpp.

Referenced by polyfem::problem::ElasticCantileverExact::ElasticCantileverExact().

Here is the caller graph for this function:

◆ dirichlet_bc()

◆ dirichlet_nodal_value()

virtual void polyfem::assembler::Problem::dirichlet_nodal_value ( const mesh::Mesh mesh,
const int  node_id,
const RowVectorNd pt,
const double  t,
Eigen::MatrixXd &  val 
) const
inlinevirtual

◆ exact()

virtual void polyfem::assembler::Problem::exact ( const Eigen::MatrixXd &  pts,
const double  t,
Eigen::MatrixXd &  val 
) const
inlinevirtual

◆ exact_grad()

virtual void polyfem::assembler::Problem::exact_grad ( const Eigen::MatrixXd &  pts,
const double  t,
Eigen::MatrixXd &  val 
) const
inlinevirtual

◆ has_exact_sol()

◆ has_nodal_dirichlet()

virtual bool polyfem::assembler::Problem::has_nodal_dirichlet ( )
inlinevirtual

Reimplemented in polyfem::assembler::GenericTensorProblem, and polyfem::assembler::GenericScalarProblem.

Definition at line 41 of file Problem.hpp.

Referenced by setup_bc().

Here is the caller graph for this function:

◆ has_nodal_neumann()

virtual bool polyfem::assembler::Problem::has_nodal_neumann ( )
inlinevirtual

Reimplemented in polyfem::assembler::GenericTensorProblem, and polyfem::assembler::GenericScalarProblem.

Definition at line 42 of file Problem.hpp.

Referenced by setup_bc().

Here is the caller graph for this function:

◆ init()

virtual void polyfem::assembler::Problem::init ( const mesh::Mesh mesh)
inlinevirtual

Reimplemented in polyfem::problem::NodeProblem.

Definition at line 22 of file Problem.hpp.

Referenced by polyfem::assembler::GenericTensorProblem::set_parameters(), and polyfem::assembler::GenericScalarProblem::set_parameters().

Here is the caller graph for this function:

◆ initial_acceleration()

virtual void polyfem::assembler::Problem::initial_acceleration ( const mesh::Mesh mesh,
const Eigen::MatrixXi &  global_ids,
const Eigen::MatrixXd &  pts,
Eigen::MatrixXd &  val 
) const
inlinevirtual

Reimplemented in polyfem::assembler::GenericTensorProblem, polyfem::problem::DoubleTorsionElasticProblem, polyfem::problem::GravityProblem, and polyfem::problem::WalkProblem.

Definition at line 55 of file Problem.hpp.

Referenced by polyfem::assembler::RhsAssembler::initial_acceleration().

Here is the caller graph for this function:

◆ initial_density()

virtual void polyfem::assembler::Problem::initial_density ( const Eigen::MatrixXd &  pts,
Eigen::MatrixXd &  val 
) const
inlinevirtual

Reimplemented in polyfem::problem::TwoSpheres.

Definition at line 56 of file Problem.hpp.

◆ initial_solution()

virtual void polyfem::assembler::Problem::initial_solution ( const mesh::Mesh mesh,
const Eigen::MatrixXi &  global_ids,
const Eigen::MatrixXd &  pts,
Eigen::MatrixXd &  val 
) const
inlinevirtual

◆ initial_velocity()

virtual void polyfem::assembler::Problem::initial_velocity ( const mesh::Mesh mesh,
const Eigen::MatrixXi &  global_ids,
const Eigen::MatrixXd &  pts,
Eigen::MatrixXd &  val 
) const
inlinevirtual

Reimplemented in polyfem::assembler::GenericTensorProblem, polyfem::problem::DoubleTorsionElasticProblem, polyfem::problem::GravityProblem, and polyfem::problem::WalkProblem.

Definition at line 54 of file Problem.hpp.

Referenced by polyfem::assembler::RhsAssembler::initial_velocity().

Here is the caller graph for this function:

◆ is_boundary_pressure()

virtual bool polyfem::assembler::Problem::is_boundary_pressure ( const int  boundary_id) const
inlinevirtual

Definition at line 35 of file Problem.hpp.

References pressure_boundary_ids_.

Referenced by polyfem::assembler::RhsAssembler::compute_energy_hess().

Here is the caller graph for this function:

◆ is_constant_in_time()

virtual bool polyfem::assembler::Problem::is_constant_in_time ( ) const
inlinevirtual

◆ is_dimension_dirichet()

virtual bool polyfem::assembler::Problem::is_dimension_dirichet ( const int  tag,
const int  dim 
) const
inlinevirtual

Reimplemented in polyfem::assembler::GenericTensorProblem, polyfem::problem::NodeProblem, and polyfem::problem::PointBasedTensorProblem.

Definition at line 61 of file Problem.hpp.

Referenced by polyfem::assembler::RhsAssembler::lsq_bc(), polyfem::assembler::RhsAssembler::sample_bc(), and setup_bc().

Here is the caller graph for this function:

◆ is_nodal_dimension_dirichlet()

virtual bool polyfem::assembler::Problem::is_nodal_dimension_dirichlet ( const int  n_id,
const int  tag,
const int  dim 
) const
inlinevirtual

Reimplemented in polyfem::assembler::GenericTensorProblem.

Definition at line 62 of file Problem.hpp.

Referenced by setup_bc().

Here is the caller graph for this function:

◆ is_nodal_dirichlet_boundary()

virtual bool polyfem::assembler::Problem::is_nodal_dirichlet_boundary ( const int  n_id,
const int  tag 
)
inlinevirtual

Reimplemented in polyfem::assembler::GenericTensorProblem, and polyfem::assembler::GenericScalarProblem.

Definition at line 39 of file Problem.hpp.

Referenced by setup_bc().

Here is the caller graph for this function:

◆ is_nodal_neumann_boundary()

virtual bool polyfem::assembler::Problem::is_nodal_neumann_boundary ( const int  n_id,
const int  tag 
)
inlinevirtual

Reimplemented in polyfem::assembler::GenericTensorProblem, and polyfem::assembler::GenericScalarProblem.

Definition at line 40 of file Problem.hpp.

Referenced by setup_bc().

Here is the caller graph for this function:

◆ is_rhs_zero()

◆ is_scalar()

virtual bool polyfem::assembler::Problem::is_scalar ( ) const
pure virtual

Implemented in polyfem::assembler::GenericTensorProblem, polyfem::assembler::GenericScalarProblem, polyfem::problem::ElasticProblem, polyfem::problem::TorsionElasticProblem, polyfem::problem::DoubleTorsionElasticProblem, polyfem::problem::ElasticProblemZeroBC, polyfem::problem::ElasticProblemExact, polyfem::problem::CompressionElasticProblemExact, polyfem::problem::QuadraticElasticProblemExact, polyfem::problem::LinearElasticProblemExact, polyfem::problem::GravityProblem, polyfem::problem::WalkProblem, polyfem::problem::ElasticCantileverExact, polyfem::problem::FrankeProblem, polyfem::problem::FrankeProblemOld, polyfem::problem::KernelProblem, polyfem::problem::LinearProblem, polyfem::problem::QuadraticProblem, polyfem::problem::CubicProblem, polyfem::problem::SineProblem, polyfem::problem::ZeroBCProblem, polyfem::problem::MinSurfProblem, polyfem::problem::TimeDependentProblem, polyfem::problem::GenericScalarProblemExact, polyfem::problem::NodeProblem, polyfem::problem::PointBasedTensorProblem, polyfem::problem::BilaplacianProblemWithSolution, polyfem::problem::TimeDepentendStokesProblem, polyfem::problem::Kovnaszy, polyfem::problem::TaylorGreenVortexProblem, polyfem::problem::StokesLawProblem, polyfem::problem::Airfoil, polyfem::problem::SimpleStokeProblemExact, polyfem::problem::SineStokeProblemExact, polyfem::problem::TransientStokeProblemExact, and polyfem::problem::TestProblem.

Referenced by polyfem::io::OutStatsData::compute_errors(), polyfem::io::OutGeometryData::export_data(), polyfem::solver::BodyForm::force_shape_derivative(), polyfem::assembler::RhsAssembler::lsq_bc(), polyfem::assembler::RhsAssembler::sample_bc(), polyfem::io::OutStatsData::save_json(), polyfem::io::OutGeometryData::save_points(), polyfem::io::OutGeometryData::save_surface(), polyfem::io::OutGeometryData::save_volume(), polyfem::io::OutGeometryData::save_wire(), setup_bc(), and polyfem::problem::ProblemWithSolution::size_for().

Here is the caller graph for this function:

◆ is_time_dependent()

◆ might_have_no_dirichlet()

virtual bool polyfem::assembler::Problem::might_have_no_dirichlet ( )
inlinevirtual

Reimplemented in polyfem::assembler::GenericTensorProblem, and polyfem::assembler::GenericScalarProblem.

Definition at line 60 of file Problem.hpp.

Referenced by setup_bc().

Here is the caller graph for this function:

◆ name()

const std::string & polyfem::assembler::Problem::name ( ) const
inline

Definition at line 23 of file Problem.hpp.

References name_.

Referenced by polyfem::io::OutStatsData::save_json().

Here is the caller graph for this function:

◆ neumann_bc()

virtual void polyfem::assembler::Problem::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
inlinevirtual

Reimplemented in polyfem::assembler::GenericTensorProblem, polyfem::assembler::GenericScalarProblem, polyfem::problem::ElasticCantileverExact, polyfem::problem::NodeProblem, and polyfem::problem::PointBasedTensorProblem.

Definition at line 31 of file Problem.hpp.

Referenced by polyfem::assembler::RhsAssembler::compute_energy(), and polyfem::assembler::RhsAssembler::compute_energy_hess().

Here is the caller graph for this function:

◆ neumann_nodal_value()

virtual void polyfem::assembler::Problem::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
inlinevirtual

◆ pressure_bc()

virtual void polyfem::assembler::Problem::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
inlinevirtual

Reimplemented in polyfem::assembler::GenericTensorProblem.

Definition at line 32 of file Problem.hpp.

◆ pressure_cavity_bc()

virtual double polyfem::assembler::Problem::pressure_cavity_bc ( const int  boundary_id,
const double  t 
) const
inlinevirtual

Reimplemented in polyfem::assembler::GenericTensorProblem.

Definition at line 33 of file Problem.hpp.

Referenced by polyfem::assembler::PressureAssembler::compute_cavity_energy(), polyfem::assembler::PressureAssembler::compute_cavity_energy_grad(), and polyfem::assembler::PressureAssembler::compute_cavity_energy_hess().

Here is the caller graph for this function:

◆ rhs()

virtual void polyfem::assembler::Problem::rhs ( const assembler::Assembler assembler,
const Eigen::MatrixXd &  pts,
const double  t,
Eigen::MatrixXd &  val 
) const
pure virtual

Implemented in polyfem::assembler::GenericTensorProblem, polyfem::assembler::GenericScalarProblem, polyfem::problem::ElasticProblem, polyfem::problem::TorsionElasticProblem, polyfem::problem::DoubleTorsionElasticProblem, polyfem::problem::ElasticProblemZeroBC, polyfem::problem::GravityProblem, polyfem::problem::WalkProblem, polyfem::problem::ElasticCantileverExact, polyfem::problem::KernelProblem, polyfem::problem::MinSurfProblem, polyfem::problem::TimeDependentProblem, polyfem::problem::GenericScalarProblemExact, polyfem::problem::NodeProblem, polyfem::problem::PointBasedTensorProblem, polyfem::problem::ProblemWithSolution, polyfem::problem::BilaplacianProblemWithSolution, polyfem::problem::ConstantVelocity, polyfem::problem::TwoSpheres, polyfem::problem::DrivenCavity, polyfem::problem::DrivenCavityC0, polyfem::problem::DrivenCavitySmooth, polyfem::problem::Flow, polyfem::problem::FlowWithObstacle, polyfem::problem::Kovnaszy, polyfem::problem::CornerFlow, polyfem::problem::Lshape, polyfem::problem::UnitFlowWithObstacle, polyfem::problem::TaylorGreenVortexProblem, polyfem::problem::StokesLawProblem, polyfem::problem::Airfoil, and polyfem::problem::TransientStokeProblemExact.

Referenced by polyfem::assembler::RhsAssembler::assemble(), polyfem::assembler::RhsAssembler::compute_energy(), and polyfem::solver::BodyForm::force_shape_derivative().

Here is the caller graph for this function:

◆ set_parameters()

◆ set_units()

virtual void polyfem::assembler::Problem::set_units ( const assembler::Assembler assembler,
const Units units 
)
inlinevirtual

◆ setup_bc()

void polyfem::assembler::Problem::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 
)

◆ update_nodes()

virtual void polyfem::assembler::Problem::update_nodes ( const Eigen::VectorXi &  in_node_to_node)
inlinevirtual

Member Data Documentation

◆ boundary_ids_

std::vector<int> polyfem::assembler::Problem::boundary_ids_
protected

Definition at line 78 of file Problem.hpp.

Referenced by polyfem::problem::PointBasedTensorProblem::add_constant(), polyfem::problem::PointBasedTensorProblem::add_function(), polyfem::problem::PointBasedTensorProblem::add_function(), polyfem::problem::Airfoil::Airfoil(), polyfem::problem::ConstantVelocity::ConstantVelocity(), polyfem::problem::CornerFlow::CornerFlow(), polyfem::assembler::GenericTensorProblem::dirichlet_bc(), polyfem::assembler::GenericScalarProblem::dirichlet_bc(), polyfem::problem::TorsionElasticProblem::dirichlet_bc(), polyfem::problem::DoubleTorsionElasticProblem::dirichlet_bc(), polyfem::problem::NodeProblem::dirichlet_bc(), polyfem::problem::PointBasedTensorProblem::dirichlet_bc(), polyfem::problem::DoubleTorsionElasticProblem::DoubleTorsionElasticProblem(), polyfem::problem::ElasticCantileverExact::ElasticCantileverExact(), polyfem::problem::ElasticProblem::ElasticProblem(), polyfem::problem::ElasticProblemZeroBC::ElasticProblemZeroBC(), polyfem::problem::Flow::Flow(), polyfem::problem::FlowWithObstacle::FlowWithObstacle(), polyfem::problem::GravityProblem::GravityProblem(), polyfem::assembler::GenericTensorProblem::is_dimension_dirichet(), polyfem::problem::NodeProblem::is_dimension_dirichet(), polyfem::problem::PointBasedTensorProblem::is_dimension_dirichet(), polyfem::problem::Kovnaszy::Kovnaszy(), polyfem::problem::Lshape::Lshape(), polyfem::problem::NodeProblem::neumann_bc(), polyfem::assembler::GenericTensorProblem::set_parameters(), polyfem::assembler::GenericScalarProblem::set_parameters(), polyfem::problem::TorsionElasticProblem::set_parameters(), polyfem::problem::DoubleTorsionElasticProblem::set_parameters(), polyfem::problem::NodeProblem::set_parameters(), polyfem::problem::PointBasedTensorProblem::set_parameters(), polyfem::problem::Flow::set_parameters(), polyfem::problem::UnitFlowWithObstacle::set_parameters(), setup_bc(), polyfem::problem::StokesLawProblem::StokesLawProblem(), polyfem::problem::TaylorGreenVortexProblem::TaylorGreenVortexProblem(), polyfem::problem::TorsionElasticProblem::TorsionElasticProblem(), polyfem::problem::UnitFlowWithObstacle::UnitFlowWithObstacle(), polyfem::assembler::GenericTensorProblem::update_dirichlet_boundary(), and polyfem::problem::WalkProblem::WalkProblem().

◆ name_

std::string polyfem::assembler::Problem::name_
private

Definition at line 86 of file Problem.hpp.

Referenced by name().

◆ neumann_boundary_ids_

◆ normal_aligned_neumann_boundary_ids_

std::vector<int> polyfem::assembler::Problem::normal_aligned_neumann_boundary_ids_
protected

◆ pressure_boundary_ids_

◆ pressure_cavity_ids_

std::vector<int> polyfem::assembler::Problem::pressure_cavity_ids_
protected

◆ splitting_pressure_boundary_ids_

std::vector<int> polyfem::assembler::Problem::splitting_pressure_boundary_ids_
protected

Definition at line 83 of file Problem.hpp.

Referenced by setup_bc().


The documentation for this class was generated from the following files: