PolyFEM
Loading...
Searching...
No Matches
polyfem::assembler::GenericTensorProblem Class Reference

#include <GenericProblem.hpp>

Inheritance diagram for polyfem::assembler::GenericTensorProblem:
[legend]
Collaboration diagram for polyfem::assembler::GenericTensorProblem:
[legend]

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 &params) 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< TensorBCValueforces_
 
std::vector< TensorBCValuedisplacements_
 
std::vector< ScalarBCValuenormal_aligned_forces_
 
std::vector< ScalarBCValuepressures_
 
std::unordered_map< int, ScalarBCValuecavity_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, TensorBCValuenodal_dirichlet_
 
std::map< int, TensorBCValuenodal_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_
 

Detailed Description

Definition at line 39 of file GenericProblem.hpp.

Constructor & Destructor Documentation

◆ GenericTensorProblem()

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

Definition at line 80 of file GenericProblem.cpp.

Member Function Documentation

◆ all_dimensions_dirichlet()

bool polyfem::assembler::GenericTensorProblem::all_dimensions_dirichlet ( ) const
inlineoverridevirtual

Reimplemented from polyfem::assembler::Problem.

Definition at line 84 of file GenericProblem.hpp.

References all_dimensions_dirichlet_.

Referenced by is_dimension_dirichet().

Here is the caller graph for this function:

◆ clear()

void polyfem::assembler::GenericTensorProblem::clear ( )
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().

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

◆ dirichlet_bc()

void polyfem::assembler::GenericTensorProblem::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
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.

Here is the call graph for this function:

◆ dirichlet_nodal_value()

void polyfem::assembler::GenericTensorProblem::dirichlet_nodal_value ( const mesh::Mesh mesh,
const int  node_id,
const RowVectorNd pt,
const double  t,
Eigen::MatrixXd &  val 
) const
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.

Here is the call graph for this function:

◆ exact()

void polyfem::assembler::GenericTensorProblem::exact ( const Eigen::MatrixXd &  pts,
const double  t,
Eigen::MatrixXd &  val 
) const
overridevirtual

Reimplemented from polyfem::assembler::Problem.

Definition at line 314 of file GenericProblem.cpp.

References exact_, has_exact_sol(), val, x, y, and z.

Here is the call graph for this function:

◆ exact_grad()

void polyfem::assembler::GenericTensorProblem::exact_grad ( const Eigen::MatrixXd &  pts,
const double  t,
Eigen::MatrixXd &  val 
) const
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.

◆ has_exact_sol()

bool polyfem::assembler::GenericTensorProblem::has_exact_sol ( ) const
inlineoverridevirtual

Implements polyfem::assembler::Problem.

Definition at line 70 of file GenericProblem.hpp.

References has_exact_.

Referenced by exact().

Here is the caller graph for this function:

◆ has_nodal_dirichlet()

bool polyfem::assembler::GenericTensorProblem::has_nodal_dirichlet ( )
overridevirtual

Reimplemented from polyfem::assembler::Problem.

Definition at line 424 of file GenericProblem.cpp.

References nodal_dirichlet_mat_.

◆ has_nodal_neumann()

bool polyfem::assembler::GenericTensorProblem::has_nodal_neumann ( )
overridevirtual

Reimplemented from polyfem::assembler::Problem.

Definition at line 429 of file GenericProblem.cpp.

◆ initial_acceleration()

void polyfem::assembler::GenericTensorProblem::initial_acceleration ( const mesh::Mesh mesh,
const Eigen::MatrixXi &  global_ids,
const Eigen::MatrixXd &  pts,
Eigen::MatrixXd &  val 
) const
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.

Here is the call graph for this function:

◆ initial_solution()

void polyfem::assembler::GenericTensorProblem::initial_solution ( const mesh::Mesh mesh,
const Eigen::MatrixXi &  global_ids,
const Eigen::MatrixXd &  pts,
Eigen::MatrixXd &  val 
) const
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.

Here is the call graph for this function:

◆ initial_velocity()

void polyfem::assembler::GenericTensorProblem::initial_velocity ( const mesh::Mesh mesh,
const Eigen::MatrixXi &  global_ids,
const Eigen::MatrixXd &  pts,
Eigen::MatrixXd &  val 
) const
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.

Here is the call graph for this function:

◆ is_constant_in_time()

bool polyfem::assembler::GenericTensorProblem::is_constant_in_time ( ) const
inlineoverridevirtual

Reimplemented from polyfem::assembler::Problem.

Definition at line 74 of file GenericProblem.hpp.

References is_time_dept_.

