v0.14.0
Loading...
Searching...
No Matches
Classes | Typedefs | Enumerations | Functions | Variables
free_surface.cpp File Reference
#include <MoFEM.hpp>
#include <petsc/private/petscimpl.h>
#include <FreeSurfaceOps.hpp>

Go to the source code of this file.

Classes

struct  TSPrePostProc
 Set of functions called by PETSc solver used to refine and update mesh. More...
 
struct  FreeSurface
 
struct  Monitor
 [Push operators to pipeline] More...
 

Typedefs

template<int DIM>
using ElementsAndOps = PipelineManager::ElementsAndOpsByDim<SPACE_DIM>
 
using DomainEle = ElementsAndOps<SPACE_DIM>::DomainEle
 
using DomianParentEle = ElementsAndOps<SPACE_DIM>::DomianParentEle
 
using DomainEleOp = DomainEle::UserDataOperator
 
using BoundaryEle = ElementsAndOps<SPACE_DIM>::BoundaryEle
 
using BoundaryParentEle = ElementsAndOps<SPACE_DIM>::BoundaryParentEle
 
using BoundaryEleOp = BoundaryEle::UserDataOperator
 
using SideEle = ElementsAndOps<SPACE_DIM>::FaceSideEle
 
using SideOp = SideEle::UserDataOperator
 
using PostProcEleDomain = PostProcBrokenMeshInMoab<DomainEle>
 
using PostProcEleDomainCont = PostProcBrokenMeshInMoabBaseCont<DomainEle>
 
using PostProcEleBdyCont = PostProcBrokenMeshInMoabBaseCont<BoundaryEle>
 
using EntData = EntitiesFieldData::EntData
 
using AssemblyDomainEleOp = FormsIntegrators<DomainEleOp>::Assembly<A>::OpBase
 
using AssemblyBoundaryEleOp
 
using OpDomainMassU
 
using OpDomainMassH
 
using OpDomainMassP = OpDomainMassH
 
using OpDomainMassG = OpDomainMassH
 
using OpBoundaryMassL
 
using OpDomainAssembleVector
 
using OpDomainAssembleScalar
 
using OpBoundaryAssembleScalar
 
template<CoordinateTypes COORD_TYPE>
using OpMixScalarTimesDiv
 
using BoundaryNaturalBC = NaturalBC<BoundaryEleOp>::Assembly<A>::LinearForm<I>
 
using OpFluidFlux
 

Enumerations

enum  FR { F , R }
 

Functions

int main (int argc, char *argv[])
 

Variables

static char help [] = "...\n\n"
 
int coord_type = EXECUTABLE_COORD_TYPE
 
constexpr int BASE_DIM = 1
 
constexpr int SPACE_DIM = 2
 
constexpr int U_FIELD_DIM = SPACE_DIM
 
constexpr AssemblyType A = AssemblyType::PETSC
 
constexpr IntegrationType I
 
FTensor::Index< 'i', SPACE_DIMi
 
FTensor::Index< 'j', SPACE_DIMj
 
FTensor::Index< 'k', SPACE_DIMk
 
FTensor::Index< 'l', SPACE_DIMl
 
constexpr auto t_kd = FTensor::Kronecker_Delta_symmetric<int>()
 
int order = 3
 approximation order
 
int nb_levels = 4
 
int refine_overlap = 4
 
constexpr bool debug = true
 
auto get_start_bit
 
auto get_current_bit
 dofs bit used to do calculations
 
auto get_skin_parent_bit = []() { return 2 * get_start_bit() + 2; }
 
auto get_skin_child_bit = []() { return 2 * get_start_bit() + 3; }
 
auto get_projection_bit = []() { return 2 * get_start_bit() + 4; }
 
auto get_skin_projection_bit = []() { return 2 * get_start_bit() + 5; }
 
double a0 = 980
 
double rho_m = 0.998
 
double mu_m = 0.010101 * 1e2
 
double rho_p = 0.0012
 
double mu_p = 0.000182 * 1e2
 
double lambda = 73
 surface tension
 
double W = 0.25
 
double h = 0.01 / 8
 
double eta = h
 
double eta2 = eta * eta
 
double md = 1e-2
 
double eps = 1e-12
 
double tol = std::numeric_limits<float>::epsilon()
 
double rho_ave = (rho_p + rho_m) / 2
 
double rho_diff = (rho_p - rho_m) / 2
 
double mu_ave = (mu_p + mu_m) / 2
 
