v0.13.1
Static Public Member Functions | List of all members
MetaNeumannForces Struct Reference

Set of high-level function declaring elements and setting operators to apply forces/fluxes. More...

#include <users_modules/basic_finite_elements/src/SurfacePressure.hpp>

Static Public Member Functions

static MoFEMErrorCode addNeumannBCElements (MoFEM::Interface &m_field, const std::string field_name, const std::string mesh_nodals_positions="MESH_NODE_POSITIONS", Range *intersect_ptr=NULL)
 Declare finite element. More...
 
static MoFEMErrorCode setMomentumFluxOperators (MoFEM::Interface &m_field, boost::ptr_map< std::string, NeumannForcesSurface > &neumann_forces, Vec F, const std::string field_name, const std::string mesh_nodals_positions="MESH_NODE_POSITIONS")
 Set operators to finite elements calculating right hand side vector. More...
 
static MoFEMErrorCode addNeumannFluxBCElements (MoFEM::Interface &m_field, const std::string field_name, const std::string mesh_nodals_positions="MESH_NODE_POSITIONS")
 
static MoFEMErrorCode setMassFluxOperators (MoFEM::Interface &m_field, boost::ptr_map< std::string, NeumannForcesSurface > &neumann_forces, Vec F, const std::string field_name, const std::string mesh_nodals_positions="MESH_NODE_POSITIONS")
 

Detailed Description

Set of high-level function declaring elements and setting operators to apply forces/fluxes.

Definition at line 794 of file SurfacePressure.hpp.

Member Function Documentation

◆ addNeumannBCElements()

MoFEMErrorCode MetaNeumannForces::addNeumannBCElements ( MoFEM::Interface m_field,
const std::string  field_name,
const std::string  mesh_nodals_positions = "MESH_NODE_POSITIONS",
Range *  intersect_ptr = NULL 
)
static

Declare finite element.

Search cubit sidesets and blocksets with pressure bc and declare surface elemen

Block set has to have name “PRESSURE”. Can have name “PRESSURE_01” or any other name with prefix. The first attribute of block set is pressure value.

Parameters
m_fieldInterface insurance
field_nameField name (f.e. DISPLACEMENT)
mesh_nodals_positionsName of field on which ho-geometry is defined
intersect_ptrPointer to range to interect meshset entities
Returns
Error code
Examples
elasticity.cpp, elasticity_mixed_formulation.cpp, mortar_contact.cpp, mortar_contact_thermal.cpp, navier_stokes.cpp, nonlinear_dynamics.cpp, simple_contact.cpp, and simple_contact_thermal.cpp.

Definition at line 1259 of file SurfacePressure.cpp.