◆ is_dimension_dirichet()

bool polyfem::assembler::GenericTensorProblem::is_dimension_dirichet ( const int  tag,
const int  dim 
) const
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_.

Here is the call graph for this function:

◆ is_nodal_dimension_dirichlet()

bool polyfem::assembler::GenericTensorProblem::is_nodal_dimension_dirichlet ( const int  n_id,
const int  tag,
const int  dim 
) const
overridevirtual

Reimplemented from polyfem::assembler::Problem.

Definition at line 434 of file GenericProblem.cpp.

References nodal_dirichlet_, and nodal_dirichlet_mat_.

◆ is_nodal_dirichlet_boundary()

bool polyfem::assembler::GenericTensorProblem::is_nodal_dirichlet_boundary ( const int  n_id,
const int  tag 
)
overridevirtual

Reimplemented from polyfem::assembler::Problem.

Definition at line 402 of file GenericProblem.cpp.

References nodal_dirichlet_, and nodal_dirichlet_mat_.

◆ is_nodal_neumann_boundary()

bool polyfem::assembler::GenericTensorProblem::is_nodal_neumann_boundary ( const int  n_id,
const int  tag 
)
overridevirtual

Reimplemented from polyfem::assembler::Problem.

Definition at line 419 of file GenericProblem.cpp.

References nodal_neumann_.

◆ is_rhs_zero()

bool polyfem::assembler::GenericTensorProblem::is_rhs_zero ( ) const
inlineoverridevirtual

Implements polyfem::assembler::Problem.

Definition at line 46 of file GenericProblem.hpp.

References rhs_.

Referenced by rhs().

Here is the caller graph for this function:

◆ is_scalar()

bool polyfem::assembler::GenericTensorProblem::is_scalar ( ) const
inlineoverridevirtual

Implements polyfem::assembler::Problem.

Definition at line 71 of file GenericProblem.hpp.

◆ is_time_dependent()

bool polyfem::assembler::GenericTensorProblem::is_time_dependent ( ) const
inlineoverridevirtual

Reimplemented from polyfem::assembler::Problem.

Definition at line 72 of file GenericProblem.hpp.

References is_time_dept_.

◆ might_have_no_dirichlet()

bool polyfem::assembler::GenericTensorProblem::might_have_no_dirichlet ( )
inlineoverridevirtual

Reimplemented from polyfem::assembler::Problem.

Definition at line 75 of file GenericProblem.hpp.

References is_all_.

◆ neumann_bc()

void polyfem::assembler::GenericTensorProblem::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
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.

Here is the call graph for this function:

◆ neumann_nodal_value()

void polyfem::assembler::GenericTensorProblem::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
overridevirtual

Reimplemented from polyfem::assembler::Problem.

Definition at line 396 of file GenericProblem.cpp.

References polyfem::log_and_throw_error().

Here is the call graph for this function:

◆ pressure_bc()

void polyfem::assembler::GenericTensorProblem::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
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.

Here is the call graph for this function:

◆ pressure_cavity_bc()

double polyfem::assembler::GenericTensorProblem::pressure_cavity_bc ( const int  boundary_id,
const double  t 
) const
overridevirtual

Reimplemented from polyfem::assembler::Problem.

Definition at line 307 of file GenericProblem.cpp.

References cavity_pressures_.

◆ rhs()

void polyfem::assembler::GenericTensorProblem::rhs ( const assembler::Assembler assembler,
const Eigen::MatrixXd &  pts,
const double  t,
Eigen::MatrixXd &  val 
) const
overridevirtual

Implements polyfem::assembler::Problem.

Definition at line 175 of file GenericProblem.cpp.

References is_rhs_zero(), rhs_, val, x, y, and z.

Here is the call graph for this function:

◆ set_parameters()

◆ set_time_dependent()

void polyfem::assembler::GenericTensorProblem::set_time_dependent ( const bool  val)
inline

Definition at line 73 of file GenericProblem.hpp.

References is_time_dept_, and val.

◆ set_units()

void polyfem::assembler::GenericTensorProblem::set_units ( const assembler::Assembler assembler,
const Units units 
)
overridevirtual

◆ update_dirichlet_boundary()

void polyfem::assembler::GenericTensorProblem::update_dirichlet_boundary ( const int  id,
const int  time_step,
const Eigen::VectorXd &  val 
)

◆ update_nodes()

void polyfem::assembler::GenericTensorProblem::update_nodes ( const Eigen::VectorXi &  in_node_to_node)
overridevirtual

Reimplemented from polyfem::assembler::Problem.

Definition at line 457 of file GenericProblem.cpp.

