Parallel Finite Element - General geometry Ewald-like Method
Part of Continuum-particle Simulation Suite under MICCOM
|
This class provides the basic components for assembling the matrix and vector when solving Stokes equations. More...
#include <assemble_stokes.h>
Public Member Functions | |
AssembleStokes (EquationSystems &es) | |
Constructor. More... | |
~AssembleStokes () | |
Destructor. More... | |
void | assemble_global_K (const std::string &system_name, const std::string &option) override |
Assemble the Global Matrix K. More... | |
void | assemble_global_F (const std::string &system_name, const std::string &option) override |
Assemble the Global force vector F. More... | |
void | assemble_element_KIJ (const std::vector< Real > &JxW, const std::vector< std::vector< RealGradient > > &dphi, const unsigned int n_u_dofs, const unsigned int I, const unsigned int J, DenseMatrix< Number > &Kij) override |
Assemble the element matrix K_IJ. More... | |
void | assemble_element_QI (const std::vector< Real > &JxW, const std::vector< std::vector< RealGradient > > &dphi, const std::vector< std::vector< Real > > &psi, const unsigned int n_v_dofs, const unsigned int n_p_dofs, const unsigned int I, DenseMatrix< Number > &Qi) |
Assemble the element matrices Q_I, i.e., kup, kvp, kwp, for pressure. More... | |
void | assemble_element_MIJ (const std::vector< Real > &JxW, const std::vector< std::vector< Real > > &phi, const unsigned int n_v_dofs, DenseMatrix< Number > &Mij) |
Assemble the element mass matrix M for preconditioning matrix. More... | |
void | compute_element_rhs (const Elem *elem, const unsigned int n_u_dofs, FEBase &fe_v, const std::vector< std::size_t > n_list, const bool &pf_flag, const std::string &option, const Real &alpha, DenseVector< Number > &Fe) override |
Assemble function for the right-hand-side in Stokes equation. More... | |
void | select_boundary_side (const Elem *elem) override |
select sides on the boundary for all elements More... | |
void | apply_bc_by_penalty (const Elem *elem, const std::string &matrix_or_vector, DenseMatrix< Number > &Ke, DenseVector< Number > &Fe, const std::string &option) override |
Apply BCs by penalty method. More... | |
Real | boundary_pressure_jump (const std::string &which_side) const |
Define the pressure jump at the inlet and outlet of the channel. More... | |
Real | boundary_traction (const std::string &which_side) const |
Define the pressure jump at the inlet and outlet of the channel. More... | |
Public Member Functions inherited from AssembleSystem | |
AssembleSystem (EquationSystems &es) | |
Constructor. More... | |
~AssembleSystem () | |
Destructor. More... | |
void | assemble_int_force (const Elem *elem, const unsigned int n_u_dofs, FEBase &fe_v) |
Assemble int_force matrix for every element, this includes Gaussian quadrature weights multiplied by shape functions. The product is calculated once and is stored in _int_force. More... | |
void | penalize_elem_matrix_vector (DenseMatrix< Number > &Ke, DenseVector< Number > &Fe, const std::string &matrix_or_vector, const unsigned int &var_number, const unsigned int &local_node_id, const unsigned int &n_nodes_elem, const Real &penalty, const Real &value) |
Universal function to penalize element matrix or vector with a large number. More... | |
Additional Inherited Members | |
Protected Attributes inherited from AssembleSystem | |
EquationSystems & | _eqn_sys |
unsigned int | _dim |
MeshBase & | _mesh |
const std::vector< boundary_id_type > | _boundary_id_3D = {4,2,1,3,0,5} |
const std::vector< std::string > | _boundary_name_3D = {"left", "right", "bottom", "top", "back", "front"} |
std::vector< std::vector< Real > > | _int_force |
std::vector< std::vector< Point > > | _q_xyz |
std::vector< unsigned int > | _n_dofs |
std::vector< unsigned int > | _n_u_dofs |
std::vector< unsigned int > | _n_p_dofs |
std::vector< unsigned int > | _n_uvw_dofs |
std::vector< std::vector< dof_id_type > > | _dof_indices |
std::vector< std::vector< dof_id_type > > | _dof_indices_u |
std::vector< std::vector< dof_id_type > > | _dof_indices_p |
std::vector< std::vector< unsigned int > > | _boundary_sides |
This class provides the basic components for assembling the matrix and vector when solving Stokes equations.
For details of the numerical discretization, refer to The finite element method in heat transfer and fluid dynamics (3rd ed) J.N. Reddy and D.K. Gartling. 2010, CRC Press
AssembleStokes::AssembleStokes | ( | EquationSystems & | es | ) |
Constructor.
[in,out] | es | EquationSystem |
AssembleStokes::~AssembleStokes | ( | ) |
Destructor.
|
overridevirtual |
Apply BCs by penalty method.
Implements AssembleSystem.
|
overridevirtual |
Assemble the element matrix K_IJ.
Reinit and compute the element matrix K_ij, which will be added into K matrix after calling assemble_global_K(). Size of this submatrix is n_u_dofs * n_u_dofs = n_v_dofs * n_v_dofs = n_w_dofs * n_w_dofs
Implements AssembleSystem.
void AssembleStokes::assemble_element_MIJ | ( | const std::vector< Real > & | JxW, |
const std::vector< std::vector< Real > > & | phi, | ||
const unsigned int | n_v_dofs, | ||
DenseMatrix< Number > & | Mij | ||
) |
Assemble the element mass matrix M for preconditioning matrix.
This function only exists for Stokes equation.
void AssembleStokes::assemble_element_QI | ( | const std::vector< Real > & | JxW, |
const std::vector< std::vector< RealGradient > > & | dphi, | ||
const std::vector< std::vector< Real > > & | psi, | ||
const unsigned int | n_v_dofs, | ||
const unsigned int | n_p_dofs, | ||
const unsigned int | I, | ||
DenseMatrix< Number > & | Qi | ||
) |
Assemble the element matrices Q_I, i.e., kup, kvp, kwp, for pressure.
These element matrices will be added to Ke after calling assemble_global_K(). This function only exists for Stokes equation.
|
overridevirtual |
Assemble the Global force vector F.
[in] | system_name | Name of the system (should be "Stokes") |
[in] | option | Options of assembling the system ("disturbed" or "undisturbed") |
[out] | Fe | Add rhs vector to system. |
Implements AssembleSystem.
|
overridevirtual |
Assemble the Global Matrix K.
[in] | system_name | Name of the system (should be "Stokes") |
[in] | Option | options of assembling the system ("disturbed" or "undisturbed") |
[out] | Ke | Add element matrix to system |
It is a good idea to make sure we are assembling the proper system.
Implements AssembleSystem.
Real AssembleStokes::boundary_pressure_jump | ( | const std::string & | which_side | ) | const |
Define the pressure jump at the inlet and outlet of the channel.
Real AssembleStokes::boundary_traction | ( | const std::string & | which_side | ) | const |
Define the pressure jump at the inlet and outlet of the channel.
|
overridevirtual |
Assemble function for the right-hand-side in Stokes equation.
This calculates each element's contribution to the right-hand-side vector.
Implements AssembleSystem.
|
overridevirtual |
select sides on the boundary for all elements
Implements AssembleSystem.