HArD::Core2D
Hybrid Arbitrary Degree::Core 2D - Library to implement 2D schemes with edge and cell polynomials as unknowns
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
HArDCore2D::Stokes Struct Reference

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.
 

Detailed Description

Class for Stokes model.

The global unknowns are in the following order:

Member Typedef Documentation

◆ CompressibilityForcingTermType [1/2]

typedef std::function<double(const VectorRd &)> HArDCore2D::Stokes::CompressibilityForcingTermType

◆ CompressibilityForcingTermType [2/2]

typedef std::function<double(const VectorRd &)> HArDCore2D::Stokes::CompressibilityForcingTermType

◆ MomentumForcingTermType [1/2]

◆ MomentumForcingTermType [2/2]

◆ PressureGradientType [1/2]

◆ PressureGradientType [2/2]

◆ PressureType [1/2]

typedef std::function<double(const VectorRd &)> HArDCore2D::Stokes::PressureType

◆ PressureType [2/2]

typedef std::function<double(const VectorRd &)> HArDCore2D::Stokes::PressureType

◆ SystemMatrixType [1/2]

typedef Eigen::SparseMatrix<double> HArDCore2D::Stokes::SystemMatrixType

◆ SystemMatrixType [2/2]

typedef Eigen::SparseMatrix<double> HArDCore2D::Stokes::SystemMatrixType

◆ VelocityGradientType [1/2]

◆ VelocityGradientType [2/2]

◆ VelocityType [1/2]

typedef std::function<VectorRd(const VectorRd &)> HArDCore2D::Stokes::VelocityType

◆ VelocityType [2/2]

typedef std::function<VectorRd(const VectorRd &)> HArDCore2D::Stokes::VelocityType

◆ ViscosityType [1/2]

◆ ViscosityType [2/2]

Constructor & Destructor Documentation

◆ Stokes() [1/2]

Stokes::Stokes ( const VHHOSpace &  vhho_space,
const GlobalDOFSpace &  p_space,
const BoundaryConditions &  BC,
bool  use_threads,
std::ostream &  output = std::cout 
)

Constructor.

Parameters
vhho_spaceVelocity space and operators
p_spaceSpace for the pressure
BCBoundary conditions
use_threadsTrue for parallel execution, false for sequential execution
outputOutput stream to print status messages

◆ Stokes() [2/2]

HArDCore2D::Stokes::Stokes ( const VHHOSpace &  vhho_space,
const GlobalDOFSpace &  p_space,
const BoundaryConditions &  BC,
bool  use_threads,
std::ostream &  output = std::cout 
)

Constructor.

Parameters
vhho_spaceVelocity space and operators
p_spaceSpace for the pressure
BCBoundary conditions
use_threadsTrue for parallel execution, false for sequential execution
outputOutput stream to print status messages

Member Function Documentation

◆ assembleLinearSystem() [1/2]

void Stokes::assembleLinearSystem ( const MomentumForcingTermType &  f,
const CompressibilityForcingTermType &  g,
const ViscosityType &  mu,
const VelocityType &  u,
Eigen::VectorXd &  UDir 
)

Assemble the global system

Parameters
fForcing term
gForcing term for the divergence equation
muViscosity
uExact solution for boundary condition
UDirVector filled in by Dirichlets BCs

◆ assembleLinearSystem() [2/2]

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

Parameters
fForcing term
gForcing term for the divergence equation
muViscosity
uExact solution for boundary condition
UDirVector filled in by Dirichlets BCs

◆ computeEnergyNorms() [1/2]

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.

Parameters
list_dofsThe list of vectors representing the dofs

◆ computeEnergyNorms() [2/2]

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.

Parameters
list_dofsThe list of vectors representing the dofs

◆ dimPressure() [1/2]

size_t HArDCore2D::Stokes::dimPressure ( ) const
inline

Returns the dimension of pressure space.

◆ dimPressure() [2/2]

size_t HArDCore2D::Stokes::dimPressure ( ) const
inline