double mu_diff = (mu_p - mu_m) / 2
 
double kappa = (3. / (4. * std::sqrt(2. * W))) * (lambda / eta)
 
auto integration_rule = [](int, int, int) { return 2 * order + 1; }
 
auto cylindrical
 
auto wetting_angle_sub_stepping
 
auto my_max = [](const double x) { return (x - 1 + std::abs(x + 1)) / 2; }
 
auto my_min = [](const double x) { return (x + 1 - std::abs(x - 1)) / 2; }
 
auto cut_off = [](const double h) { return my_max(my_min(h)); }
 
auto d_cut_off
 
auto phase_function
 
auto d_phase_function_h
 
auto get_f = [](const double h) { return 4 * W * h * (h * h - 1); }
 
auto get_f_dh = [](const double h) { return 4 * W * (3 * h * h - 1); }
 
auto get_M0 = [](auto h) { return md; }
 
auto get_M0_dh = [](auto h) { return 0; }
 
auto get_M2
 
auto get_M2_dh = [](auto h) { return -md * 2 * h; }
 
auto get_M3
 
auto get_M3_dh
 
auto get_M = [](auto h) { return get_M0(h); }
 
auto get_M_dh = [](auto h) { return get_M0_dh(h); }
 
auto get_D
 
auto kernel_oscillation
 
auto kernel_eye
 
auto capillary_tube
 
auto bubble_device
 
auto init_h
 Initialisation function.
 
auto wetting_angle = [](double water_level) { return water_level; }
 
auto bit = [](auto b) { return BitRefLevel().set(b); }
 
auto marker = [](auto b) { return BitRefLevel().set(BITREFLEVEL_SIZE - b); }
 
auto get_fe_bit
 
auto get_global_size
 
auto save_range
 
auto get_dofs_ents_by_field_name
 get entities of dofs in the problem - used for debugging
 
auto get_dofs_ents_all
 get entities of dofs in the problem - used for debugging
 
static boost::weak_ptr< TSPrePostProctsPrePostProc
 

Typedef Documentation

◆ AssemblyBoundaryEleOp

◆ AssemblyDomainEleOp

Definition at line 103 of file free_surface.cpp.

◆ BoundaryEle

Definition at line 91 of file free_surface.cpp.

◆ BoundaryEleOp

Definition at line 93 of file free_surface.cpp.

◆ BoundaryNaturalBC

Definition at line 128 of file free_surface.cpp.

◆ BoundaryParentEle

Examples
free_surface.cpp.

Definition at line 92 of file free_surface.cpp.

◆ DomainEle

Definition at line 88 of file free_surface.cpp.

◆ DomainEleOp

Definition at line 90 of file free_surface.cpp.

◆ DomianParentEle

Examples
free_surface.cpp.

Definition at line 89 of file free_surface.cpp.

◆ ElementsAndOps

template<int DIM>
using ElementsAndOps = PipelineManager::ElementsAndOpsByDim<SPACE_DIM>

Definition at line 86 of file free_surface.cpp.

◆ EntData

Definition at line 101 of file free_surface.cpp.

◆ OpBoundaryAssembleScalar

◆ OpBoundaryMassL

◆ OpDomainAssembleScalar

◆ OpDomainAssembleVector

Initial value:
Examples
free_surface.cpp.

Definition at line 116 of file free_surface.cpp.

◆ OpDomainMassG

Examples
free_surface.cpp.

Definition at line 112 of file free_surface.cpp.

◆ OpDomainMassH

Initial value:
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpMass< 1, SPACE_DIM > OpMass
constexpr IntegrationType I
Examples
free_surface.cpp.

Definition at line 109 of file free_surface.cpp.

◆ OpDomainMassP

Examples
free_surface.cpp.

Definition at line 111 of file free_surface.cpp.

◆ OpDomainMassU

◆ OpFluidFlux

using OpFluidFlux

◆ OpMixScalarTimesDiv

template<CoordinateTypes COORD_TYPE>
using OpMixScalarTimesDiv

◆ PostProcEleBdyCont

Definition at line 99 of file free_surface.cpp.

◆ PostProcEleDomain

Definition at line 97 of file free_surface.cpp.

◆ PostProcEleDomainCont

Definition at line 98 of file free_surface.cpp.

◆ SideEle

Definition at line 94 of file free_surface.cpp.

◆ SideOp

Definition at line 95 of file free_surface.cpp.

