v0.16.0
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
FreeSurfaceOps::OpRhsG< I > Struct Template Reference

Rhs for G (chemical potential residual) More...

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

Inheritance diagram for FreeSurfaceOps::OpRhsG< I >:
[legend]
Collaboration diagram for FreeSurfaceOps::OpRhsG< I >:
[legend]

Public Member Functions

 OpRhsG (const std::string field_name, boost::shared_ptr< VectorDouble > h_ptr, boost::shared_ptr< MatrixDouble > grad_h_ptr, boost::shared_ptr< VectorDouble > g_ptr)
 
MoFEMErrorCode iNtegrate (EntitiesFieldData::EntData &data)
 

Private Attributes

boost::shared_ptr< VectorDouble > hPtr
 
boost::shared_ptr< MatrixDouble > gradHPtr
 
boost::shared_ptr< VectorDouble > gPtr
 

Detailed Description

template<bool I>
struct FreeSurfaceOps::OpRhsG< I >

Rhs for G (chemical potential residual)

Parameters
field_nameName of the field associated with the operator
h_ptrPointer to the free surface height vector (H)
grad_h_ptrPointer to the free surface height gradient matrix (∇H)
g_ptrPointer to the chemical potential vector (G)
Returns
MoFEMErrorCode

Implements Lovric 3.1d (excpet for wetting boundary term - see OpWettingAngleRhs/Lhs): R_g = ∫_Ω s(g - f(h)) - ∇s·(ε²∇h) dΩ

The template boolean I selects initialization (I=true) vs evolution (I=false).

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

Definition at line 1387 of file FreeSurfaceOps.hpp.

Constructor & Destructor Documentation

◆ OpRhsG()

template<bool I>
FreeSurfaceOps::OpRhsG< I >::OpRhsG ( const std::string  field_name,
boost::shared_ptr< VectorDouble >  h_ptr,
boost::shared_ptr< MatrixDouble >  grad_h_ptr,
boost::shared_ptr< VectorDouble >  g_ptr 
)
inline

Definition at line 1389 of file FreeSurfaceOps.hpp.

1392 : AssemblyDomainEleOp(field_name, field_name, AssemblyDomainEleOp::OPROW),
1393 hPtr(h_ptr), gradHPtr(grad_h_ptr), gPtr(g_ptr) {}
constexpr auto field_name
boost::shared_ptr< MatrixDouble > gradHPtr
boost::shared_ptr< VectorDouble > hPtr
boost::shared_ptr< VectorDouble > gPtr
FormsIntegrators< DomainEleOp >::Assembly< A >::OpBase AssemblyDomainEleOp

Member Function Documentation

◆ iNtegrate()

template<bool I>
MoFEMErrorCode FreeSurfaceOps::OpRhsG< I >::iNtegrate ( EntitiesFieldData::EntData &  data)
inline

Definition at line 1395 of file FreeSurfaceOps.hpp.

1395 {
1397
1398 const double vol = getMeasure();
1399 auto t_h = getFTensor0FromVec(*hPtr);
1400 auto t_grad_h = getFTensor1FromMat<SPACE_DIM>(*gradHPtr);
1401 auto t_g = getFTensor0FromVec(*gPtr);
1402 auto t_coords = getFTensor1CoordsAtGaussPts();
1403
1404 auto t_base = data.getFTensor0N();
1405 auto t_diff_base = data.getFTensor1DiffN<SPACE_DIM>();
1406 auto t_w = getFTensor0IntegrationWeight();
1407
1408 for (int gg = 0; gg != nbIntegrationPts; ++gg) {
1409
1410 const double r = t_coords(0);
1411 const double alpha = t_w * vol * cylindrical(r);
1412
1413 double set_h;
1414 if constexpr (I)
1415 set_h = init_h(t_coords(0), t_coords(1), t_coords(2));
1416 else
1417 set_h = t_h;
1418
1419 const double f = get_f(set_h);
1420
1421 int bb = 0;
1422 for (; bb != nbRows; ++bb) {
1423 locF[bb] += (t_base * alpha) * (t_g - f); // Bulk term: (g - f(h))
1424 locF[bb] -= (t_diff_base(i) * (eta2 * alpha)) * t_grad_h(i); // Diffusion term: -ε²∇h
1425 ++t_base;
1426 ++t_diff_base;
1427 }
1428
1429 for (; bb < nbRowBaseFunctions; ++bb) {
1430 ++t_base;
1431 ++t_diff_base;
1432 }
1433
1434 ++t_h;
1435 ++t_grad_h;
1436 ++t_g;
1437
1438 ++t_coords;
1439 ++t_w;
1440 }
1441
1443 }
constexpr int SPACE_DIM
#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]
auto init_h
Initialisation function.
double eta2
auto get_f
Double-well potential function.
FTensor::Index< 'i', SPACE_DIM > i
int r
Definition sdf.py:205
constexpr IntegrationType I

Member Data Documentation

◆ gPtr

template<bool I>
boost::shared_ptr<VectorDouble> FreeSurfaceOps::OpRhsG< I >::gPtr
private

Definition at line 1448 of file FreeSurfaceOps.hpp.

◆ gradHPtr

template<bool I>
boost::shared_ptr<MatrixDouble> FreeSurfaceOps::OpRhsG< I >::gradHPtr
private

Definition at line 1447 of file FreeSurfaceOps.hpp.

◆ hPtr

template<bool I>
boost::shared_ptr<VectorDouble> FreeSurfaceOps::OpRhsG< I >::hPtr
private

Definition at line 1446 of file FreeSurfaceOps.hpp.


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