Returns the dimension of pressure space.

◆ dimVelocity() [1/2]

size_t HArDCore2D::Stokes::dimVelocity ( ) const
inline

Returns the dimension of velocity space.

◆ dimVelocity() [2/2]

size_t HArDCore2D::Stokes::dimVelocity ( ) const
inline

Returns the dimension of velocity space.

◆ interpolate() [1/2]

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.

Parameters
uContinuous velocity to interpolate
pContinuous pressure to interpolate
doe_cellThe optional degre of cell quadrature rules to compute the interpolate. If negative, then 2*degree()+3 will be used.
doe_faceThe optional degre of face quadrature rules to compute the interpolate. If negative, then 2*degree()+3 will be used.

◆ interpolate() [2/2]

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.

Parameters
uContinuous velocity to interpolate
pContinuous pressure to interpolate
doe_cellThe optional degre of cell quadrature rules to compute the interpolate. If negative, then 2*degree()+3 will be used.
doe_faceThe optional degre of face quadrature rules to compute the interpolate. If negative, then 2*degree()+3 will be used.

◆ mesh() [1/2]

const Mesh & HArDCore2D::Stokes::mesh ( ) const
inline

Returns the mesh.

◆ mesh() [2/2]

const Mesh & HArDCore2D::Stokes::mesh ( ) const
inline

Returns the mesh.

◆ nloc_sc_p() [1/2]

size_t HArDCore2D::Stokes::nloc_sc_p ( ) const
inline

Returns the local number of pressure statically condensed DOFs.

◆ nloc_sc_p() [2/2]

size_t HArDCore2D::Stokes::nloc_sc_p ( ) const
inline

Returns the local number of pressure statically condensed DOFs.

◆ nloc_sc_u() [1/2]

size_t HArDCore2D::Stokes::nloc_sc_u ( ) const
inline

Returns the local number of velocity statically condensed DOFs.

◆ nloc_sc_u() [2/2]

size_t HArDCore2D::Stokes::nloc_sc_u ( ) const
inline

Returns the local number of velocity statically condensed DOFs.

◆ numDirDOFs() [1/2]

size_t HArDCore2D::Stokes::numDirDOFs ( ) const
inline

Returns the number of Dirichlet DOFs.

◆ numDirDOFs() [2/2]

size_t HArDCore2D::Stokes::numDirDOFs ( ) const
inline

Returns the number of Dirichlet DOFs.

◆ numNonSCDOFs() [1/2]

size_t HArDCore2D::Stokes::numNonSCDOFs ( ) const
inline

Returns the number of DOFs after SC and with Lagrange multiplier, but before eliminating Dirichlet DOFs.

◆ numNonSCDOFs() [2/2]

size_t HArDCore2D::Stokes::numNonSCDOFs ( ) const
inline

Returns the number of DOFs after SC and with Lagrange multiplier, but before eliminating Dirichlet DOFs.

◆ numSCDOFs() [1/2]

size_t HArDCore2D::Stokes::numSCDOFs ( ) const
inline

Returns the number of statically condensed DOFs.

◆ numSCDOFs() [2/2]

size_t HArDCore2D::Stokes::numSCDOFs ( ) const
inline

Returns the number of statically condensed DOFs.

◆ numSCDOFs_p() [1/2]

size_t HArDCore2D::Stokes::numSCDOFs_p ( ) const
inline

Returns the number of pressure statically condensed DOFs.

◆ numSCDOFs_p() [2/2]

size_t HArDCore2D::Stokes::numSCDOFs_p ( ) const
inline

Returns the number of pressure statically condensed DOFs.

◆ numSCDOFs_u() [1/2]

size_t HArDCore2D::Stokes::numSCDOFs_u ( ) const
inline

Returns the number of velocity statically condensed DOFs.

◆ numSCDOFs_u() [2/2]

size_t HArDCore2D::Stokes::numSCDOFs_u ( ) const
inline

