13#ifndef __NAVIERSTOKESELEMENT_HPP__
14#define __NAVIERSTOKESELEMENT_HPP__
16#ifndef __BASICFINITEELEMENTS_HPP__
20using namespace boost::numeric;
53 boost::shared_ptr<MatrixDouble>
velPtr;
94 CHKERR PetscOptionsBegin(PETSC_COMM_WORLD,
"",
"Problem",
"none");
96 ierr = PetscOptionsEnd();
130 const string element_name,
131 const string velocity_field_name,
132 const string pressure_field_name,
133 const string mesh_field_name,
135 Range *ents =
nullptr) {
141 velocity_field_name);
143 velocity_field_name);
145 velocity_field_name);
148 pressure_field_name);
150 pressure_field_name);
152 pressure_field_name);
157 if (ents !=
nullptr) {
182 boost::shared_ptr<VolumeElementForcesAndSourcesCore> feRhs,
183 boost::shared_ptr<VolumeElementForcesAndSourcesCore> feLhs,
184 const std::string velocity_field,
const std::string pressure_field,
185 boost::shared_ptr<CommonData> common_data,
const EntityType type = MBTET);
202 boost::shared_ptr<VolumeElementForcesAndSourcesCore> feRhs,
203 boost::shared_ptr<VolumeElementForcesAndSourcesCore> feLhs,
204 const std::string velocity_field,
const std::string pressure_field,
205 boost::shared_ptr<CommonData> common_data,
const EntityType type = MBTET);
221 boost::shared_ptr<FaceElementForcesAndSourcesCore> dragFe,
222 boost::shared_ptr<VolumeElementForcesAndSourcesCoreOnSide> sideDragFe,
223 std::string side_fe_name,
const std::string velocity_field,
224 const std::string pressure_field,
225 boost::shared_ptr<CommonData> common_data);
241 boost::shared_ptr<PostProcFace> postProcDragPtr,
242 boost::shared_ptr<VolumeElementForcesAndSourcesCoreOnSide> sideDragFe,
243 std::string side_fe_name,
const std::string velocity_field,
244 const std::string pressure_field,
245 boost::shared_ptr<CommonData> common_data);
251 boost::shared_ptr<VolumeElementForcesAndSourcesCore> fe_flux_ptr,
252 const std::string velocity_field,
253 boost::shared_ptr<CommonData> common_data,
const EntityType type = MBTET);
264 int operator()(
int order_row,
int order_col,
int order_data)
const {
265 return 2 * order_data;
270 int operator()(
int order_row,
int order_col,
int order_data)
const {
271 return order_data + 2;
293 boost::shared_ptr<CommonData> common_data,
321 const string field_name_col,
322 boost::shared_ptr<CommonData> common_data,
343 const string field_name_col,
344 boost::shared_ptr<CommonData> common_data,
365 const string field_name_col,
366 boost::shared_ptr<CommonData> common_data,
390 boost::shared_ptr<CommonData> common_data,
421 boost::shared_ptr<CommonData> common_data,
450 boost::shared_ptr<CommonData> common_data,
469 boost::shared_ptr<CommonData> common_data,
496 boost::shared_ptr<CommonData> &common_data,
525 boost::shared_ptr<VolumeElementForcesAndSourcesCoreOnSide>
sideFe;
530 boost::shared_ptr<VolumeElementForcesAndSourcesCoreOnSide> &side_fe,
531 std::string side_fe_name, boost::shared_ptr<CommonData> &common_data,
560 std::vector<EntityHandle> &map_gauss_pts,
561 boost::shared_ptr<CommonData> &common_data,
590 std::vector<EntityHandle> &map_gauss_pts,
591 boost::shared_ptr<CommonData> &common_data,
619 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_data(const std::string &fe_name, const std::string name_filed)=0
set finite element field data
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
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
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
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 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 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)
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)
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.