1261 {
1263
1264 // Define boundary element that operates on rows, columns and data of a
1265 // given field
1266 CHKERR m_field.add_finite_element("FORCE_FE", MF_ZERO);
1270 if (m_field.check_field(mesh_nodals_positions)) {
1272 mesh_nodals_positions);
1273 }
1274 // Add entities to that element, here we add all triangles with FORCESET
1275 // from cubit
1277 it)) {
1278 Range tris;
1279 CHKERR m_field.get_moab().get_entities_by_dimension(it->meshset, 2, tris,
1280 true);
1281 if (intersect_ptr)
1282 tris = intersect(tris, *intersect_ptr);
1283 CHKERR m_field.add_ents_to_finite_element_by_dim(tris, 2, "FORCE_FE");
1284 }
1285
1286 CHKERR m_field.add_finite_element("PRESSURE_FE", MF_ZERO);
1289 CHKERR m_field.modify_finite_element_add_field_data("PRESSURE_FE",
1290 field_name);
1291 if (m_field.check_field(mesh_nodals_positions)) {
1292 CHKERR m_field.modify_finite_element_add_field_data("PRESSURE_FE",
1293 mesh_nodals_positions);
1294 }
1295
1297 SIDESET | PRESSURESET, it)) {
1298 Range tris;
1299 CHKERR m_field.get_moab().get_entities_by_dimension(it->meshset, 2, tris,
1300 true);
1301 if (intersect_ptr)
1302 tris = intersect(tris, *intersect_ptr);
1303 CHKERR m_field.add_ents_to_finite_element_by_dim(tris, 2, "PRESSURE_FE");
1304 }
1305
1306 // Reading forces from BLOCKSET
1307
1308 const string block_set_force_name("FORCE");
1309 // search for block named FORCE and add its attributes to FORCE_FE element
1311 if (it->getName().compare(0, block_set_force_name.length(),
1312 block_set_force_name) == 0) {
1313 Range tris;
1314 CHKERR m_field.get_moab().get_entities_by_dimension(it->meshset, 2, tris,
1315 true);
1316 if (intersect_ptr)
1317 tris = intersect(tris, *intersect_ptr);
1318 CHKERR m_field.add_ents_to_finite_element_by_dim(tris, 2, "FORCE_FE");
1319 }
1320 }
1321 // search for block named PRESSURE and add its attributes to PRESSURE_FE
1322 // element
1323 const string block_set_pressure_name("PRESSURE");
1325 if (it->getName().compare(0, block_set_pressure_name.length(),
1326 block_set_pressure_name) == 0) {
1327 Range tris;
1328 CHKERR m_field.get_moab().get_entities_by_dimension(it->meshset, 2, tris,
1329 true);
1330 if (intersect_ptr)
1331 tris = intersect(tris, *intersect_ptr);
1332 CHKERR m_field.add_ents_to_finite_element_by_dim(tris, 2, "PRESSURE_FE");
1333 }
1334 }
1335
1336 // search for block named LINEAR_PRESSURE and add its attributes to
1337 // PRESSURE_FE element
1338 const string block_set_linear_pressure_name("LINEAR_PRESSURE");
1340 if (it->getName().compare(0, block_set_linear_pressure_name.length(),
1341 block_set_linear_pressure_name) == 0) {
1342 Range tris;
1343 CHKERR m_field.get_moab().get_entities_by_dimension(it->meshset, 2, tris,
1344 true);
1345 if (intersect_ptr)
1346 tris = intersect(tris, *intersect_ptr);
1347 CHKERR m_field.add_ents_to_finite_element_by_dim(tris, 2, "PRESSURE_FE");
1348 }
1349 }
1350
1352}
@ MF_ZERO
Definition: definitions.h:111
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359
@ PRESSURESET
Definition: definitions.h:165
@ FORCESET
Definition: definitions.h:164
@ NODESET
Definition: definitions.h:159
@ SIDESET
Definition: definitions.h:160
@ BLOCKSET
Definition: definitions.h:161
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:429
#define CHKERR
Inline error check.
Definition: definitions.h:548
virtual MoFEMErrorCode modify_finite_element_add_field_row(const std::string &fe_name, const std::string &name_row)=0
set field row which finite element use
virtual MoFEMErrorCode add_ents_to_finite_element_by_dim(const EntityHandle entities, const int dim, const std::string &name, const bool recursive=true)=0
add entities to finite element
virtual MoFEMErrorCode add_finite_element(const std::string &fe_name, enum MoFEMTypes bh=MF_EXCL, int verb=DEFAULT_VERBOSITY)=0
add finite element
virtual MoFEMErrorCode modify_finite_element_add_field_data(const std::string &fe_name, const std::string &name_filed)=0
set finite element field data
virtual MoFEMErrorCode modify_finite_element_add_field_col(const std::string &fe_name, const std::string &name_row)=0
set field col which finite element use
virtual bool check_field(const std::string &name) const =0
check if field is in database
#define _IT_CUBITMESHSETS_BY_BCDATA_TYPE_FOR_LOOP_(MESHSET_MANAGER, CUBITBCTYPE, IT)
Iterator that loops over a specific Cubit MeshSet in a moFEM field.
#define _IT_CUBITMESHSETS_BY_SET_TYPE_FOR_LOOP_(MESHSET_MANAGER, CUBITBCTYPE, IT)
Iterator that loops over a specific Cubit MeshSet having a particular BC meshset in a moFEM field.
constexpr auto field_name
virtual moab::Interface & get_moab()=0

◆ addNeumannFluxBCElements()

MoFEMErrorCode MetaNeumannForces::addNeumannFluxBCElements ( MoFEM::Interface m_field,
const std::string  field_name,
const std::string  mesh_nodals_positions = "MESH_NODE_POSITIONS" 
)
static

Definition at line 1426 of file SurfacePressure.cpp.

1428 {
1430
1431 CHKERR m_field.add_finite_element("FLUX_FE", MF_ZERO);
1435 if (m_field.check_field(mesh_nodals_positions)) {
1437 mesh_nodals_positions);
1438 }
1439
1441 SIDESET | PRESSURESET, it)) {
1442 Range tris;
1443 CHKERR m_field.get_moab().get_entities_by_dimension(it->meshset, 2, tris,
1444 true);
1445 CHKERR m_field.add_ents_to_finite_element_by_dim(tris, 2, "FLUX_FE");
1446 }
1447
1449}

◆ setMassFluxOperators()

