25#ifndef __NAVIERSTOKESELEMENT_HPP__
26#define __NAVIERSTOKESELEMENT_HPP__
28#ifndef __BASICFINITEELEMENTS_HPP__
32using namespace boost::numeric;
60 boost::shared_ptr<MatrixDouble>
velPtr;
101 CHKERR PetscOptionsBegin(PETSC_COMM_WORLD,
"",
"Problem",
"none");
103 ierr = PetscOptionsEnd();
137 const string element_name,
138 const string velocity_field_name,
139 const string pressure_field_name,
140 const string mesh_field_name,
142 Range *ents =
nullptr) {
148 velocity_field_name);
150 velocity_field_name);
152 velocity_field_name);
155 pressure_field_name);
157 pressure_field_name);
159 pressure_field_name);
164 if (ents !=
nullptr) {
189 boost::shared_ptr<VolumeElementForcesAndSourcesCore> feRhs,
190 boost::shared_ptr<VolumeElementForcesAndSourcesCore> feLhs,
191 const std::string velocity_field,
const std::string pressure_field,
192 boost::shared_ptr<CommonData> common_data,
const EntityType type = MBTET);
209 boost::shared_ptr<VolumeElementForcesAndSourcesCore> feRhs,
210 boost::shared_ptr<VolumeElementForcesAndSourcesCore> feLhs,
211 const std::string velocity_field,
const std::string pressure_field,
212 boost::shared_ptr<CommonData> common_data,
const EntityType type = MBTET);
228 boost::shared_ptr<FaceElementForcesAndSourcesCore> dragFe,
229 boost::shared_ptr<VolumeElementForcesAndSourcesCoreOnSide> sideDragFe,
230 std::string side_fe_name,
const std::string velocity_field,
231 const std::string pressure_field,
232 boost::shared_ptr<CommonData> common_data);
248 boost::shared_ptr<PostProcFaceOnRefinedMesh> postProcDragPtr,
249 boost::shared_ptr<VolumeElementForcesAndSourcesCoreOnSide> sideDragFe,
250 std::string side_fe_name,
const std::string velocity_field,
251 const std::string pressure_field,
252 boost::shared_ptr<CommonData> common_data);
258 boost::shared_ptr<VolumeElementForcesAndSourcesCore> fe_flux_ptr,
259 const std::string velocity_field,
260 boost::shared_ptr<CommonData> common_data,
const EntityType type = MBTET);
271 int operator()(
int order_row,
int order_col,
int order_data)
const {
272 return 2 * order_data;
277 int operator()(
int order_row,
int order_col,
int order_data)
const {
278 return order_data + 2;
300 boost::shared_ptr<CommonData> common_data,
328 const string field_name_col,
329 boost::shared_ptr<CommonData> common_data,
350 const string field_name_col,
351 boost::shared_ptr<CommonData> common_data,
372 const string field_name_col,
373 boost::shared_ptr<CommonData> common_data,
397 boost::shared_ptr<CommonData> common_data,
428 boost::shared_ptr<CommonData> common_data,
457 boost::shared_ptr<CommonData> common_data,
476 boost::shared_ptr<CommonData> common_data,
503 boost::shared_ptr<CommonData> &common_data,
532 boost::shared_ptr<VolumeElementForcesAndSourcesCoreOnSide>
sideFe;
537 boost::shared_ptr<VolumeElementForcesAndSourcesCoreOnSide> &side_fe,
538 std::string side_fe_name, boost::shared_ptr<CommonData> &common_data,
567 std::vector<EntityHandle> &map_gauss_pts,
568 boost::shared_ptr<CommonData> &common_data,
597 std::vector<EntityHandle> &map_gauss_pts,
598 boost::shared_ptr<CommonData> &common_data,
626 boost::shared_ptr<CommonData> common_data,
EntitiesFieldData::EntData EntData
#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 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 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_data(const std::string &fe_name, const std::string &name_filed)=0
set finite element field data
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
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
UBlasMatrix< double > MatrixDouble
UBlasVector< double > VectorDouble
auto createSmartVectorMPI(MPI_Comm comm, PetscInt n, PetscInt N)
Create MPI Vector.
DeprecatedCoreInterface Interface
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
friend class UserDataOperator
@ OPROW
operator doWork function is executed on FE rows
@ OPROWCOL
operator doWork is executed on FE rows &columns
friend class UserDataOperator
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 setPostProcDragOperators(boost::shared_ptr< PostProcFaceOnRefinedMesh > 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 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 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.