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

Lhs for G dH. More...

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

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

Public Member Functions

 OpLhsG_dH (const std::string field_name_g, const std::string field_name_h, boost::shared_ptr< VectorDouble > h_ptr)
 
MoFEMErrorCode iNtegrate (EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
 

Private Attributes

boost::shared_ptr< VectorDouble > hPtr
 

Detailed Description

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

Lhs for G dH.

Parameters
field_name_gName of the field associated with the row operator (G)
field_name_hName of the field associated with the column operator (H)
h_ptrPointer to the free surface height vector (H)
Returns
MoFEMErrorCode

(Jacobian block ∂R_G/∂H) Linearization of the chemical potential equation (Lovric 3.1d) w.r.t. H

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

Definition at line 1457 of file FreeSurfaceOps.hpp.

Constructor & Destructor Documentation

◆ OpLhsG_dH()

template<bool I>
FreeSurfaceOps::OpLhsG_dH< I >::OpLhsG_dH ( const std::string  field_name_g,
const std::string  field_name_h,
boost::shared_ptr< VectorDouble >  h_ptr 
)
inline

Definition at line 1459 of file FreeSurfaceOps.hpp.

1461 : AssemblyDomainEleOp(field_name_g, field_name_h,
1462 AssemblyDomainEleOp::OPROWCOL),
1463 hPtr(h_ptr) {
1464 sYmm = false;
1465 assembleTranspose = false;
1466 }
boost::shared_ptr< VectorDouble > hPtr
FormsIntegrators< DomainEleOp >::Assembly< A >::OpBase AssemblyDomainEleOp

Member Function Documentation

◆ iNtegrate()

template<bool I>
MoFEMErrorCode FreeSurfaceOps::OpLhsG_dH< I >::iNtegrate ( EntitiesFieldData::EntData &  row_data,
EntitiesFieldData::EntData &  col_data 
)
inline

Definition at line 1468 of file FreeSurfaceOps.hpp.

1469 {
1471
1472 const double vol = getMeasure();
1473 auto t_h = getFTensor0FromVec(*hPtr);
1474
1475 auto t_row_base = row_data.getFTensor0N();
1476 auto t_row_diff_base = row_data.getFTensor1DiffN<SPACE_DIM>();
1477 auto t_w = getFTensor0IntegrationWeight();
1478 auto t_coords = getFTensor1CoordsAtGaussPts();
1479
1480 for (int gg = 0; gg != nbIntegrationPts; ++gg) {
1481
1482 const double r = t_coords(0);
1483 const double alpha = t_w * vol * cylindrical(r);
1484
1485 const double f_dh = get_f_dh(t_h) * alpha; // derivative of f(h)
1486 const double beta = eta2 * alpha; // coefficient for diffusion term -ε²
1487
1488 int rr = 0;
1489 for (; rr != nbRows; ++rr) {
1490
1491 auto t_col_base = col_data.getFTensor0N(gg, 0);
1492 auto t_col_diff_base = col_data.getFTensor1DiffN<SPACE_DIM>(gg, 0);
1493
1494 for (int cc = 0; cc != nbCols; ++cc) {
1495
1496 if constexpr (I == false)
1497 locMat(rr, cc) -= (t_row_base * t_col_base) * f_dh; // bulk term derivative (g - f(h))
1498 locMat(rr, cc) -= (t_row_diff_base(i) * beta) * t_col_diff_base(i); // diffusion term derivative -ε²∇h
1499
1500 ++t_col_base;
1501 ++t_col_diff_base;
1502 }
1503
1504 ++t_row_base;
1505 ++t_row_diff_base;
1506 }
1507
1508 for (; rr < nbRowBaseFunctions; ++rr) {
1509 ++t_row_base;
1510 ++t_row_diff_base;
1511 }
1512
1513 ++t_h;
1514 ++t_w;
1515 ++t_coords;
1516 }
1517
1519 }
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]
double eta2
auto get_f_dh
Derivative of double-well potential.
FTensor::Index< 'i', SPACE_DIM > i
int r
Definition sdf.py:205
constexpr IntegrationType I

Member Data Documentation

◆ hPtr

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

Definition at line 1522 of file FreeSurfaceOps.hpp.


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