v0.15.5
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
FreeSurfaceOps::OpCalculateLift Struct Reference

Calculate lift force on free surface boundary. More...

#include "tutorials/vec-5_free_surface/src/FreeSurfaceOps.hpp"

Inheritance diagram for FreeSurfaceOps::OpCalculateLift:
[legend]
Collaboration diagram for FreeSurfaceOps::OpCalculateLift:
[legend]

Public Member Functions

 OpCalculateLift (const std::string field_name, boost::shared_ptr< VectorDouble > p_ptr, boost::shared_ptr< VectorDouble > lift_ptr, boost::shared_ptr< Range > ents_ptr)
 
MoFEMErrorCode doWork (int row_side, EntityType row_type, EntitiesFieldData::EntData &data)
 

Private Attributes

boost::shared_ptr< VectorDouble > pPtr
 
boost::shared_ptr< VectorDouble > liftPtr
 
boost::shared_ptr< RangeentsPtr
 

Detailed Description

Calculate lift force on free surface boundary.

Parameters
field_nameName of the field associated with the operator
p_ptrPointer to the pressure vector on the free surface
lift_ptrPointer to the lift force vector to be computed
ents_ptrPointer to the range of entities (edges) to consider
Returns
MoFEMErrorCode

Computes the integral ∫_Γ ​-p n dΓ, where:

Examples
mofem/tutorials/vec-5_free_surface/free_surface.cpp.

Definition at line 31 of file FreeSurfaceOps.hpp.

Constructor & Destructor Documentation

◆ OpCalculateLift()

FreeSurfaceOps::OpCalculateLift::OpCalculateLift ( const std::string  field_name,
boost::shared_ptr< VectorDouble >  p_ptr,
boost::shared_ptr< VectorDouble >  lift_ptr,
boost::shared_ptr< Range ents_ptr 
)
inline

Definition at line 32 of file FreeSurfaceOps.hpp.

36 : BoundaryEleOp(field_name, field_name, BoundaryEleOp::OPROW),
37 pPtr(p_ptr), liftPtr(lift_ptr), entsPtr(ents_ptr) {
38 std::fill(&doEntities[MBVERTEX], &doEntities[MBMAXTYPE], false);
39 doEntities[MBEDGE] = true;
40 }
BoundaryEle::UserDataOperator BoundaryEleOp
constexpr auto field_name
boost::shared_ptr< VectorDouble > liftPtr
boost::shared_ptr< VectorDouble > pPtr
boost::shared_ptr< Range > entsPtr

Member Function Documentation

◆ doWork()

MoFEMErrorCode FreeSurfaceOps::OpCalculateLift::doWork ( int  row_side,
EntityType  row_type,
EntitiesFieldData::EntData &  data 
)
inline

Definition at line 42 of file FreeSurfaceOps.hpp.

43 {
45
46 const auto fe_ent = getFEEntityHandle();
47 if (entsPtr->find(fe_ent) != entsPtr->end()) {
48
49 auto t_w = getFTensor0IntegrationWeight();
50 auto t_p = getFTensor0FromVec(*pPtr);
51 auto t_normal = getFTensor1Normal();
52 auto t_coords = getFTensor1CoordsAtGaussPts();
53 auto t_lift = getFTensor1FromArray<SPACE_DIM, SPACE_DIM>(*liftPtr);
54
55 const auto nb_int_points = getGaussPts().size2();
56
57 for (int gg = 0; gg != nb_int_points; gg++) {
58
59 const double r = t_coords(0);
60 const double alpha = cylindrical(r) * t_w;
61 t_lift(i) -= t_normal(i) * (t_p * alpha); // −p n
62
63 ++t_w;
64 ++t_p;
65 ++t_coords;
66 }
67 }
68
70 }
#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()
auto cylindrical
[cylindrical]
FTensor::Index< 'i', SPACE_DIM > i
int r
Definition sdf.py:205

Member Data Documentation

◆ entsPtr

boost::shared_ptr<Range> FreeSurfaceOps::OpCalculateLift::entsPtr
private

Definition at line 75 of file FreeSurfaceOps.hpp.

◆ liftPtr

boost::shared_ptr<VectorDouble> FreeSurfaceOps::OpCalculateLift::liftPtr
private

Definition at line 74 of file FreeSurfaceOps.hpp.

◆ pPtr

boost::shared_ptr<VectorDouble> FreeSurfaceOps::OpCalculateLift::pPtr
private

Definition at line 73 of file FreeSurfaceOps.hpp.


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