HArD::Core2D
Hybrid Arbitrary Degree::Core 2D - Library to implement 2D schemes with edge and cell polynomials as unknowns
|
Class for Stokes model. More...
#include <hho-stokes.hpp>
Public Types | |
typedef Eigen::SparseMatrix< double > | SystemMatrixType |
typedef std::function< VectorRd(const VectorRd &)> | MomentumForcingTermType |
typedef std::function< double(const VectorRd &)> | CompressibilityForcingTermType |
typedef std::function< VectorRd(const VectorRd &)> | VelocityType |
typedef std::function< MatrixRd(const VectorRd &)> | VelocityGradientType |
typedef std::function< double(const VectorRd &)> | PressureType |
typedef std::function< VectorRd(const VectorRd &)> | PressureGradientType |
typedef IntegralWeight | ViscosityType |
typedef Eigen::SparseMatrix< double > | SystemMatrixType |
typedef std::function< VectorRd(const VectorRd &)> | MomentumForcingTermType |
typedef std::function< double(const VectorRd &)> | CompressibilityForcingTermType |
typedef std::function< VectorRd(const VectorRd &)> | VelocityType |
typedef std::function< MatrixRd(const VectorRd &)> | VelocityGradientType |
typedef std::function< double(const VectorRd &)> | PressureType |
typedef std::function< VectorRd(const VectorRd &)> | PressureGradientType |
typedef IntegralWeight | ViscosityType |
Public Member Functions | |
Stokes (const VHHOSpace &vhho_space, const GlobalDOFSpace &p_space, const BoundaryConditions &BC, bool use_threads, std::ostream &output=std::cout) | |
Constructor. | |
void | assembleLinearSystem (const MomentumForcingTermType &f, const CompressibilityForcingTermType &g, const ViscosityType &mu, const VelocityType &u, Eigen::VectorXd &UDir) |
Assemble the global system | |
size_t | nloc_sc_u () const |
Returns the local number of velocity statically condensed DOFs. | |
size_t | nloc_sc_p () const |
Returns the local number of pressure statically condensed DOFs. | |
size_t | numSCDOFs_u () const |
Returns the number of velocity statically condensed DOFs. | |
size_t | numSCDOFs_p () const |
Returns the number of pressure statically condensed DOFs. | |
size_t | numSCDOFs () const |
Returns the number of statically condensed DOFs. | |
size_t | numDirDOFs () const |
Returns the number of Dirichlet DOFs. | |
size_t | dimVelocity () const |
Returns the dimension of velocity space. | |
size_t | dimPressure () const |
Returns the dimension of pressure space. | |
size_t | numNonSCDOFs () const |
Returns the number of DOFs after SC and with Lagrange multiplier, but before eliminating Dirichlet DOFs. | |
size_t | sizeSystem () const |
Returns the size of the final system with Lagrange multiplier, after application of SC and removal of Dirichlet BCs. | |
const VHHOSpace & | vhhospace () const |
Returns the velocity space. | |
const GlobalDOFSpace & | pspace () const |
Returns the pressure space. | |
const Mesh & | mesh () const |
Returns the mesh. | |
const SystemMatrixType & | systemMatrix () const |
Returns the linear system matrix. | |
SystemMatrixType & | systemMatrix () |
Returns the linear system matrix. | |
const Eigen::VectorXd & | systemVector () const |
Returns the linear system right-hand side vector. | |
Eigen::VectorXd & | systemVector () |
Returns the linear system right-hand side vector. | |
const double & | stabilizationParameter () const |
Returns the stabilization parameter (scaling) | |
double & | stabilizationParameter () |
Returns the stabilization parameter. | |
const SystemMatrixType & | scMatrix () const |
Returns the static condensation recovery operator. | |
Eigen::VectorXd & | scVector () |
Returns the static condensation rhs. | |
Eigen::VectorXd | interpolate (const VelocityType &u, const PressureType &p, const int doe_cell=-1, const int doe_face=-1) const |
Interpolates velocity and pressure. | |
std::vector< double > | computeEnergyNorms (const std::vector< Eigen::VectorXd > &list_dofs) const |
Compute the discrete energy norm of a family of vectors representing the dofs. | |
Stokes (const VHHOSpace &vhho_space, const GlobalDOFSpace &p_space, const BoundaryConditions &BC, bool use_threads, std::ostream &output=std::cout) | |
Constructor. | |
void | assembleLinearSystem (const MomentumForcingTermType &f, const CompressibilityForcingTermType &g, const ViscosityType &mu, const VelocityType &u, Eigen::VectorXd &UDir, Eigen::VectorXd &u0, double &time_step) |
Assemble the global system | |
size_t | nloc_sc_u () const |
Returns the local number of velocity statically condensed DOFs. | |
size_t | nloc_sc_p () const |
Returns the local number of pressure statically condensed DOFs. | |
size_t | numSCDOFs_u () const |
Returns the number of velocity statically condensed DOFs. | |
size_t | numSCDOFs_p () const |
Returns the number of pressure statically condensed DOFs. | |
size_t | numSCDOFs () const |
Returns the number of statically condensed DOFs. | |
size_t | numDirDOFs () const |
Returns the number of Dirichlet DOFs. | |
size_t | dimVelocity () const |
Returns the dimension of velocity space. | |
size_t | dimPressure () const |
Returns the dimension of pressure space. | |
size_t | numNonSCDOFs () const |
Returns the number of DOFs after SC and with Lagrange multiplier, but before eliminating Dirichlet DOFs. | |
size_t | sizeSystem () const |
Returns the size of the final system with Lagrange multiplier, after application of SC and removal of Dirichlet BCs. | |
const VHHOSpace & | vhhospace () const |
Returns the velocity space. | |
const GlobalDOFSpace & | pspace () const |
Returns the pressure space. | |
const Mesh & | mesh () const |
Returns the mesh. | |
const SystemMatrixType & | systemMatrix () const |
Returns the linear system matrix. | |
SystemMatrixType & | systemMatrix () |
Returns the linear system matrix. | |
const Eigen::VectorXd & | systemVector () const |
Returns the linear system right-hand side vector. | |
Eigen::VectorXd & | systemVector () |
Returns the linear system right-hand side vector. | |
const double & | stabilizationParameter () const |
Returns the stabilization parameter (scaling) | |
double & | stabilizationParameter () |
Returns the stabilization parameter. | |
const SystemMatrixType & | scMatrix () const |
Returns the static condensation recovery operator. | |
Eigen::VectorXd & | scVector () |
Returns the static condensation rhs. | |
Eigen::VectorXd | interpolate (const VelocityType &u, const PressureType &p, const int doe_cell=-1, const int doe_face=-1) const |
Interpolates velocity and pressure. | |
std::vector< double > | computeEnergyNorms (const std::vector< Eigen::VectorXd > &list_dofs) const |
Compute the discrete energy norm of a family of vectors representing the dofs. | |
Eigen::VectorXd | pressureVertexValues (const Eigen::VectorXd &p) const |
Create vertex values for the pressure (from the element values), for plotting. | |
Class for Stokes model.
The global unknowns are in the following order:
typedef std::function<double(const VectorRd &)> HArDCore2D::Stokes::CompressibilityForcingTermType |
typedef std::function<double(const VectorRd &)> HArDCore2D::Stokes::CompressibilityForcingTermType |
typedef std::function<VectorRd(const VectorRd &)> HArDCore2D::Stokes::MomentumForcingTermType |
typedef std::function<VectorRd(const VectorRd &)> HArDCore2D::Stokes::MomentumForcingTermType |
typedef std::function<VectorRd(const VectorRd &)> HArDCore2D::Stokes::PressureGradientType |
typedef std::function<VectorRd(const VectorRd &)> HArDCore2D::Stokes::PressureGradientType |
typedef std::function<double(const VectorRd &)> HArDCore2D::Stokes::PressureType |
typedef std::function<double(const VectorRd &)> HArDCore2D::Stokes::PressureType |
typedef Eigen::SparseMatrix<double> HArDCore2D::Stokes::SystemMatrixType |
typedef Eigen::SparseMatrix<double> HArDCore2D::Stokes::SystemMatrixType |
typedef std::function<MatrixRd(const VectorRd &)> HArDCore2D::Stokes::VelocityGradientType |
typedef std::function<MatrixRd(const VectorRd &)> HArDCore2D::Stokes::VelocityGradientType |
typedef std::function<VectorRd(const VectorRd &)> HArDCore2D::Stokes::VelocityType |
typedef std::function<VectorRd(const VectorRd &)> HArDCore2D::Stokes::VelocityType |
Stokes::Stokes | ( | const VHHOSpace & | vhho_space, |
const GlobalDOFSpace & | p_space, | ||
const BoundaryConditions & | BC, | ||
bool | use_threads, | ||
std::ostream & | output = std::cout |
||
) |
Constructor.
vhho_space | Velocity space and operators |
p_space | Space for the pressure |
BC | Boundary conditions |
use_threads | True for parallel execution, false for sequential execution |
output | Output stream to print status messages |
HArDCore2D::Stokes::Stokes | ( | const VHHOSpace & | vhho_space, |
const GlobalDOFSpace & | p_space, | ||
const BoundaryConditions & | BC, | ||
bool | use_threads, | ||
std::ostream & | output = std::cout |
||
) |
Constructor.
vhho_space | Velocity space and operators |
p_space | Space for the pressure |
BC | Boundary conditions |
use_threads | True for parallel execution, false for sequential execution |
output | Output stream to print status messages |
void Stokes::assembleLinearSystem | ( | const MomentumForcingTermType & | f, |
const CompressibilityForcingTermType & | g, | ||
const ViscosityType & | mu, | ||
const VelocityType & | u, | ||
Eigen::VectorXd & | UDir | ||
) |
Assemble the global system
f | Forcing term |
g | Forcing term for the divergence equation |
mu | Viscosity |
u | Exact solution for boundary condition |
UDir | Vector filled in by Dirichlets BCs |
void Stokes::assembleLinearSystem | ( | const MomentumForcingTermType & | f, |
const CompressibilityForcingTermType & | g, | ||
const ViscosityType & | mu, | ||
const VelocityType & | u, | ||
Eigen::VectorXd & | UDir, | ||
Eigen::VectorXd & | u0, | ||
double & | time_step | ||
) |
Assemble the global system
f | Forcing term |
g | Forcing term for the divergence equation |
mu | Viscosity |
u | Exact solution for boundary condition |
UDir | Vector filled in by Dirichlets BCs |
std::vector< double > Stokes::computeEnergyNorms | ( | const std::vector< Eigen::VectorXd > & | list_dofs | ) | const |
Compute the discrete energy norm of a family of vectors representing the dofs.
list_dofs | The list of vectors representing the dofs |
std::vector< double > HArDCore2D::Stokes::computeEnergyNorms | ( | const std::vector< Eigen::VectorXd > & | list_dofs | ) | const |
Compute the discrete energy norm of a family of vectors representing the dofs.
list_dofs | The list of vectors representing the dofs |
|
inline |
Returns the dimension of pressure space.
|
inline |
Returns the dimension of pressure space.
|
inline |
Returns the dimension of velocity space.
|
inline |
Returns the dimension of velocity space.
Eigen::VectorXd Stokes::interpolate | ( | const VelocityType & | u, |
const PressureType & | p, | ||
const int | doe_cell = -1 , |
||
const int | doe_face = -1 |
||
) | const |
Interpolates velocity and pressure.
u | Continuous velocity to interpolate |
p | Continuous pressure to interpolate |
doe_cell | The optional degre of cell quadrature rules to compute the interpolate. If negative, then 2*degree()+3 will be used. |
doe_face | The optional degre of face quadrature rules to compute the interpolate. If negative, then 2*degree()+3 will be used. |
Eigen::VectorXd HArDCore2D::Stokes::interpolate | ( | const VelocityType & | u, |
const PressureType & | p, | ||
const int | doe_cell = -1 , |
||
const int | doe_face = -1 |
||
) | const |
Interpolates velocity and pressure.
u | Continuous velocity to interpolate |
p | Continuous pressure to interpolate |
doe_cell | The optional degre of cell quadrature rules to compute the interpolate. If negative, then 2*degree()+3 will be used. |
doe_face | The optional degre of face quadrature rules to compute the interpolate. If negative, then 2*degree()+3 will be used. |
|
inline |
Returns the mesh.
|
inline |
Returns the mesh.
|
inline |
Returns the local number of pressure statically condensed DOFs.
|
inline |
Returns the local number of pressure statically condensed DOFs.
|
inline |
Returns the local number of velocity statically condensed DOFs.
|
inline |
Returns the local number of velocity statically condensed DOFs.
|
inline |
Returns the number of Dirichlet DOFs.
|
inline |
Returns the number of Dirichlet DOFs.
|
inline |
Returns the number of DOFs after SC and with Lagrange multiplier, but before eliminating Dirichlet DOFs.
|
inline |
Returns the number of DOFs after SC and with Lagrange multiplier, but before eliminating Dirichlet DOFs.
|
inline |
Returns the number of statically condensed DOFs.
|
inline |
Returns the number of statically condensed DOFs.
|
inline |
Returns the number of pressure statically condensed DOFs.
|
inline |
Returns the number of pressure statically condensed DOFs.
|
inline |
Returns the number of velocity statically condensed DOFs.
|
inline |
Returns the number of velocity statically condensed DOFs.
Eigen::VectorXd Stokes::pressureVertexValues | ( | const Eigen::VectorXd & | p | ) | const |
Create vertex values for the pressure (from the element values), for plotting.
p | Vector of pressure DOFs |
|
inline |
Returns the pressure space.
|
inline |
Returns the pressure space.
|
inline |
Returns the static condensation recovery operator.
|
inline |
Returns the static condensation recovery operator.
|
inline |
Returns the static condensation rhs.
|
inline |
Returns the static condensation rhs.
|
inline |
Returns the size of the final system with Lagrange multiplier, after application of SC and removal of Dirichlet BCs.
|
inline |
Returns the size of the final system with Lagrange multiplier, after application of SC and removal of Dirichlet BCs.
|
inline |
Returns the stabilization parameter.
|
inline |
Returns the stabilization parameter.
|
inline |
Returns the stabilization parameter (scaling)
|
inline |
Returns the stabilization parameter (scaling)
|
inline |
Returns the linear system matrix.
|
inline |
Returns the linear system matrix.
|
inline |
Returns the linear system matrix.
|
inline |
Returns the linear system matrix.
|
inline |
Returns the linear system right-hand side vector.
|
inline |
Returns the linear system right-hand side vector.
|
inline |
Returns the linear system right-hand side vector.
|
inline |
Returns the linear system right-hand side vector.
|
inline |
Returns the velocity space.
|
inline |
Returns the velocity space.