MoFEMErrorCode MetaNeumannForces::setMassFluxOperators ( MoFEM::Interface m_field,
boost::ptr_map< std::string, NeumannForcesSurface > &  neumann_forces,
Vec  F,
const std::string  field_name,
const std::string  mesh_nodals_positions = "MESH_NODE_POSITIONS" 
)
static

Definition at line 1451 of file SurfacePressure.cpp.

1454 {
1456 bool ho_geometry = m_field.check_field(mesh_nodals_positions);
1457
1458 string fe_name;
1459 fe_name = "FLUX_FE";
1460 neumann_forces.insert(fe_name, new NeumannForcesSurface(m_field));
1461
1462 auto &nf = neumann_forces.at(fe_name);
1463 auto &fe = nf.getLoopFe();
1464
1465 if (ho_geometry)
1466 CHKERR addHOOpsFace3D(mesh_nodals_positions, fe, false, false);
1467
1469 SIDESET | PRESSURESET, it)) {
1470 CHKERR nf.addFlux(field_name, F, it->getMeshsetId(), ho_geometry);
1471 }
1473}
MoFEMErrorCode addHOOpsFace3D(const std::string field, E &e, bool hcurl, bool hdiv)
Finite element and operators to apply force/pressures applied to surfaces.

◆ setMomentumFluxOperators()

MoFEMErrorCode MetaNeumannForces::setMomentumFluxOperators ( MoFEM::Interface m_field,
boost::ptr_map< std::string, NeumannForcesSurface > &  neumann_forces,
Vec  F,
const std::string  field_name,
const std::string  mesh_nodals_positions = "MESH_NODE_POSITIONS" 
)
static

Set operators to finite elements calculating right hand side vector.

Parameters
m_fieldInterface
neumann_forcesMap of pointers to force/pressure elements
FRight hand side vector
field_nameField name (f.e. DISPLACEMENT)
mesh_nodals_positionsName of field on which ho-geometry is defined
Returns
Error code
Examples
elasticity.cpp, elasticity_mixed_formulation.cpp, mortar_contact.cpp, mortar_contact_thermal.cpp, navier_stokes.cpp, simple_contact.cpp, and simple_contact_thermal.cpp.

Definition at line 1354 of file SurfacePressure.cpp.

1357 {
1359 bool ho_geometry = m_field.check_field(mesh_nodals_positions);
1360 // Add forces
1361 {
1362 std::string fe_name = "FORCE_FE";
1363 neumann_forces.insert(fe_name, new NeumannForcesSurface(m_field));
1364 auto &nf = neumann_forces.at(fe_name);
1365 auto &fe = nf.getLoopFe();
1366
1367 if (ho_geometry)
1368 CHKERR addHOOpsFace3D(mesh_nodals_positions, fe, false, false);
1369
1371 it)) {
1372 CHKERR nf.addForce(field_name, F, it->getMeshsetId(), ho_geometry, false);
1373 }
1374 // Reading forces from BLOCKSET
1375 const string block_set_force_name("FORCE");
1377 if (it->getName().compare(0, block_set_force_name.length(),
1378 block_set_force_name) == 0) {
1379 CHKERR nf.addForce(field_name, F, it->getMeshsetId(), ho_geometry,
1380 true);
1381 }
1382 }
1383 }
1384
1385 // Add pressures
1386 {
1387 std::string fe_name = "PRESSURE_FE";
1388 neumann_forces.insert(fe_name, new NeumannForcesSurface(m_field));
1389
1390 auto &nf = neumann_forces.at(fe_name);
1391 auto &fe = nf.getLoopFe();
1392
1393 if (ho_geometry)
1394 CHKERR addHOOpsFace3D(mesh_nodals_positions, fe, false, false);
1395
1397 m_field, SIDESET | PRESSURESET, it)) {
1398 CHKERR nf.addPressure(field_name, F, it->getMeshsetId(), ho_geometry,
1399 false);
1400 }
1401
1402 // Reading pressures from BLOCKSET
1403 const string block_set_pressure_name("PRESSURE");
1405 if (it->getName().compare(0, block_set_pressure_name.length(),
1406 block_set_pressure_name) == 0) {
1407 CHKERR nf.addPressure(field_name, F, it->getMeshsetId(), ho_geometry,
1408 true);
1409 }
1410 }
1411
1412 // Reading pressures from BLOCKSET
1413 const string block_set_linear_pressure_name("LINEAR_PRESSURE");
1415 if (it->getName().compare(0, block_set_linear_pressure_name.length(),
1416 block_set_linear_pressure_name) == 0) {
1417 CHKERR nf.addLinearPressure(field_name, F, it->getMeshsetId(),
1418 ho_geometry);
1419 }
1420 }
1421 }
1422
1424}

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