v0.14.0
Public Member Functions | Private Attributes | List of all members
FreeSurfaceOps::OpLhsU_dG Struct Reference

Lhs for G dH. More...

#include <users_modules/tutorials/vec-5/src/FreeSurfaceOps.hpp>

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

Public Member Functions

 OpLhsU_dG (const std::string field_name_u, const std::string field_name_h, boost::shared_ptr< MatrixDouble > grad_h_ptr)
 
MoFEMErrorCode iNtegrate (EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
 
- Public Member Functions inherited from MoFEM::OpBaseImpl< A, EleOp >
 OpBaseImpl (const std::string row_field_name, const std::string col_field_name, const OpType type, boost::shared_ptr< Range > ents_ptr=nullptr)
 
MoFEMErrorCode doWork (int row_side, int col_side, EntityType row_type, EntityType col_type, EntData &row_data, EntData &col_data)
 Do calculations for the left hand side. More...
 
MoFEMErrorCode doWork (int row_side, EntityType row_type, EntData &row_data)
 Do calculations for the right hand side. More...
 

Private Attributes

boost::shared_ptr< MatrixDouble > gradHPtr
 

Additional Inherited Members

- Public Types inherited from MoFEM::OpBaseImpl< A, EleOp >
using OpType = typename EleOp::OpType
 
using EntData = EntitiesFieldData::EntData
 
using MatSetValuesHook = boost::function< MoFEMErrorCode(ForcesAndSourcesCore::UserDataOperator *op_ptr, const EntitiesFieldData::EntData &row_data, const EntitiesFieldData::EntData &col_data, MatrixDouble &m)>
 
- Public Attributes inherited from MoFEM::OpBaseImpl< A, EleOp >
TimeFun timeScalingFun
 assumes that time variable is set More...
 
FEFun feScalingFun
 assumes that time variable is set More...
 
boost::shared_ptr< RangeentsPtr
 Entities on which element is run. More...
 
- Static Public Attributes inherited from MoFEM::OpBaseImpl< A, EleOp >
static MatSetValuesHook matSetValuesHook
 
- Protected Member Functions inherited from MoFEM::OpBaseImpl< A, EleOp >
template<int DIM>
FTensor::Tensor1< FTensor::PackPtr< double *, DIM >, DIM > getNf ()
 
template<int DIM>
FTensor::Tensor2< FTensor::PackPtr< double *, DIM >, DIM, DIM > getLocMat (const int rr)
 
virtual MoFEMErrorCode iNtegrate (EntData &row_data, EntData &col_data)
 Integrate grad-grad operator. More...
 
virtual MoFEMErrorCode aSsemble (EntData &row_data, EntData &col_data, const bool trans)
 
virtual MoFEMErrorCode iNtegrate (EntData &data)
 Class dedicated to integrate operator. More...
 
virtual MoFEMErrorCode aSsemble (EntData &data)
 
virtual size_t getNbOfBaseFunctions (EntitiesFieldData::EntData &data)
 Get number of base functions. More...
 
- Protected Attributes inherited from MoFEM::OpBaseImpl< A, EleOp >
int nbRows
 number of dofs on rows More...
 
int nbCols
 number if dof on column More...
 
int nbIntegrationPts
 number of integration points More...
 
int nbRowBaseFunctions
 number or row base functions More...
 
int rowSide
 row side number More...
 
int colSide
 column side number More...
 
EntityType rowType
 row type More...
 
EntityType colType
 column type More...
 
bool assembleTranspose
 
bool onlyTranspose
 
MatrixDouble locMat
 local entity block matrix More...
 
MatrixDouble locMatTranspose
 local entity block matrix More...
 
VectorDouble locF
 local entity vector More...
 

Detailed Description

Lhs for G dH.

Examples
free_surface.cpp.

Definition at line 733 of file FreeSurfaceOps.hpp.

Constructor & Destructor Documentation

◆ OpLhsU_dG()

FreeSurfaceOps::OpLhsU_dG::OpLhsU_dG ( const std::string  field_name_u,
const std::string  field_name_h,
boost::shared_ptr< MatrixDouble >  grad_h_ptr 
)
inline

Definition at line 735 of file FreeSurfaceOps.hpp.

737  : AssemblyDomainEleOp(field_name_u, field_name_h,
738  AssemblyDomainEleOp::OPROWCOL),
739  gradHPtr(grad_h_ptr) {
740  sYmm = false;
741  assembleTranspose = false;
742  }

Member Function Documentation

◆ iNtegrate()

MoFEMErrorCode FreeSurfaceOps::OpLhsU_dG::iNtegrate ( EntitiesFieldData::EntData row_data,
EntitiesFieldData::EntData col_data 
)
inline

Definition at line 744 of file FreeSurfaceOps.hpp.

745  {
747 
748  const double vol = getMeasure();
749  auto t_grad_h = getFTensor1FromMat<SPACE_DIM>(*gradHPtr);
750  auto t_coords = getFTensor1CoordsAtGaussPts();
751 
752  auto t_row_base = row_data.getFTensor0N();
753  auto t_w = getFTensor0IntegrationWeight();
754 
755  for (int gg = 0; gg != nbIntegrationPts; gg++) {
756 
757  const double r = t_coords(0);
758  const double alpha = t_w * vol * cylindrical(r);
759 
760  FTensor::Tensor1<double, SPACE_DIM> t_phase_force_dg;
761  t_phase_force_dg(i) = -alpha * kappa * t_grad_h(i);
762 
763  int rr = 0;
764  for (; rr != nbRows / U_FIELD_DIM; ++rr) {
765  auto t_mat =
766  getFTensor1FromMat<U_FIELD_DIM, 1>(locMat, rr * U_FIELD_DIM);
767  auto t_col_base = col_data.getFTensor0N(gg, 0);
768 
769  for (int cc = 0; cc != nbCols; ++cc) {
770  const double bb = t_row_base * t_col_base;
771  t_mat(i) += t_phase_force_dg(i) * bb;
772 
773  ++t_mat;
774  ++t_col_base;
775  }
776 
777  ++t_row_base;
778  }
779 
780  for (; rr < nbRowBaseFunctions; ++rr) {
781  ++t_row_base;
782  }
783 
784  ++t_grad_h;
785  ++t_coords;
786  ++t_w;
787  }
788 
790  }

Member Data Documentation

◆ gradHPtr

boost::shared_ptr<MatrixDouble> FreeSurfaceOps::OpLhsU_dG::gradHPtr
private

Definition at line 793 of file FreeSurfaceOps.hpp.


The documentation for this struct was generated from the following file:
MoFEM::OpBaseImpl::nbIntegrationPts
int nbIntegrationPts
number of integration points
Definition: FormsIntegrators.hpp:228
MoFEM::OpBaseImpl::locMat
MatrixDouble locMat
local entity block matrix
Definition: FormsIntegrators.hpp:239
FTensor::Tensor1
Definition: Tensor1_value.hpp:8
MoFEM::OpBaseImpl::assembleTranspose
bool assembleTranspose
Definition: FormsIntegrators.hpp:236
sdf.r
int r
Definition: sdf.py:8
cylindrical
auto cylindrical
Definition: free_surface.cpp:187
U_FIELD_DIM
constexpr int U_FIELD_DIM
Definition: free_surface.cpp:79
FreeSurfaceOps::OpLhsU_dG::gradHPtr
boost::shared_ptr< MatrixDouble > gradHPtr
Definition: FreeSurfaceOps.hpp:793
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: hcurl_divergence_operator_2d.cpp:27
MoFEM::OpBaseImpl::nbRowBaseFunctions
int nbRowBaseFunctions
number or row base functions
Definition: FormsIntegrators.hpp:229
kappa
double kappa
Definition: free_surface.cpp:183
MoFEM::OpBaseImpl::nbCols
int nbCols
number if dof on column
Definition: FormsIntegrators.hpp:227
MoFEM::OpBaseImpl::nbRows
int nbRows
number of dofs on rows
Definition: FormsIntegrators.hpp:226
AssemblyDomainEleOp
FormsIntegrators< DomainEleOp >::Assembly< A >::OpBase AssemblyDomainEleOp
Definition: tensor_divergence_operator.cpp:59
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:416
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:346