v0.15.5
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 1383 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 1385 of file FreeSurfaceOps.hpp.

1388 : AssemblyDomainEleOp(field_name, field_name, AssemblyDomainEleOp::OPROW),
1389 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 1391 of file FreeSurfaceOps.hpp.

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

◆ gradHPtr

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

Definition at line 1443 of file FreeSurfaceOps.hpp.

◆ hPtr

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

Definition at line 1442 of file FreeSurfaceOps.hpp.


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