13#ifndef __NAVIERSTOKESELEMENT_HPP__ 
   14#define __NAVIERSTOKESELEMENT_HPP__ 
   16#ifndef __BASICFINITEELEMENTS_HPP__ 
   20using namespace boost::numeric;
 
   53    boost::shared_ptr<MatrixDouble> 
velPtr;
 
   94      PetscOptionsBegin(PETSC_COMM_WORLD, 
"", 
"Problem", 
"none");
 
 
 
  128                                               const string element_name,
 
  129                                               const string velocity_field_name,
 
  130                                               const string pressure_field_name,
 
  131                                               const string mesh_field_name,
 
  133                                               Range *ents = 
nullptr) {
 
  139                                                       velocity_field_name);
 
  141                                                       velocity_field_name);
 
  143                                                        velocity_field_name);
 
  146                                                       pressure_field_name);
 
  148                                                       pressure_field_name);
 
  150                                                        pressure_field_name);
 
  155    if (ents != 
nullptr) {
 
 
  180      boost::shared_ptr<VolumeElementForcesAndSourcesCore> feRhs,
 
  181      boost::shared_ptr<VolumeElementForcesAndSourcesCore> feLhs,
 
  182      const std::string velocity_field, 
const std::string pressure_field,
 
  183      boost::shared_ptr<CommonData> common_data, 
const EntityType type = MBTET);
 
  200      boost::shared_ptr<VolumeElementForcesAndSourcesCore> feRhs,
 
  201      boost::shared_ptr<VolumeElementForcesAndSourcesCore> feLhs,
 
  202      const std::string velocity_field, 
const std::string pressure_field,
 
  203      boost::shared_ptr<CommonData> common_data, 
const EntityType type = MBTET);
 
  219      boost::shared_ptr<FaceElementForcesAndSourcesCore> dragFe,
 
  220      boost::shared_ptr<VolumeElementForcesAndSourcesCoreOnSide> sideDragFe,
 
  221      std::string side_fe_name, 
const std::string velocity_field,
 
  222      const std::string pressure_field,
 
  223      boost::shared_ptr<CommonData> common_data);
 
  239      boost::shared_ptr<PostProcFace> postProcDragPtr,
 
  240      boost::shared_ptr<VolumeElementForcesAndSourcesCoreOnSide> sideDragFe,
 
  241      std::string side_fe_name, 
const std::string velocity_field,
 
  242      const std::string pressure_field,
 
  243      boost::shared_ptr<CommonData> common_data);
 
  249      boost::shared_ptr<VolumeElementForcesAndSourcesCore> fe_flux_ptr,
 
  250      const std::string velocity_field,
 
  251      boost::shared_ptr<CommonData> common_data, 
