v0.15.0
Loading...
Searching...
No Matches
ElasticExample::GetFluidLevel< BLOCKSET > Struct Reference

#include "tutorials/vec-0/src/FluidLevel.hpp"

Public Member Functions

 GetFluidLevel ()=delete
 

Static Public Member Functions

static MoFEMErrorCode getParams (double &density, std::array< double, 3 > &gravity, std::array< double, 3 > &zero_pressure, boost::shared_ptr< Range > &ents, MoFEM::Interface &m_field, int ms_id)
 

Detailed Description

Definition at line 20 of file FluidLevel.hpp.

Constructor & Destructor Documentation

◆ GetFluidLevel()

ElasticExample::GetFluidLevel< BLOCKSET >::GetFluidLevel ( )
delete

Member Function Documentation

◆ getParams()

static MoFEMErrorCode ElasticExample::GetFluidLevel< BLOCKSET >::getParams ( double & density,
std::array< double, 3 > & gravity,
std::array< double, 3 > & zero_pressure,
boost::shared_ptr< Range > & ents,
MoFEM::Interface & m_field,
int ms_id )
inlinestatic

Definition at line 23 of file FluidLevel.hpp.

27 {
29
30 auto cubit_meshset_ptr =
31 m_field.getInterface<MeshsetsManager>()->getCubitMeshsetPtr(ms_id,
32 BLOCKSET);
33 std::vector<double> block_data;
34 CHKERR cubit_meshset_ptr->getAttributes(block_data);
35 if (block_data.size() != 1 + 3 + 3) {
36 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
37 "Expected that block has two attribute");
38 }
39 density = block_data[0];
40 gravity = {block_data[1], block_data[2], block_data[3]};
41 zero_pressure = {block_data[4], block_data[5], block_data[6]};
42
43 MOFEM_LOG_CHANNEL("WORLD");
44 MOFEM_TAG_AND_LOG("WORLD", Sev::inform, "FluidPressure")
45 << "Density " << density;
46 MOFEM_TAG_AND_LOG("WORLD", Sev::inform, "FluidPressure")
47 << "Gravity " << gravity[0] << " " << gravity[1] << " " << gravity[2];
48 MOFEM_TAG_AND_LOG("WORLD", Sev::inform, "FluidPressure")
49 << "Zero pressure " << zero_pressure[0] << " " << zero_pressure[1]
50 << " " << zero_pressure[2];
51
52 ents = boost::make_shared<Range>();
53 CHKERR
54 m_field.get_moab().get_entities_by_handle(cubit_meshset_ptr->meshset,
55 *(ents), true);
56
57 MOFEM_LOG_CHANNEL("SYNC");
58 MOFEM_TAG_AND_LOG("SYNC", Sev::noisy, "FluidPressure") << *ents;
59 MOFEM_LOG_SEVERITY_SYNC(m_field.get_comm(), Sev::noisy);
60
62 }
#define MOFEM_LOG_SEVERITY_SYNC(comm, severity)
Synchronise "SYNC" on curtain severity level.
#define MOFEM_TAG_AND_LOG(channel, severity, tag)
Tag and log in channel.
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
@ BLOCKSET
@ MOFEM_DATA_INCONSISTENCY
Definition definitions.h:31
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
#define MOFEM_LOG_CHANNEL(channel)
Set and reset channel.
virtual moab::Interface & get_moab()=0
virtual MPI_Comm & get_comm() const =0
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.

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