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

Lhs for G dH. More...

#include <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 732 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 734 of file FreeSurfaceOps.hpp.

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

Member Function Documentation

◆ iNtegrate()

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

Definition at line 743 of file FreeSurfaceOps.hpp.

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

Member Data Documentation

◆ gradHPtr

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

Definition at line 792 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:238
MoFEM::OpBaseImpl::locMat
MatrixDouble locMat
local entity block matrix
Definition: FormsIntegrators.hpp:249
FTensor::Tensor1
Definition: Tensor1_value.hpp:8
MoFEM::OpBaseImpl::assembleTranspose
bool assembleTranspose
Definition: FormsIntegrators.hpp:246
sdf.r
int r
Definition: sdf.py:8
cylindrical
auto cylindrical
Definition: free_surface.cpp:189
U_FIELD_DIM
constexpr int U_FIELD_DIM
Definition: free_surface.cpp:81
FreeSurfaceOps::OpLhsU_dG::gradHPtr
boost::shared_ptr< MatrixDouble > gradHPtr
Definition: FreeSurfaceOps.hpp:792
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:239
kappa
double kappa
Definition: free_surface.cpp:185
MoFEM::OpBaseImpl::nbCols
int nbCols
number if dof on column
Definition: FormsIntegrators.hpp:237
MoFEM::OpBaseImpl::nbRows
int nbRows
number of dofs on rows
Definition: FormsIntegrators.hpp:236
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:429
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359