Returns the number of velocity statically condensed DOFs.

◆ pressureVertexValues()

Eigen::VectorXd Stokes::pressureVertexValues ( const Eigen::VectorXd &  p) const

Create vertex values for the pressure (from the element values), for plotting.

Parameters
pVector of pressure DOFs

◆ pspace() [1/2]

const GlobalDOFSpace & HArDCore2D::Stokes::pspace ( ) const
inline

Returns the pressure space.

◆ pspace() [2/2]

const GlobalDOFSpace & HArDCore2D::Stokes::pspace ( ) const
inline

Returns the pressure space.

◆ scMatrix() [1/2]

const SystemMatrixType & HArDCore2D::Stokes::scMatrix ( ) const
inline

Returns the static condensation recovery operator.

◆ scMatrix() [2/2]

const SystemMatrixType & HArDCore2D::Stokes::scMatrix ( ) const
inline

Returns the static condensation recovery operator.

◆ scVector() [1/2]

Eigen::VectorXd & HArDCore2D::Stokes::scVector ( )
inline

Returns the static condensation rhs.

◆ scVector() [2/2]

Eigen::VectorXd & HArDCore2D::Stokes::scVector ( )
inline

Returns the static condensation rhs.

◆ sizeSystem() [1/2]

size_t HArDCore2D::Stokes::sizeSystem ( ) const
inline

Returns the size of the final system with Lagrange multiplier, after application of SC and removal of Dirichlet BCs.

◆ sizeSystem() [2/2]

size_t HArDCore2D::Stokes::sizeSystem ( ) const
inline

Returns the size of the final system with Lagrange multiplier, after application of SC and removal of Dirichlet BCs.

◆ stabilizationParameter() [1/4]

double & HArDCore2D::Stokes::stabilizationParameter ( )
inline

Returns the stabilization parameter.

◆ stabilizationParameter() [2/4]

double & HArDCore2D::Stokes::stabilizationParameter ( )
inline

Returns the stabilization parameter.

◆ stabilizationParameter() [3/4]

const double & HArDCore2D::Stokes::stabilizationParameter ( ) const
inline

Returns the stabilization parameter (scaling)

◆ stabilizationParameter() [4/4]

const double & HArDCore2D::Stokes::stabilizationParameter ( ) const
inline

Returns the stabilization parameter (scaling)

◆ systemMatrix() [1/4]

SystemMatrixType & HArDCore2D::Stokes::systemMatrix ( )
inline

Returns the linear system matrix.

◆ systemMatrix() [2/4]

SystemMatrixType & HArDCore2D::Stokes::systemMatrix ( )
inline

Returns the linear system matrix.

◆ systemMatrix() [3/4]

const SystemMatrixType & HArDCore2D::Stokes::systemMatrix ( ) const
inline

Returns the linear system matrix.

◆ systemMatrix() [4/4]

const SystemMatrixType & HArDCore2D::Stokes::systemMatrix ( ) const
inline

Returns the linear system matrix.

◆ systemVector() [1/4]

Eigen::VectorXd & HArDCore2D::Stokes::systemVector ( )
inline

Returns the linear system right-hand side vector.

◆ systemVector() [2/4]

Eigen::VectorXd & HArDCore2D::Stokes::systemVector ( )
inline

Returns the linear system right-hand side vector.

◆ systemVector() [3/4]

const Eigen::VectorXd & HArDCore2D::Stokes::systemVector ( ) const
inline

Returns the linear system right-hand side vector.

◆ systemVector() [4/4]

const Eigen::VectorXd & HArDCore2D::Stokes::systemVector ( ) const
inline

Returns the linear system right-hand side vector.

◆ vhhospace() [1/2]

const VHHOSpace & HArDCore2D::Stokes::vhhospace ( ) const
inline

Returns the velocity space.

◆ vhhospace() [2/2]

const VHHOSpace & HArDCore2D::Stokes::vhhospace ( ) const
inline

Returns the velocity space.


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