const EntityType type = MBTET);
 
  262    int operator()(
int order_row, 
int order_col, 
int order_data)
 const {
 
  263      return 2 * order_data;
 
 
 
  268    int operator()(
int order_row, 
int order_col, 
int order_data)
 const {
 
  269      return order_data + 2;
 
 
 
  291                  boost::shared_ptr<CommonData> common_data,
 
 
  301                          EntityType col_type, 
EntData &row_data,
 
 
  319                         const string field_name_col,
 
  320                         boost::shared_ptr<CommonData> common_data,
 
 
 
  341                         const string field_name_col,
 
  342                         boost::shared_ptr<CommonData> common_data,
 
 
 
  363                            const string field_name_col,
 
  364                            boost::shared_ptr<CommonData> common_data,
 
 
 
  388                  boost::shared_ptr<CommonData> common_data,
 
 
 
  419                             boost::shared_ptr<CommonData> common_data,
 
 
 
  448                                boost::shared_ptr<CommonData> common_data,
 
 
 
  467                          boost::shared_ptr<CommonData> common_data,
 
 
 
  494                    boost::shared_ptr<CommonData> &common_data,
 
 
 
  523    boost::shared_ptr<VolumeElementForcesAndSourcesCoreOnSide> 
sideFe;
 
  528        boost::shared_ptr<VolumeElementForcesAndSourcesCoreOnSide> &side_fe,
 
  529        std::string side_fe_name, boost::shared_ptr<CommonData> &common_data,
 
 
 
  558                   std::vector<EntityHandle> &map_gauss_pts,
 
  559                   boost::shared_ptr<CommonData> &common_data,
 
 
 
  588                        std::vector<EntityHandle> &map_gauss_pts,
 
  589                        boost::shared_ptr<CommonData> &common_data,
 
 
 
  617                     boost::shared_ptr<CommonData> common_data,
 
 
 
 
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
virtual MoFEMErrorCode add_ents_to_finite_element_by_dim(const EntityHandle entities, const int dim, const std::string name, const bool recursive=true)=0
add entities to finite element
virtual MoFEMErrorCode add_finite_element(const std::string &fe_name, enum MoFEMTypes bh=MF_EXCL, int verb=DEFAULT_VERBOSITY)=0
add finite element
virtual MoFEMErrorCode modify_finite_element_add_field_col(const std::string &fe_name, const std::string name_row)=0
set field col which finite element use
virtual MoFEMErrorCode modify_finite_element_add_field_row(const std::string &fe_name, const std::string name_row)=0
set field row which finite element use
virtual MoFEMErrorCode modify_finite_element_add_field_data(const std::string &fe_name, const std::string name_field)=0
set finite element field data
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
UBlasMatrix< double > MatrixDouble
UBlasVector< double > VectorDouble
auto createVectorMPI(MPI_Comm comm, PetscInt n, PetscInt N)
Create MPI Vector.
constexpr auto field_name
Class used to scale loads, f.e. in arc-length control.
virtual MPI_Comm & get_comm() const =0
virtual int get_comm_rank() const =0
bool & doPrisms
\deprectaed
bool sYmm
If true assume that matrix is symmetric structure.
bool & doVertices
\deprectaed If false skip vertices
bool & doEdges
\deprectaed If false skip edges
bool & doQuads
\deprectaed
Deprecated interface functions.
Data on single entity (This is passed as argument to DataOperator::doWork)
Structure for user loop methods on finite elements.
default operator for TRI element
@ OPROW
operator doWork function is executed on FE rows
@ OPROWCOL
operator doWork is executed on FE rows &columns
intrusive_ptr for managing petsc objects
boost::shared_ptr< MatrixDouble > pressureDragTract
SmartPetscObj< Vec > volumeFluxVec
boost::shared_ptr< MatrixDouble > gradVelPtr
std::map< int, BlockData > setOfBlocksData
boost::shared_ptr< MatrixDouble > shearDragTract
std::map< int, BlockData > setOfFacesData
MoFEMErrorCode getParameters()
boost::shared_ptr< VectorDouble > pressPtr
boost::shared_ptr< MatrixDouble > totalDragTract
CommonData(MoFEM::Interface &m_field)
SmartPetscObj< Vec > pressureDragForceVec
boost::shared_ptr< MatrixDouble > velPtr
SmartPetscObj< Vec > totalDragForceVec
SmartPetscObj< Vec > shearDragForceVec
int operator()(int order_row, int order_col, int order_data) const
MoFEMErrorCode scaleNf(const FEMethod *fe, VectorDouble &nf)
Assemble linear (symmetric) part of the diagonal block of the LHS Operator for assembling linear (sym...
OpAssembleLhsDiagLin(const string field_name_row, const string field_name_col, boost::shared_ptr< CommonData > common_data, BlockData &block_data)
MoFEMErrorCode iNtegrate(EntData &row_data, EntData &col_data)
FTensor::Tensor2< double, 3, 3 > diffDiff
Assemble non-linear (non-symmetric) part of the diagonal block of the LHS Operator for assembling non...
OpAssembleLhsDiagNonLin(const string field_name_row, const string field_name_col, boost::shared_ptr< CommonData > common_data, BlockData &block_data)
MoFEMErrorCode iNtegrate(EntData &row_data, EntData &col_data)
FTensor::Tensor2< double, 3, 3 > diffDiff
Assemble off-diagonal block of the LHS Operator for assembling off-diagonal block of the LHS.
MoFEMErrorCode iNtegrate(EntData &row_data, EntData &col_data)
OpAssembleLhsOffDiag(const string field_name_row, const string field_name_col, boost::shared_ptr< CommonData > common_data, BlockData &block_data)
Base class for operators assembling LHS.
MoFEMErrorCode aSsemble(EntData &row_data, EntData &col_data)
virtual MoFEMErrorCode iNtegrate(EntData &row_data, EntData &col_data)
MoFEMErrorCode doWork(int row_side, int col_side, EntityType row_type, EntityType col_type, EntData &row_data, EntData &col_data)
Operator for bi-linear form, usually to calculate values on left hand side.
boost::shared_ptr< CommonData > commonData
OpAssembleLhs(const string field_name_row, const string field_name_col, boost::shared_ptr< CommonData > common_data, BlockData &block_data)
Assemble the pressure component of the RHS vector.
MoFEMErrorCode iNtegrate(EntData &data)
Integrate local constrains vector.
OpAssembleRhsPressure(const string field_name, boost::shared_ptr< CommonData > common_data, BlockData &block_data)
Assemble linear part of the velocity component of the RHS vector.
MoFEMErrorCode iNtegrate(EntData &data)
Integrate local entity vector.
OpAssembleRhsVelocityLin(const string field_name, boost::shared_ptr< CommonData > common_data, BlockData &block_data)
Assemble non-linear part of the velocity component of the RHS vector.
MoFEMErrorCode iNtegrate(EntData &data)
OpAssembleRhsVelocityNonLin(const string field_name, boost::shared_ptr< CommonData > common_data, BlockData &block_data)
Base class for operators assembling RHS.
OpAssembleRhs(const string field_name, boost::shared_ptr< CommonData > common_data, BlockData &block_data)
boost::shared_ptr< CommonData > commonData
MoFEMErrorCode doWork(int row_side, EntityType row_type, EntData &row_data)
Operator for linear form, usually to calculate values on right hand side.
MoFEMErrorCode aSsemble(EntData &data)
int nbRows
number of dofs on row
virtual MoFEMErrorCode iNtegrate(EntData &data)
Calculate drag force on the fluid-solid interface.
boost::shared_ptr< CommonData > commonData
OpCalcDragForce(const string field_name, boost::shared_ptr< CommonData > &common_data, BlockData &block_data)
MoFEMErrorCode doWork(int side, EntityType type, EntData &data)
Operator for linear form, usually to calculate values on right hand side.
Calculate drag traction on the fluid-solid interface.
MoFEMErrorCode doWork(int side, EntityType type, EntData &data)
Operator for linear form, usually to calculate values on right hand side.
boost::shared_ptr< CommonData > commonData
boost::shared_ptr< VolumeElementForcesAndSourcesCoreOnSide > sideFe
OpCalcDragTraction(const string field_name, boost::shared_ptr< VolumeElementForcesAndSourcesCoreOnSide > &side_fe, std::string side_fe_name, boost::shared_ptr< CommonData > &common_data, BlockData &block_data)
calculating volumetric flux
MoFEMErrorCode doWork(int side, EntityType type, EntData &data)
Operator for linear form, usually to calculate values on right hand side.
int nbRows
number of dofs on row
OpCalcVolumeFlux(const string field_name, boost::shared_ptr< CommonData > common_data, BlockData &block_data)
boost::shared_ptr< CommonData > commonData
Post processing output of drag traction on the fluid-solid interface.
boost::shared_ptr< CommonData > commonData
MoFEMErrorCode doWork(int side, EntityType type, EntData &data)
Operator for linear form, usually to calculate values on right hand side.
OpPostProcDrag(const string field_name, moab::Interface &post_proc_mesh, std::vector< EntityHandle > &map_gauss_pts, boost::shared_ptr< CommonData > &common_data, BlockData &block_data)
moab::Interface & postProcMesh
std::vector< EntityHandle > & mapGaussPts
Post processing output of the vorticity criterion levels.
moab::Interface & postProcMesh
std::vector< EntityHandle > & mapGaussPts
OpPostProcVorticity(moab::Interface &post_proc_mesh, std::vector< EntityHandle > &map_gauss_pts, boost::shared_ptr< CommonData > &common_data, BlockData &block_data)
MoFEMErrorCode doWork(int side, EntityType type, EntData &data)
Operator for linear form, usually to calculate values on right hand side.
boost::shared_ptr< CommonData > commonData
Set integration rule to volume elements.
int operator()(int order_row, int order_col, int order_data) const
Element for simulating viscous fluid flow.
static MoFEMErrorCode setCalcDragOperators(boost::shared_ptr< FaceElementForcesAndSourcesCore > dragFe, boost::shared_ptr< VolumeElementForcesAndSourcesCoreOnSide > sideDragFe, std::string side_fe_name, const std::string velocity_field, const std::string pressure_field, boost::shared_ptr< CommonData > common_data)
Setting up operators for calculating drag force on the solid surface.
static MoFEMErrorCode addElement(MoFEM::Interface &m_field, const string element_name, const string velocity_field_name, const string pressure_field_name, const string mesh_field_name, const int dim=3, Range *ents=nullptr)
Setting up elements.
static MoFEMErrorCode setPostProcDragOperators(boost::shared_ptr< PostProcFace > postProcDragPtr, boost::shared_ptr< VolumeElementForcesAndSourcesCoreOnSide > sideDragFe, std::string side_fe_name, const std::string velocity_field, const std::string pressure_field, boost::shared_ptr< CommonData > common_data)
Setting up operators for post processing output of drag traction.
static MoFEMErrorCode setNavierStokesOperators(boost::shared_ptr< VolumeElementForcesAndSourcesCore > feRhs, boost::shared_ptr< VolumeElementForcesAndSourcesCore > feLhs, const std::string velocity_field, const std::string pressure_field, boost::shared_ptr< CommonData > common_data, const EntityType type=MBTET)
Setting up operators for solving Navier-Stokes equations.
static MoFEMErrorCode setStokesOperators(boost::shared_ptr< VolumeElementForcesAndSourcesCore > feRhs, boost::shared_ptr< VolumeElementForcesAndSourcesCore > feLhs, const std::string velocity_field, const std::string pressure_field, boost::shared_ptr< CommonData > common_data, const EntityType type=MBTET)
Setting up operators for solving Stokes equations.
static MoFEMErrorCode setCalcVolumeFluxOperators(boost::shared_ptr< VolumeElementForcesAndSourcesCore > fe_flux_ptr, const std::string velocity_field, boost::shared_ptr< CommonData > common_data, const EntityType type=MBTET)
Setting up operators for calculation of volume flux.