Enumeration Type Documentation

◆ FR

enum FR
Enumerator

Definition at line 394 of file free_surface.cpp.

394{ F, R }; // F - forward, and reverse
@ R
@ F

Function Documentation

◆ main()

int main ( int argc,
char * argv[] )

[Register MoFEM discrete manager in PETSc]

[Register MoFEM discrete manager in PETSc

[Create MoAB]

< mesh database

< mesh database interface

[Create MoAB]

[Create MoFEM]

< finite element database

< finite element database interface

[Create MoFEM]

[FreeSurface]

[FreeSurface]

Definition at line 2406 of file free_surface.cpp.

2406 {
2407
2408#ifdef PYTHON_INIT_SURFACE
2409 Py_Initialize();
2410#endif
2411
2412 // Initialisation of MoFEM/PETSc and MOAB data structures
2413 const char param_file[] = "param_file.petsc";
2414 MoFEM::Core::Initialize(&argc, &argv, param_file, help);
2415
2416 // Add logging channel for example
2417 auto core_log = logging::core::get();
2418 core_log->add_sink(LogManager::createSink(LogManager::getStrmWorld(), "FS"));
2419 LogManager::setLog("FS");
2420 MOFEM_LOG_TAG("FS", "free surface");
2421
2422 try {
2423
2424 //! [Register MoFEM discrete manager in PETSc]
2425 DMType dm_name = "DMMOFEM";
2426 CHKERR DMRegister_MoFEM(dm_name);
2427 //! [Register MoFEM discrete manager in PETSc
2428
2429 //! [Create MoAB]
2430 moab::Core mb_instance; ///< mesh database
2431 moab::Interface &moab = mb_instance; ///< mesh database interface
2432 //! [Create MoAB]
2433
2434 //! [Create MoFEM]
2435 MoFEM::Core core(moab); ///< finite element database
2436 MoFEM::Interface &m_field = core; ///< finite element database interface
2437 //! [Create MoFEM]
2438
2439 //! [FreeSurface]
2440 FreeSurface ex(m_field);
2441 CHKERR ex.runProblem();
2442 //! [FreeSurface]
2443 }
2445
2447
2448#ifdef PYTHON_INIT_SURFACE
2449 if (Py_FinalizeEx() < 0) {
2450 exit(120);
2451 }
2452#endif
2453}
std::string param_file
#define CATCH_ERRORS
Catch errors.
#define CHKERR
Inline error check.
static char help[]
PetscErrorCode DMRegister_MoFEM(const char sname[])
Register MoFEM problem.
Definition DMMoFEM.cpp:47
static LoggerType & setLog(const std::string channel)
Set ans resset chanel logger.
#define MOFEM_LOG_TAG(channel, tag)
Tag channel.
Core (interface) class.
Definition Core.hpp:82
static MoFEMErrorCode Initialize(int *argc, char ***args, const char file[], const char help[])
Initializes the MoFEM database PETSc, MOAB and MPI.
Definition Core.cpp:72
static MoFEMErrorCode Finalize()
Checks for options to be called at the conclusion of the program.
Definition Core.cpp:112
Deprecated interface functions.
static boost::shared_ptr< SinkType > createSink(boost::shared_ptr< std::ostream > stream_ptr, std::string comm_filter)
Create a sink object.
static boost::shared_ptr< std::ostream > getStrmWorld()
Get the strm world object.

Variable Documentation

◆ A

constexpr AssemblyType A = AssemblyType::PETSC
constexpr

Definition at line 81 of file free_surface.cpp.

◆ a0

double a0 = 980
Examples
free_surface.cpp.

Definition at line 160 of file free_surface.cpp.

◆ BASE_DIM

constexpr int BASE_DIM = 1
constexpr

Definition at line 77 of file free_surface.cpp.

◆ bit

auto bit = [](auto b) { return BitRefLevel().set(b); }
Examples
free_surface.cpp.

Definition at line 312 of file free_surface.cpp.

312{ return BitRefLevel().set(b); };
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
Definition Types.hpp:40

◆ bubble_device

auto bubble_device
Initial value:
= [](double x, double y, double z) {
return -tanh((-0.039 - x) / (eta * std::sqrt(2)));
}
double eta
Examples
free_surface.cpp.

Definition at line 284 of file free_surface.cpp.

284 {
285 return -tanh((-0.039 - x) / (eta * std::sqrt(2)));
286};

◆ capillary_tube

auto capillary_tube
Initial value:
= [](double x, double y, double z) {
constexpr double water_height = 0.;
return tanh((water_height - y) / (eta * std::sqrt(2)));
;
}
Examples
free_surface.cpp.

Definition at line 278 of file free_surface.cpp.

278 {
279 constexpr double water_height = 0.;
280 return tanh((water_height - y) / (eta * std::sqrt(2)));
281 ;
282};

◆ coord_type

int coord_type = EXECUTABLE_COORD_TYPE
Examples
free_surface.cpp.

Definition at line 75 of file free_surface.cpp.

◆ cut_off

auto cut_off = [](const double h) { return my_max(my_min(h)); }
Examples
free_surface.cpp.

Definition at line 203 of file free_surface.cpp.

203{ return my_max(my_min(h)); };
double h
auto my_max
auto my_min

◆ cylindrical

auto cylindrical
Initial value:
= [](const double r) {
return 2 * M_PI * r;
else
return 1.;
}
@ CYLINDRICAL
int coord_type
Examples
free_surface.cpp.

Definition at line 187 of file free_surface.cpp.

187 {
188 if (coord_type == CYLINDRICAL)
189 return 2 * M_PI * r;
190 else
191 return 1.;
192};
int r
Definition sdf.py:8

◆ d_cut_off

auto d_cut_off
Initial value:
= [](const double h) {
if (h >= -1 && h < 1)
return 1.;
else
return 0.;
}
Examples
free_surface.cpp.

Definition at line 204 of file free_surface.cpp.

204 {
205 if (h >= -1 && h < 1)
206 return 1.;
207 else
208 return 0.;
209};

◆ d_phase_function_h

auto d_phase_function_h
Initial value:
= [](const double h, const double diff) {
return diff;
}
Examples
free_surface.cpp.

Definition at line 215 of file free_surface.cpp.

215 {
216 return diff;
217};

◆ debug

constexpr bool debug = true
constexpr
Examples
free_surface.cpp.

Definition at line 144 of file free_surface.cpp.

◆ eps

double eps = 1e-12
Examples
free_surface.cpp.

Definition at line 175 of file free_surface.cpp.

◆ eta

double eta = h
Examples
free_surface.cpp, and plot_base.cpp.

Definition at line 170 of file free_surface.cpp.

◆ eta2

double eta2 = eta * eta
Examples
free_surface.cpp.

Definition at line 171 of file free_surface.cpp.

◆ get_current_bit

auto get_current_bit
Initial value:
= []() {
return 2 * get_start_bit() + 1;
}
auto get_start_bit

dofs bit used to do calculations

Examples
free_surface.cpp.

Definition at line 149 of file free_surface.cpp.

149 {
150 return 2 * get_start_bit() + 1;
151}; ///< dofs bit used to do calculations

◆ get_D

auto get_D
Initial value:
= [](const double A) {
t_D(i, j, k, l) = A * ((t_kd(i, k) ^ t_kd(j, l)) / 4.);
return t_D;
}
FTensor::Index< 'j', SPACE_DIM > j
FTensor::Index< 'k', SPACE_DIM > k
FTensor::Index< 'i', SPACE_DIM > i
constexpr auto t_kd
FTensor::Index< 'l', SPACE_DIM > l
constexpr AssemblyType A
Examples
free_surface.cpp.

Definition at line 252 of file free_surface.cpp.

252 {
254 t_D(i, j, k, l) = A * ((t_kd(i, k) ^ t_kd(j, l)) / 4.);
255 return t_D;
256};

◆ get_dofs_ents_all

auto get_dofs_ents_all
Initial value:
= [](auto dm) {
auto prb_ptr = getProblemPtr(dm);
std::vector<EntityHandle> ents_vec;
MoFEM::Interface *m_field_ptr;
CHKERR DMoFEMGetInterfacePtr(dm, &m_field_ptr);
auto dofs = prb_ptr->numeredRowDofsPtr;
ents_vec.reserve(dofs->size());
for (auto d : *dofs) {
ents_vec.push_back(d->getEnt());
}
std::sort(ents_vec.begin(), ents_vec.end());
auto it = std::unique(ents_vec.begin(), ents_vec.end());
Range r;
r.insert_list(ents_vec.begin(), it);
return r;
}
PetscErrorCode DMoFEMGetInterfacePtr(DM dm, MoFEM::Interface **m_field_ptr)
Get pointer to MoFEM::Interface.
Definition DMMoFEM.cpp:400
auto getProblemPtr(DM dm)
get problem pointer from DM
Definition DMMoFEM.hpp:976

get entities of dofs in the problem - used for debugging

Examples
free_surface.cpp.

Definition at line 368 of file free_surface.cpp.

368 {
369 auto prb_ptr = getProblemPtr(dm);
370 std::vector<EntityHandle> ents_vec;
371
372 MoFEM::Interface *m_field_ptr;
373 CHKERR DMoFEMGetInterfacePtr(dm, &m_field_ptr);
374
375 auto dofs = prb_ptr->numeredRowDofsPtr;
376 ents_vec.reserve(dofs->size());
377
378 for (auto d : *dofs) {
379 ents_vec.push_back(d->getEnt());
380 }
381
382 std::sort(ents_vec.begin(), ents_vec.end());
383 auto it = std::unique(ents_vec.begin(), ents_vec.end());
384 Range r;
385 r.insert_list(ents_vec.begin(), it);
386 return r;
387};
float d
Definition sdf_hertz.py:5

◆ get_dofs_ents_by_field_name

auto get_dofs_ents_by_field_name
Initial value:
= [](auto dm, auto field_name) {
auto prb_ptr = getProblemPtr(dm);
std::vector<EntityHandle> ents_vec;
MoFEM::Interface *m_field_ptr;
CHKERR DMoFEMGetInterfacePtr(dm, &m_field_ptr);
auto bit_number = m_field_ptr->get_field_bit_number(field_name);
auto dofs = prb_ptr->numeredRowDofsPtr;
auto lo_it = dofs->lower_bound(FieldEntity::getLoBitNumberUId(bit_number));
auto hi_it = dofs->upper_bound(FieldEntity::getHiBitNumberUId(bit_number));
ents_vec.reserve(std::distance(lo_it, hi_it));
for (; lo_it != hi_it; ++lo_it) {
ents_vec.push_back((*lo_it)->getEnt());
}
std::sort(ents_vec.begin(), ents_vec.end());
auto it = std::unique(ents_vec.begin(), ents_vec.end());
Range r;
r.insert_list(ents_vec.begin(), it);
return r;
}
constexpr auto field_name
virtual FieldBitNumber get_field_bit_number(const std::string name) const =0
get field bit number
static UId getHiBitNumberUId(const FieldBitNumber bit_number)
static UId getLoBitNumberUId(const FieldBitNumber bit_number)

get entities of dofs in the problem - used for debugging

Examples
free_surface.cpp.

Definition at line 340 of file free_surface.cpp.

340 {
341 auto prb_ptr = getProblemPtr(dm);
342 std::vector<EntityHandle> ents_vec;
343
344 MoFEM::Interface *m_field_ptr;
345 CHKERR DMoFEMGetInterfacePtr(dm, &m_field_ptr);
346
347 auto bit_number = m_field_ptr->get_field_bit_number(field_name);
348 auto dofs = prb_ptr->numeredRowDofsPtr;
349 auto lo_it = dofs->lower_bound(FieldEntity::getLoBitNumberUId(bit_number));
350 auto hi_it = dofs->upper_bound(FieldEntity::getHiBitNumberUId(bit_number));
351 ents_vec.reserve(std::distance(lo_it, hi_it));
352
353 for (; lo_it != hi_it; ++lo_it) {
354 ents_vec.push_back((*lo_it)->getEnt());
355 }
356
357 std::sort(ents_vec.begin(), ents_vec.end());
358 auto it = std::unique(ents_vec.begin(), ents_vec.end());
359 Range r;
360 r.insert_list(ents_vec.begin(), it);
361 return r;
362};

◆ get_f

auto get_f = [](const double h) { return 4 * W * h * (h * h - 1); }
Examples
free_surface.cpp.

Definition at line 221 of file free_surface.cpp.

221{ return 4 * W * h * (h * h - 1); };
double W

◆ get_f_dh

auto get_f_dh = [](const double h) { return 4 * W * (3 * h * h - 1); }
Examples
free_surface.cpp.

Definition at line 222 of file free_surface.cpp.

222{ return 4 * W * (3 * h * h - 1); };

◆ get_fe_bit

auto get_fe_bit
Initial value:
= [](FEMethod *fe_ptr) {
return fe_ptr->numeredEntFiniteElementPtr->getBitRefLevel();
}
structure for User Loop Methods on finite elements
Examples
free_surface.cpp.

Definition at line 314 of file free_surface.cpp.

314 {
315 return fe_ptr->numeredEntFiniteElementPtr->getBitRefLevel();
316};

◆ get_global_size

auto get_global_size
Initial value:
= [](int l_size) {
int g_size;
MPI_Allreduce(&l_size, &g_size, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD);
return g_size;
}
Examples
free_surface.cpp.

Definition at line 318 of file free_surface.cpp.

318 {
319 int g_size;
320 MPI_Allreduce(&l_size, &g_size, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD);
321 return g_size;
322};

◆ get_M

auto get_M = [](auto h) { return get_M0(h); }
Examples
free_surface.cpp.

Definition at line 249 of file free_surface.cpp.

249{ return get_M0(h); };
auto get_M0

◆ get_M0

auto get_M0 = [](auto h) { return md; }
Examples
free_surface.cpp.

Definition at line 224 of file free_surface.cpp.

224{ return md; };
double md

◆ get_M0_dh

auto get_M0_dh = [](auto h) { return 0; }
Examples
free_surface.cpp.

Definition at line 225 of file free_surface.cpp.

225{ return 0; };

◆ get_M2

auto get_M2
Initial value:
= [](auto h) {
return md * (1 - h * h);
}
Examples
free_surface.cpp.

Definition at line 227 of file free_surface.cpp.

227 {
228 return md * (1 - h * h);
229};

◆ get_M2_dh

auto get_M2_dh = [](auto h) { return -md * 2 * h; }
Examples
free_surface.cpp.

Definition at line 231 of file free_surface.cpp.

231{ return -md * 2 * h; };

◆ get_M3

auto get_M3
Initial value:
= [](auto h) {
const double h2 = h * h;
const double h3 = h2 * h;
if (h >= 0)
return md * (2 * h3 - 3 * h2 + 1);
else
return md * (-2 * h3 - 3 * h2 + 1);
}
Examples
free_surface.cpp.

Definition at line 233 of file free_surface.cpp.

233 {
234 const double h2 = h * h;
235 const double h3 = h2 * h;
236 if (h >= 0)
237 return md * (2 * h3 - 3 * h2 + 1);
238 else
239 return md * (-2 * h3 - 3 * h2 + 1);
240};

◆ get_M3_dh

auto get_M3_dh
Initial value:
= [](auto h) {
if (h >= 0)
return md * (6 * h * (h - 1));
else
return md * (-6 * h * (h + 1));
}
Examples
free_surface.cpp.

Definition at line 242 of file free_surface.cpp.

242 {
243 if (h >= 0)
244 return md * (6 * h * (h - 1));
245 else
246 return md * (-6 * h * (h + 1));
247};

◆ get_M_dh

auto get_M_dh = [](auto h) { return get_M0_dh(h); }
Examples
free_surface.cpp.

Definition at line 250 of file free_surface.cpp.

250{ return get_M0_dh(h); };
auto get_M0_dh

◆ get_projection_bit

auto get_projection_bit = []() { return 2 * get_start_bit() + 4; }
Examples
free_surface.cpp.

Definition at line 154 of file free_surface.cpp.

154{ return 2 * get_start_bit() + 4; };

◆ get_skin_child_bit

auto get_skin_child_bit = []() { return 2 * get_start_bit() + 3; }
Examples
free_surface.cpp.

Definition at line 153 of file free_surface.cpp.

153{ return 2 * get_start_bit() + 3; };

◆ get_skin_parent_bit

auto get_skin_parent_bit = []() { return 2 * get_start_bit() + 2; }
Examples
free_surface.cpp.

Definition at line 152 of file free_surface.cpp.

152{ return 2 * get_start_bit() + 2; };

◆ get_skin_projection_bit

auto get_skin_projection_bit = []() { return 2 * get_start_bit() + 5; }
Examples
free_surface.cpp.

Definition at line 155 of file free_surface.cpp.

155{ return 2 * get_start_bit() + 5; };

◆ get_start_bit

auto get_start_bit
Initial value:
= []() {
return nb_levels + 1;
}
int nb_levels
Examples
free_surface.cpp.

Definition at line 146 of file free_surface.cpp.

146 {
147 return nb_levels + 1;
148}; //< first refinement level for computational mesh

◆ h

double h = 0.01 / 8
Examples
free_surface.cpp.

Definition at line 169 of file free_surface.cpp.

◆ help

char help[] = "...\n\n"
static

Definition at line 17 of file free_surface.cpp.

◆ I

constexpr IntegrationType I
constexpr
Initial value:
=
IntegrationType::GAUSS

Definition at line 82 of file free_surface.cpp.

◆ i

Definition at line 132 of file free_surface.cpp.

◆ init_h

auto init_h
Initial value:
= [](double r, double y, double theta) {
return bubble_device(r, y, theta);
}
auto bubble_device

Initialisation function.

Note
If UMs are compiled with Python to initialise phase field "H" surface.py function is used, which has to be present in execution folder.
Examples
free_surface.cpp, and shallow_wave.cpp.

Definition at line 295 of file free_surface.cpp.

295 {
296#ifdef PYTHON_INIT_SURFACE
297 double s = 1;
298 if (auto ptr = surfacePythonWeakPtr.lock()) {
299 CHK_THROW_MESSAGE(ptr->evalSurface(r, y, theta, eta, s),
300 "error eval python");
301 }
302 return s;
303#else
304 return bubble_device(r, y, theta);
305 // return capillary_tube(r, y, theta);
306 // return kernel_eye(r, y, theta);
307#endif
308};
#define CHK_THROW_MESSAGE(err, msg)
Check and throw MoFEM exception.

◆ integration_rule

auto integration_rule = [](int, int, int) { return 2 * order + 1; }

◆ j

Definition at line 133 of file free_surface.cpp.

◆ k

Definition at line 134 of file free_surface.cpp.

◆ kappa

double kappa = (3. / (4. * std::sqrt(2. * W))) * (lambda / eta)
Examples
free_surface.cpp.

Definition at line 183 of file free_surface.cpp.

◆ kernel_eye

auto kernel_eye
Initial value:
= [](double r, double y, double) {
constexpr double y0 = 0.5;
constexpr double R = 0.4;
y -= y0;
const double d = std::sqrt(r * r + y * y);
return tanh((R - d) / (eta * std::sqrt(2)));
}
Examples
free_surface.cpp.

Definition at line 270 of file free_surface.cpp.

270 {
271 constexpr double y0 = 0.5;
272 constexpr double R = 0.4;
273 y -= y0;
274 const double d = std::sqrt(r * r + y * y);
275 return tanh((R - d) / (eta * std::sqrt(2)));
276};

◆ kernel_oscillation

auto kernel_oscillation
Initial value:
= [](double r, double y, double) {
constexpr int n = 3;
constexpr double R = 0.0125;
constexpr double A = R * 0.2;
const double theta = atan2(r, y);
const double w = R + A * cos(n * theta);
const double d = std::sqrt(r * r + y * y);
return tanh((w - d) / (eta * std::sqrt(2)));
}
FTensor::Index< 'n', SPACE_DIM > n
Examples
free_surface.cpp.

Definition at line 260 of file free_surface.cpp.

260 {
261 constexpr int n = 3;
262 constexpr double R = 0.0125;
263 constexpr double A = R * 0.2;
264 const double theta = atan2(r, y);
265 const double w = R + A * cos(n * theta);
266 const double d = std::sqrt(r * r + y * y);
267 return tanh((w - d) / (eta * std::sqrt(2)));
268};
double w(const double g, const double t)

◆ l

Examples
free_surface.cpp.

Definition at line 135 of file free_surface.cpp.

◆ lambda

double lambda = 73

surface tension

Examples
free_surface.cpp.

Definition at line 165 of file free_surface.cpp.

◆ marker

auto marker = [](auto b) { return BitRefLevel().set(BITREFLEVEL_SIZE - b); }

Definition at line 313 of file free_surface.cpp.

313{ return BitRefLevel().set(BITREFLEVEL_SIZE - b); };
#define BITREFLEVEL_SIZE
max number of refinements

◆ md

double md = 1e-2
Examples
free_surface.cpp.

Definition at line 174 of file free_surface.cpp.

◆ mu_ave

double mu_ave = (mu_p + mu_m) / 2
Examples
free_surface.cpp.

Definition at line 180 of file free_surface.cpp.

◆ mu_diff

double mu_diff = (mu_p - mu_m) / 2
Examples
free_surface.cpp.

Definition at line 181 of file free_surface.cpp.

◆ mu_m

double mu_m = 0.010101 * 1e2
Examples
free_surface.cpp.

Definition at line 162 of file free_surface.cpp.

◆ mu_p

double mu_p = 0.000182 * 1e2
Examples
free_surface.cpp.

Definition at line 164 of file free_surface.cpp.

◆ my_max

auto my_max = [](const double x) { return (x - 1 + std::abs(x + 1)) / 2; }
Examples
free_surface.cpp.

Definition at line 201 of file free_surface.cpp.

201{ return (x - 1 + std::abs(x + 1)) / 2; };

◆ my_min

auto my_min = [](const double x) { return (x + 1 - std::abs(x - 1)) / 2; }
Examples
free_surface.cpp.

Definition at line 202 of file free_surface.cpp.

202{ return (x + 1 - std::abs(x - 1)) / 2; };

◆ nb_levels

int nb_levels = 4
Examples
free_surface.cpp.

Definition at line 141 of file free_surface.cpp.

◆ order

int order = 3

approximation order

Examples
free_surface.cpp.

Definition at line 140 of file free_surface.cpp.

◆ phase_function

auto phase_function
Initial value:
= [](const double h, const double diff, const double ave) {
return diff * h + ave;
}
Examples
free_surface.cpp.

Definition at line 211 of file free_surface.cpp.

211 {
212 return diff * h + ave;
213};

◆ refine_overlap

int refine_overlap = 4
Examples
free_surface.cpp.

Definition at line 142 of file free_surface.cpp.

◆ rho_ave

double rho_ave = (rho_p + rho_m) / 2
Examples
free_surface.cpp.

Definition at line 178 of file free_surface.cpp.

◆ rho_diff

double rho_diff = (rho_p - rho_m) / 2
Examples
free_surface.cpp.

Definition at line 179 of file free_surface.cpp.

◆ rho_m

double rho_m = 0.998
Examples
free_surface.cpp.

Definition at line 161 of file free_surface.cpp.

◆ rho_p

double rho_p = 0.0012
Examples
free_surface.cpp.

Definition at line 163 of file free_surface.cpp.

◆ save_range

auto save_range
Initial value:
= [](moab::Interface &moab, const std::string name,
const Range r) {
if (get_global_size(r.size())) {
auto out_meshset = get_temp_meshset_ptr(moab);
CHKERR moab.add_entities(*out_meshset, r);
CHKERR moab.write_file(name.c_str(), "MOAB", "PARALLEL=WRITE_PART",
out_meshset->get_ptr(), 1);
}
}
#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 get_global_size
auto get_temp_meshset_ptr(moab::Interface &moab)
Create smart pointer to temporary meshset.
Examples
free_surface.cpp.

Definition at line 324 of file free_surface.cpp.

325 {
327 if (get_global_size(r.size())) {
328 auto out_meshset = get_temp_meshset_ptr(moab);
329 CHKERR moab.add_entities(*out_meshset, r);
330 CHKERR moab.write_file(name.c_str(), "MOAB", "PARALLEL=WRITE_PART",
331 out_meshset->get_ptr(), 1);
332 }
334};

◆ SPACE_DIM

constexpr int SPACE_DIM = 2
constexpr

◆ t_kd

constexpr auto t_kd = FTensor::Kronecker_Delta_symmetric<int>()
constexpr

◆ tol

double tol = std::numeric_limits<float>::epsilon()

Definition at line 176 of file free_surface.cpp.

◆ tsPrePostProc

boost::weak_ptr<TSPrePostProc> tsPrePostProc
static
Examples
dynamic_first_order_con_law.cpp, and free_surface.cpp.

Definition at line 467 of file free_surface.cpp.

◆ U_FIELD_DIM

constexpr int U_FIELD_DIM = SPACE_DIM
constexpr
Examples
free_surface.cpp.

Definition at line 79 of file free_surface.cpp.

◆ W

double W = 0.25
Examples
free_surface.cpp.

Definition at line 166 of file free_surface.cpp.

◆ wetting_angle

auto wetting_angle = [](double water_level) { return water_level; }
Examples
free_surface.cpp.

Definition at line 310 of file free_surface.cpp.

310{ return water_level; };

◆ wetting_angle_sub_stepping

auto wetting_angle_sub_stepping
Initial value:
= [](auto ts_step) {
constexpr int sub_stepping = 16;
return std::min(1., static_cast<double>(ts_step) / sub_stepping);
}
Examples
free_surface.cpp.

Definition at line 194 of file free_surface.cpp.

194 {
195 constexpr int sub_stepping = 16;
196 return std::min(1., static_cast<double>(ts_step) / sub_stepping);
197};