No Matches
Public Member Functions | Private Attributes | List of all members
OpDomainResidualVector Struct Reference

Integrate the domain residual vector (RHS) More...

Inheritance diagram for OpDomainResidualVector:
Collaboration diagram for OpDomainResidualVector:

Public Member Functions

 OpDomainResidualVector (std::string field_name, boost::shared_ptr< MatrixDouble > field_grad_mat)
MoFEMErrorCode iNtegrate (EntData &data)
 Class dedicated to integrate operator. More...
- 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 > fieldGradMat

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

Integrate the domain residual vector (RHS)

\[ \sum\limits_j {\left[ {\int\limits_{{\Omega _e}} {\left( {{a_n}\nabla {\phi _i} \cdot \nabla {\phi _j} - a_n^3\nabla {\phi _i}\left( {\nabla u \cdot \nabla {\phi _j}} \right)\nabla u} \right)d{\Omega _e}} } \right]\delta {U_j}} = \int\limits_{{\Omega _e}} {{\phi _i}fd{\Omega _e}} - \int\limits_{{\Omega _e}} {\nabla {\phi _i}{a_n}\nabla ud{\Omega _e}} \\ {a_n} = \frac{1}{{{{\left( {1 + {{\left| {\nabla u} \right|}^2}} \right)}^{\frac{1}{2}}}}} \]

Definition at line 118 of file minimal_surface_equation.cpp.

Constructor & Destructor Documentation

◆ OpDomainResidualVector()

OpDomainResidualVector::OpDomainResidualVector ( std::string  field_name,
boost::shared_ptr< MatrixDouble >  field_grad_mat 

Definition at line 120 of file minimal_surface_equation.cpp.

122 : AssemblyDomainEleOp(field_name, field_name, AssemblyDomainEleOp::OPROW),
123 fieldGradMat(field_grad_mat) {}
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::OpBase AssemblyDomainEleOp
constexpr auto field_name
boost::shared_ptr< MatrixDouble > fieldGradMat

Member Function Documentation

◆ iNtegrate()

MoFEMErrorCode OpDomainResidualVector::iNtegrate ( EntData data)

Class dedicated to integrate operator.

dataentity data on element row
error code

Reimplemented from MoFEM::OpBaseImpl< A, EleOp >.

Definition at line 125 of file minimal_surface_equation.cpp.

125 {
128 auto &nf = AssemblyDomainEleOp::locF;
130 // get element area
131 const double area = getMeasure();
133 // get number of integration points
134 const int nb_integration_points = getGaussPts().size2();
135 // get integration weights
136 auto t_w = getFTensor0IntegrationWeight();
137 // get gradient of the field at integration points
138 auto t_field_grad = getFTensor1FromMat<2>(*fieldGradMat);
140 // get base functions
141 auto t_base = data.getFTensor0N();
142 // get derivatives of base functions
143 auto t_diff_base = data.getFTensor1DiffN<2>();
146 for (int gg = 0; gg != nb_integration_points; gg++) {
148 const double a = t_w * area;
149 const double an = 1. / std::sqrt(1 + t_field_grad(i) * t_field_grad(i));
151 for (int rr = 0; rr != AssemblyDomainEleOp::nbRows; rr++) {
153 // calculate components of the local vector
154 // remember to use -= here due to PETSc consideration of Residual Vec
155 nf[rr] += (t_diff_base(i) * t_field_grad(i)) * an * a;
157 // move to the next base function
158 ++t_base;
159 // move to the derivatives of the next base function
160 ++t_diff_base;
161 }
163 // move to the weight of the next integration point
164 ++t_w;
165 // move to the gradient of the field at the next integration point
166 ++t_field_grad;
167 }
170 }
constexpr double a
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:346
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:416
FTensor::Index< 'i', 2 > i
FTensor::Tensor1< FTensor::PackPtr< double *, Tensor_Dim >, Tensor_Dim > getFTensor1DiffN(const FieldApproximationBase base)
Get derivatives of base functions.
FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0N(const FieldApproximationBase base)
Get base function as Tensor0.
VectorDouble locF
local entity vector
int nbRows
number of dofs on rows

Member Data Documentation

◆ fieldGradMat

boost::shared_ptr<MatrixDouble> OpDomainResidualVector::fieldGradMat

Definition at line 173 of file minimal_surface_equation.cpp.

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