v0.16.0
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 1461 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 1463 of file FreeSurfaceOps.hpp.

1465 : AssemblyDomainEleOp(field_name_g, field_name_h,
1466 AssemblyDomainEleOp::OPROWCOL),
1467 hPtr(h_ptr) {
1468 sYmm = false;
1469 assembleTranspose = false;
1470 }
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 1472 of file FreeSurfaceOps.hpp.

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


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