References nodal_dirichlet_mat_.

◆ update_pressure_boundary()

void polyfem::assembler::GenericTensorProblem::update_pressure_boundary ( const int  id,
const int  time_step,
const double  val 
)

Member Data Documentation

◆ all_dimensions_dirichlet_

bool polyfem::assembler::GenericTensorProblem::all_dimensions_dirichlet_ = true
private

Definition at line 95 of file GenericProblem.hpp.

Referenced by all_dimensions_dirichlet(), clear(), and set_parameters().

◆ cavity_pressures_

std::unordered_map<int, ScalarBCValue> polyfem::assembler::GenericTensorProblem::cavity_pressures_
private

Definition at line 105 of file GenericProblem.hpp.

Referenced by clear(), pressure_cavity_bc(), set_parameters(), and set_units().

◆ displacements_

std::vector<TensorBCValue> polyfem::assembler::GenericTensorProblem::displacements_
private

◆ exact_

std::array<utils::ExpressionValue, 3> polyfem::assembler::GenericTensorProblem::exact_
private

Definition at line 112 of file GenericProblem.hpp.

Referenced by clear(), exact(), set_parameters(), and set_units().

◆ exact_grad_

std::array<utils::ExpressionValue, 9> polyfem::assembler::GenericTensorProblem::exact_grad_
private

Definition at line 113 of file GenericProblem.hpp.

Referenced by clear(), exact_grad(), set_parameters(), and set_units().

◆ forces_

std::vector<TensorBCValue> polyfem::assembler::GenericTensorProblem::forces_
private

Definition at line 101 of file GenericProblem.hpp.

Referenced by clear(), neumann_bc(), set_parameters(), and set_units().

◆ has_exact_

bool polyfem::assembler::GenericTensorProblem::has_exact_ = false
private

Definition at line 96 of file GenericProblem.hpp.

Referenced by clear(), has_exact_sol(), and set_parameters().

◆ has_exact_grad_

bool polyfem::assembler::GenericTensorProblem::has_exact_grad_ = false
private

Definition at line 97 of file GenericProblem.hpp.

Referenced by clear(), exact_grad(), and set_parameters().

◆ initial_acceleration_

std::vector<std::pair<int, std::array<utils::ExpressionValue, 3> > > polyfem::assembler::GenericTensorProblem::initial_acceleration_
private

Definition at line 109 of file GenericProblem.hpp.

Referenced by clear(), initial_acceleration(), set_parameters(), and set_units().

◆ initial_position_

std::vector<std::pair<int, std::array<utils::ExpressionValue, 3> > > polyfem::assembler::GenericTensorProblem::initial_position_
private

Definition at line 107 of file GenericProblem.hpp.

Referenced by clear(), initial_solution(), set_parameters(), and set_units().

◆ initial_velocity_

std::vector<std::pair<int, std::array<utils::ExpressionValue, 3> > > polyfem::assembler::GenericTensorProblem::initial_velocity_
private

Definition at line 108 of file GenericProblem.hpp.

Referenced by clear(), initial_velocity(), set_parameters(), and set_units().

◆ is_all_

bool polyfem::assembler::GenericTensorProblem::is_all_
private

◆ is_time_dept_

bool polyfem::assembler::GenericTensorProblem::is_time_dept_ = false
private

◆ nodal_dirichlet_

std::map<int, TensorBCValue> polyfem::assembler::GenericTensorProblem::nodal_dirichlet_
private

◆ nodal_dirichlet_mat_

std::vector<Eigen::MatrixXd> polyfem::assembler::GenericTensorProblem::nodal_dirichlet_mat_
private

◆ nodal_neumann_

std::map<int, TensorBCValue> polyfem::assembler::GenericTensorProblem::nodal_neumann_
private

Definition at line 116 of file GenericProblem.hpp.

Referenced by clear(), is_nodal_neumann_boundary(), and set_units().

◆ normal_aligned_forces_

std::vector<ScalarBCValue> polyfem::assembler::GenericTensorProblem::normal_aligned_forces_
private

Definition at line 103 of file GenericProblem.hpp.

Referenced by clear(), neumann_bc(), set_parameters(), and set_units().

◆ pressures_

std::vector<ScalarBCValue> polyfem::assembler::GenericTensorProblem::pressures_
private

◆ rhs_

std::array<utils::ExpressionValue, 3> polyfem::assembler::GenericTensorProblem::rhs_
private

Definition at line 111 of file GenericProblem.hpp.

Referenced by clear(), is_rhs_zero(), rhs(), set_parameters(), and set_units().


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