v0.14.0
Classes | Public Types | Public Member Functions | Public Attributes | List of all members
NeumannForcesSurface Struct Reference

Finite element and operators to apply force/pressures applied to surfaces. More...

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

Collaboration diagram for NeumannForcesSurface:
[legend]

Classes

struct  bCForce
 
struct  bCPressure
 
struct  DataAtIntegrationPts
 
struct  LinearVaringPresssure
 
struct  MethodForAnalyticalForce
 Analytical force method. More...
 
struct  MyTriangleFE
 
struct  OpCalculateDeformation
 Operator for computing deformation gradients in side volumes. More...
 
struct  OpGetTangent
 Operator for computing tangent vectors. More...
 
struct  OpNeumannFlux
 Operator for flux element. More...
 
struct  OpNeumannForce
 Operator for force element. More...
 
struct  OpNeumannForceAnalytical
 Operator for force element. More...
 
struct  OpNeumannPressure
 RHS-operator for pressure element (spatial configuration) More...
 
struct  OpNeumannPressureLhs_dx_dX
 LHS-operator for pressure element (spatial configuration) More...
 
struct  OpNeumannPressureMaterialLhs
 Base class for LHS-operators for pressure element (material configuration) More...
 
struct  OpNeumannPressureMaterialLhs_dX_dX
 LHS-operator for the pressure element (material configuration) More...
 
struct  OpNeumannPressureMaterialLhs_dX_dx
 LHS-operator for the pressure element (material configuration) More...
 
struct  OpNeumannPressureMaterialRhs_dX
 RHS-operator for the pressure element (material configuration) More...
 
struct  OpNeumannPressureMaterialVolOnSideLhs
 Base class for LHS-operators (material) on side volumes. More...
 
struct  OpNeumannPressureMaterialVolOnSideLhs_dX_dX
 LHS-operator (material configuration) on the side volume. More...
 
struct  OpNeumannPressureMaterialVolOnSideLhs_dX_dx
 LHS-operator (material configuration) on the side volume. More...
 
struct  OpNeumannSurfaceForceLhs_dx_dX
 LHS-operator for surface force element (spatial configuration) More...
 
struct  OpNeumannSurfaceForceMaterialLhs
 Base class for LHS-operators for pressure element (material configuration) More...
 
struct  OpNeumannSurfaceForceMaterialLhs_dX_dx
 LHS-operator for the surface force element (material configuration) More...
 
struct  OpNeumannSurfaceForceMaterialLhs_dX_dX
 LHS-operator for the surface force element (material configuration) More...
 
struct  OpNeumannSurfaceForceMaterialRhs_dX
 RHS-operator for the surface force element (material configuration) More...
 
struct  OpNeumannSurfaceForceMaterialVolOnSideLhs
 Base class for LHS-operators (material) on side volumes. More...
 
struct  OpNeumannSurfaceForceMaterialVolOnSideLhs_dX_dx
 LHS-operator (material configuration) on the side volume. More...
 
struct  OpNeumannSurfaceForceMaterialVolOnSideLhs_dX_dX
 LHS-operator (material configuration) on the side volume. More...
 

Public Types

using UserDataOperator = MoFEM::FaceElementForcesAndSourcesCore::UserDataOperator
 
using VolOnSideUserDataOperator = MoFEM::VolumeElementForcesAndSourcesCoreOnSide::UserDataOperator
 
using EntData = EntitiesFieldData::EntData
 

Public Member Functions

MyTriangleFEgetLoopFe ()
 
MyTriangleFEgetLoopFeLhs ()
 
MyTriangleFEgetLoopFeMatRhs ()
 
MyTriangleFEgetLoopFeMatLhs ()
 
 NeumannForcesSurface (MoFEM::Interface &m_field)
 
MoFEMErrorCode addForce (const std::string field_name, Vec F, int ms_id, bool ho_geometry=false, bool block_set=false)
 Add operator to calculate forces on element. More...
 
MoFEMErrorCode addForceAle (const std::string field_name_1, const std::string field_name_2, boost::shared_ptr< DataAtIntegrationPts > data_at_pts, std::string side_fe_name, Vec F, Mat aij, int ms_id, bool ho_geometry=false, bool block_set=false, bool ignore_material_force=false)
 Add operator to calculate forces on element (in ALE) More...
 
MoFEMErrorCode addPressure (const std::string field_name, Vec F, int ms_id, bool ho_geometry=false, bool block_set=false)
 Add operator to calculate pressure on element. More...
 
MoFEMErrorCode addPressureAle (const std::string field_name_1, const std::string field_name_2, boost::shared_ptr< DataAtIntegrationPts > data_at_pts, std::string side_fe_name, Vec F, Mat aij, int ms_id, bool ho_geometry=false, bool block_set=false)
 Add operator to calculate pressure on element (in ALE) More...
 
MoFEMErrorCode addLinearPressure (const std::string field_name, Vec F, int ms_id, bool ho_geometry=false)
 Add operator to calculate pressure on element. More...
 
MoFEMErrorCode addFlux (const std::string field_name, Vec F, int ms_id, bool ho_geometry=false)
 Add flux element operator (integration on face) More...
 
DEPRECATED MoFEMErrorCode addPreassure (const std::string field_name, Vec F, int ms_id, bool ho_geometry=false, bool block_set=false)
 

Public Attributes

DEPRECATED typedef MethodForAnalyticalForce MethodForAnaliticalForce
 
DEPRECATED typedef OpNeumannPressure OpNeumannPreassure
 
DEPRECATED typedef bCPressure bCPreassure
 
MoFEM::InterfacemField
 
MyTriangleFE fe
 
MyTriangleFE feLhs
 
MyTriangleFE feMatRhs
 
MyTriangleFE feMatLhs
 
std::map< int, bCForcemapForce
 
std::map< int, bCPressuremapPressure
 
boost::ptr_vector< MethodForForceScalingmethodsOp
 
boost::ptr_vector< MethodForAnalyticalForceanalyticalForceOp
 

Detailed Description

Finite element and operators to apply force/pressures applied to surfaces.

Examples
nonlinear_dynamics.cpp.

Definition at line 14 of file SurfacePressure.hpp.

Member Typedef Documentation

◆ EntData

using NeumannForcesSurface::EntData = EntitiesFieldData::EntData

Definition at line 104 of file SurfacePressure.hpp.

◆ UserDataOperator

Definition at line 101 of file SurfacePressure.hpp.

◆ VolOnSideUserDataOperator

Definition at line 103 of file SurfacePressure.hpp.

Constructor & Destructor Documentation

◆ NeumannForcesSurface()

NeumannForcesSurface::NeumannForcesSurface ( MoFEM::Interface m_field)
inline

Definition at line 81 of file SurfacePressure.hpp.

82  : mField(m_field), fe(m_field), feLhs(m_field), feMatRhs(m_field),
83  feMatLhs(m_field) {}

Member Function Documentation

◆ addFlux()

MoFEMErrorCode NeumannForcesSurface::addFlux ( const std::string  field_name,
Vec  F,
int  ms_id,
bool  ho_geometry = false 
)

Add flux element operator (integration on face)

Definition at line 1958 of file SurfacePressure.cpp.

1960  {
1961  const CubitMeshSets *cubit_meshset_ptr;
1962  MeshsetsManager *mmanager_ptr;
1964  CHKERR mField.getInterface(mmanager_ptr);
1965  CHKERR mmanager_ptr->getCubitMeshsetPtr(ms_id, SIDESET, &cubit_meshset_ptr);
1966  CHKERR cubit_meshset_ptr->getBcDataStructure(mapPressure[ms_id].data);
1967  CHKERR mField.get_moab().get_entities_by_dimension(
1968  cubit_meshset_ptr->meshset, 2, mapPressure[ms_id].tRis, true);
1969  fe.getOpPtrVector().push_back(new OpNeumannFlux(
1970  field_name, F, mapPressure[ms_id], methodsOp, ho_geometry));
1972 }

◆ addForce()

MoFEMErrorCode NeumannForcesSurface::addForce ( const std::string  field_name,
Vec  F,
int  ms_id,
bool  ho_geometry = false,
bool  block_set = false 
)

Add operator to calculate forces on element.

Parameters
field_nameField name (f.e. TEMPERATURE)
FRight hand side vector
ms_idSet id (SideSet or BlockSet if block_set = true)
ho_geometryUse higher order shape functions to define curved geometry
block_setIf tru get data from block set
Returns
ErrorCode

Definition at line 1571 of file SurfacePressure.cpp.

1574  {
1575  const CubitMeshSets *cubit_meshset_ptr;
1576  MeshsetsManager *mmanager_ptr;
1578  CHKERR mField.getInterface(mmanager_ptr);
1579  if (block_set) {
1580  // Add data from block set.
1581  CHKERR mmanager_ptr->getCubitMeshsetPtr(ms_id, BLOCKSET,
1582  &cubit_meshset_ptr);
1583  std::vector<double> mydata;
1584  CHKERR cubit_meshset_ptr->getAttributes(mydata);
1585  VectorDouble force(mydata.size());
1586  for (unsigned int ii = 0; ii != mydata.size(); ++ii) {
1587  force[ii] = mydata[ii];
1588  }
1589  // Read forces from BLOCKSET Force (if exists)
1590  if (force.empty()) {
1591  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "Force not given");
1592  }
1593  // Assign values from BLOCKSET FORCE to RHS vector. Info about native Cubit
1594  // BC data structure can be found in BCData.hpp
1595  const string name = "Force";
1596  strncpy(mapForce[ms_id].data.data.name, name.c_str(),
1597  name.size() > 5 ? 5 : name.size());
1598  double magnitude = std::sqrt(force[0] * force[0] + force[1] * force[1] +
1599  force[2] * force[2]);
1600  mapForce[ms_id].data.data.value1 = -magnitude; //< Force magnitude
1601  mapForce[ms_id].data.data.value2 = 0;
1602  mapForce[ms_id].data.data.value3 =
1603  force[0] / magnitude; //< X-component of force vector
1604  mapForce[ms_id].data.data.value4 =
1605  force[1] / magnitude; //< Y-component of force vector
1606  mapForce[ms_id].data.data.value5 =
1607  force[2] / magnitude; //< Z-component of force vector
1608  mapForce[ms_id].data.data.value6 = 0;
1609  mapForce[ms_id].data.data.value7 = 0;
1610  mapForce[ms_id].data.data.value8 = 0;
1611  mapForce[ms_id].data.data.zero[0] = 0;
1612  mapForce[ms_id].data.data.zero[1] = 0;
1613  mapForce[ms_id].data.data.zero[2] = 0;
1614  mapForce[ms_id].data.data.zero2 = 0;
1615 
1616  CHKERR mField.get_moab().get_entities_by_dimension(
1617  cubit_meshset_ptr->meshset, 2, mapForce[ms_id].tRis, true);
1618  fe.getOpPtrVector().push_back(new OpNeumannForce(
1619  field_name, F, mapForce[ms_id], methodsOp, ho_geometry));
1620 
1621  // SETERRQ(PETSC_COMM_SELF,MOFEM_NOT_IMPLEMENTED,"Not implemented");
1622  } else {
1623  CHKERR mmanager_ptr->getCubitMeshsetPtr(ms_id, NODESET, &cubit_meshset_ptr);
1624  CHKERR cubit_meshset_ptr->getBcDataStructure(mapForce[ms_id].data);
1625  CHKERR mField.get_moab().get_entities_by_dimension(
1626  cubit_meshset_ptr->meshset, 2, mapForce[ms_id].tRis, true);
1627  fe.getOpPtrVector().push_back(new OpNeumannForce(
1628  field_name, F, mapForce[ms_id], methodsOp, ho_geometry));
1629  }
1631 }

◆ addForceAle()

MoFEMErrorCode NeumannForcesSurface::addForceAle ( const std::string  field_name_1,
const std::string  field_name_2,
boost::shared_ptr< DataAtIntegrationPts data_at_pts,
std::string  side_fe_name,
Vec  F,
Mat  aij,
int  ms_id,
bool  ho_geometry = false,
bool  block_set = false,
bool  ignore_material_force = false 
)

Add operator to calculate forces on element (in ALE)

Parameters
field_name_1Field name for spatial positions
field_name_2Field name for material positions
data_at_ptsCommon data at integration points
side_fe_nameName of the element in the side volume
FRight hand side vector
aijTangent matrix
ms_idSet id (SideSet or BlockSet if block_set = true)
ho_geometryUse higher order shape functions to define curved geometry
block_setIf true get data from block set
ignore_material_forceIf true then material force is not added
Returns
ErrorCode

Definition at line 1633 of file SurfacePressure.cpp.

1637  {
1638  const CubitMeshSets *cubit_meshset_ptr;
1639  MeshsetsManager *mmanager_ptr;
1641  CHKERR mField.getInterface(mmanager_ptr);
1642  if (block_set) {
1643  // Add data from block set.
1644  CHKERR mmanager_ptr->getCubitMeshsetPtr(ms_id, BLOCKSET,
1645  &cubit_meshset_ptr);
1646  std::vector<double> mydata;
1647  CHKERR cubit_meshset_ptr->getAttributes(mydata);
1648  VectorDouble force(mydata.size());
1649  for (unsigned int ii = 0; ii != mydata.size(); ++ii) {
1650  force[ii] = mydata[ii];
1651  }
1652  // Read forces from BLOCKSET Force (if exists)
1653  if (force.empty()) {
1654  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "Force not given");
1655  }
1656  // Assign values from BLOCKSET FORCE to RHS vector. Info about native Cubit
1657  // BC data structure can be found in BCData.hpp
1658  const string name = "Force";
1659  strncpy(mapForce[ms_id].data.data.name, name.c_str(),
1660  name.size() > 5 ? 5 : name.size());
1661  double magnitude = std::sqrt(force[0] * force[0] + force[1] * force[1] +
1662  force[2] * force[2]);
1663  mapForce[ms_id].data.data.value1 = -magnitude; //< Force magnitude
1664  mapForce[ms_id].data.data.value2 = 0;
1665  mapForce[ms_id].data.data.value3 =
1666  force[0] / magnitude; //< X-component of force vector
1667  mapForce[ms_id].data.data.value4 =
1668  force[1] / magnitude; //< Y-component of force vector
1669  mapForce[ms_id].data.data.value5 =
1670  force[2] / magnitude; //< Z-component of force vector
1671  mapForce[ms_id].data.data.value6 = 0;
1672  mapForce[ms_id].data.data.value7 = 0;
1673  mapForce[ms_id].data.data.value8 = 0;
1674  mapForce[ms_id].data.data.zero[0] = 0;
1675  mapForce[ms_id].data.data.zero[1] = 0;
1676  mapForce[ms_id].data.data.zero[2] = 0;
1677  mapForce[ms_id].data.data.zero2 = 0;
1678 
1679  CHKERR mField.get_moab().get_entities_by_dimension(
1680  cubit_meshset_ptr->meshset, 2, mapForce[ms_id].tRis, true);
1681  // SETERRQ(PETSC_COMM_SELF,MOFEM_NOT_IMPLEMENTED,"Not implemented");
1682  } else {
1683  CHKERR mmanager_ptr->getCubitMeshsetPtr(ms_id, NODESET, &cubit_meshset_ptr);
1684  CHKERR cubit_meshset_ptr->getBcDataStructure(mapForce[ms_id].data);
1685  CHKERR mField.get_moab().get_entities_by_dimension(
1686  cubit_meshset_ptr->meshset, 2, mapForce[ms_id].tRis, true);
1687  }
1688 
1689  /* LEFT-HAND SIDE (SPATIAL) */
1690  feLhs.getOpPtrVector().push_back(new OpGetTangent(X_field, data_at_pts));
1691 
1692  feLhs.getOpPtrVector().push_back(new OpNeumannSurfaceForceLhs_dx_dX(
1693  x_field, X_field, data_at_pts, aij, mapForce[ms_id], ho_geometry));
1694 
1695  /* RIGHT-HAND SIDE (MATERIAL) */
1696  if (!ignore_material_force) {
1697  // Side volume element computes the deformation gradient F=hH^-1
1698  boost::shared_ptr<VolumeElementForcesAndSourcesCoreOnSide> feMatSideRhs =
1699  boost::make_shared<VolumeElementForcesAndSourcesCoreOnSide>(mField);
1700 
1701  feMatSideRhs->getOpPtrVector().push_back(
1703  data_at_pts->getHMatPtr()));
1704  feMatSideRhs->getOpPtrVector().push_back(
1706  x_field, data_at_pts->getSmallhMatPtr()));
1707 
1708  feMatSideRhs->getOpPtrVector().push_back(
1709  new OpCalculateDeformation(X_field, data_at_pts, ho_geometry));
1710 
1711  feMatRhs.getOpPtrVector().push_back(new OpNeumannSurfaceForceMaterialRhs_dX(
1712  X_field, data_at_pts, feMatSideRhs, side_fe_name, F, mapForce[ms_id],
1713  ho_geometry));
1714 
1715  /* LEFT-HAND SIDE (MATERIAL) */
1716 
1717  // Side volume element computes linearisation with spatial coordinates
1718  boost::shared_ptr<VolumeElementForcesAndSourcesCoreOnSide> feMatSideLhs_dx =
1719  boost::make_shared<VolumeElementForcesAndSourcesCoreOnSide>(mField);
1720  // Side volume element computes linearisation with material coordinates
1721  boost::shared_ptr<VolumeElementForcesAndSourcesCoreOnSide> feMatSideLhs_dX =
1722  boost::make_shared<VolumeElementForcesAndSourcesCoreOnSide>(mField);
1723 
1724  feMatSideLhs_dx->getOpPtrVector().push_back(
1726  data_at_pts->getHMatPtr()));
1727  feMatSideLhs_dx->getOpPtrVector().push_back(
1729  x_field, data_at_pts->getSmallhMatPtr()));
1730 
1731  feMatSideLhs_dx->getOpPtrVector().push_back(
1732  new OpCalculateDeformation(X_field, data_at_pts, ho_geometry));
1733  feMatSideLhs_dx->getOpPtrVector().push_back(
1734  new OpNeumannSurfaceForceMaterialVolOnSideLhs_dX_dx(
1735  X_field, x_field, data_at_pts, aij, mapForce[ms_id], ho_geometry));
1736 
1737  feMatLhs.getOpPtrVector().push_back(
1738  new OpNeumannSurfaceForceMaterialLhs_dX_dx(
1739  X_field, x_field, data_at_pts, feMatSideLhs_dx, side_fe_name, aij,
1740  mapForce[ms_id], ho_geometry));
1741 
1742  feMatSideLhs_dX->getOpPtrVector().push_back(
1744  data_at_pts->getHMatPtr()));
1745  feMatSideLhs_dX->getOpPtrVector().push_back(
1747  x_field, data_at_pts->getSmallhMatPtr()));
1748  feMatSideLhs_dX->getOpPtrVector().push_back(
1749  new OpCalculateDeformation(X_field, data_at_pts, ho_geometry));
1750  feMatSideLhs_dX->getOpPtrVector().push_back(
1751  new OpNeumannSurfaceForceMaterialVolOnSideLhs_dX_dX(
1752  X_field, X_field, data_at_pts, aij, mapForce[ms_id], ho_geometry));
1753 
1754  feMatLhs.getOpPtrVector().push_back(new OpGetTangent(X_field, data_at_pts));
1755  feMatLhs.getOpPtrVector().push_back(
1756  new OpNeumannSurfaceForceMaterialLhs_dX_dX(
1757  X_field, X_field, data_at_pts, feMatSideLhs_dX, side_fe_name, aij,
1758  mapForce[ms_id], ho_geometry));
1759  }
1760 
1762 }

◆ addLinearPressure()

MoFEMErrorCode NeumannForcesSurface::addLinearPressure ( const std::string  field_name,
Vec  F,
int  ms_id,
bool  ho_geometry = false 
)

Add operator to calculate pressure on element.

Parameters
field_nameField name (f.e. TEMPERATURE)
FRight hand side vector
ms_idSet id (SideSet or BlockSet if block_set = true)
ho_geometryUse higher order shape functions to define curved geometry
block_setIf tru get data from block set
Returns
ErrorCode

Definition at line 1920 of file SurfacePressure.cpp.

1921  {
1922 
1923  const CubitMeshSets *cubit_meshset_ptr;
1924  MeshsetsManager *mmanager_ptr;
1926  CHKERR mField.getInterface(mmanager_ptr);
1927  CHKERR mmanager_ptr->getCubitMeshsetPtr(ms_id, BLOCKSET, &cubit_meshset_ptr);
1928  std::vector<double> mydata;
1929  CHKERR cubit_meshset_ptr->getAttributes(mydata);
1930  if (mydata.size() < 4)
1931  SETERRQ1(PETSC_COMM_SELF, MOFEM_INVALID_DATA,
1932  "Should be four block attributes but is %d", mydata.size());
1933  VectorDouble3 pressure_coeffs(3);
1934  for (unsigned int ii = 0; ii != 3; ++ii) {
1935  pressure_coeffs[ii] = mydata[ii];
1936  }
1937  const double pressure_shift = mydata[3];
1938 
1939  Range tris;
1940  CHKERR mField.get_moab().get_entities_by_dimension(cubit_meshset_ptr->meshset,
1941  2, tris, true);
1942  boost::shared_ptr<MethodForAnalyticalForce> analytical_force_op(
1943  new LinearVaringPresssure(pressure_coeffs, pressure_shift));
1944  fe.getOpPtrVector().push_back(new OpNeumannForceAnalytical(
1945  field_name, F, tris, methodsOp, analytical_force_op, ho_geometry));
1946 
1948 }

◆ addPreassure()

MoFEMErrorCode NeumannForcesSurface::addPreassure ( const std::string  field_name,
Vec  F,
int  ms_id,
bool  ho_geometry = false,
bool  block_set = false 
)
Deprecated:
function is deprecated because spelling mistake, use addPressure instead

Definition at line 1950 of file SurfacePressure.cpp.

1953  {
1954  return NeumannForcesSurface::addPressure(field_name, F, ms_id, ho_geometry,
1955  block_set);
1956 }

◆ addPressure()

MoFEMErrorCode NeumannForcesSurface::addPressure ( const std::string  field_name,
Vec  F,
int  ms_id,
bool  ho_geometry = false,
bool  block_set = false 
)

Add operator to calculate pressure on element.

Parameters
field_nameField name (f.e. TEMPERATURE)
FRight hand side vector
ms_idSet id (SideSet or BlockSet if block_set = true)
ho_geometryUse higher order shape functions to define curved geometry
block_setIf true get data from block set
Returns
ErrorCode

Definition at line 1764 of file SurfacePressure.cpp.

1767  {
1768 
1769  const CubitMeshSets *cubit_meshset_ptr;
1770  MeshsetsManager *mmanager_ptr;
1772  CHKERR mField.getInterface(mmanager_ptr);
1773  if (block_set) {
1774  CHKERR mmanager_ptr->getCubitMeshsetPtr(ms_id, BLOCKSET,
1775  &cubit_meshset_ptr);
1776  std::vector<double> mydata;
1777  CHKERR cubit_meshset_ptr->getAttributes(mydata);
1778  VectorDouble pressure(mydata.size());
1779  for (unsigned int ii = 0; ii != mydata.size(); ++ii) {
1780  pressure[ii] = mydata[ii];
1781  }
1782  if (pressure.empty()) {
1783  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "Pressure not given");
1784  }
1785  const string name = "Pressure";
1786  strncpy(mapPressure[ms_id].data.data.name, name.c_str(),
1787  name.size() > 8 ? 8 : name.size());
1788  mapPressure[ms_id].data.data.flag1 = 0;
1789  mapPressure[ms_id].data.data.flag2 = 1;
1790  mapPressure[ms_id].data.data.value1 = pressure[0];
1791  mapPressure[ms_id].data.data.zero = 0;
1792  CHKERR mField.get_moab().get_entities_by_dimension(
1793  cubit_meshset_ptr->meshset, 2, mapPressure[ms_id].tRis, true);
1794  fe.getOpPtrVector().push_back(new OpNeumannPressure(
1795  field_name, F, mapPressure[ms_id], methodsOp, ho_geometry));
1796  } else {
1797  CHKERR mmanager_ptr->getCubitMeshsetPtr(ms_id, SIDESET, &cubit_meshset_ptr);
1798  CHKERR cubit_meshset_ptr->getBcDataStructure(mapPressure[ms_id].data);
1799  CHKERR mField.get_moab().get_entities_by_dimension(
1800  cubit_meshset_ptr->meshset, 2, mapPressure[ms_id].tRis, true);
1801  fe.getOpPtrVector().push_back(new OpNeumannPressure(
1802  field_name, F, mapPressure[ms_id], methodsOp, ho_geometry));
1803  }
1805 }

◆ addPressureAle()

MoFEMErrorCode NeumannForcesSurface::addPressureAle ( const std::string  field_name_1,
const std::string  field_name_2,
boost::shared_ptr< DataAtIntegrationPts data_at_pts,
std::string  side_fe_name,
Vec  F,
Mat  aij,
int  ms_id,
bool  ho_geometry = false,
bool  block_set = false 
)

Add operator to calculate pressure on element (in ALE)

Parameters
field_name_1Field name for spatial positions
field_name_2Field name for material positions
data_at_ptsCommon data at integration points
side_fe_nameName of the element in the side volume
FRight hand side vector
aijTangent matrix
ms_idSet id (SideSet or BlockSet if block_set = true)
ho_geometryUse higher order shape functions to define curved geometry
block_setIf true get data from block set
Returns
ErrorCode

Definition at line 1807 of file SurfacePressure.cpp.

1811  {
1812 
1813  const CubitMeshSets *cubit_meshset_ptr;
1814  MeshsetsManager *mmanager_ptr;
1816  CHKERR mField.getInterface(mmanager_ptr);
1817  if (block_set) {
1818  CHKERR mmanager_ptr->getCubitMeshsetPtr(ms_id, BLOCKSET,
1819  &cubit_meshset_ptr);
1820  std::vector<double> mydata;
1821  CHKERR cubit_meshset_ptr->getAttributes(mydata);
1822  VectorDouble pressure(mydata.size());
1823  for (unsigned int ii = 0; ii != mydata.size(); ++ii) {
1824  pressure[ii] = mydata[ii];
1825  }
1826  if (pressure.empty()) {
1827  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "Pressure not given");
1828  }
1829  const string name = "Pressure";
1830  strncpy(mapPressure[ms_id].data.data.name, name.c_str(),
1831  name.size() > 8 ? 8 : name.size());
1832  mapPressure[ms_id].data.data.flag1 = 0;
1833  mapPressure[ms_id].data.data.flag2 = 1;
1834  mapPressure[ms_id].data.data.value1 = pressure[0];
1835  mapPressure[ms_id].data.data.zero = 0;
1836  CHKERR mField.get_moab().get_entities_by_dimension(
1837  cubit_meshset_ptr->meshset, 2, mapPressure[ms_id].tRis, true);
1838 
1839  } else {
1840  CHKERR mmanager_ptr->getCubitMeshsetPtr(ms_id, SIDESET, &cubit_meshset_ptr);
1841  CHKERR cubit_meshset_ptr->getBcDataStructure(mapPressure[ms_id].data);
1842  CHKERR mField.get_moab().get_entities_by_dimension(
1843  cubit_meshset_ptr->meshset, 2, mapPressure[ms_id].tRis, true);
1844  }
1845 
1846  /* LEFT-HAND SIDE (SPATIAL) */
1847 
1848  feLhs.getOpPtrVector().push_back(new OpGetTangent(X_field, data_at_pts));
1849 
1850  feLhs.getOpPtrVector().push_back(new OpNeumannPressureLhs_dx_dX(
1851  x_field, X_field, data_at_pts, aij, mapPressure[ms_id], ho_geometry));
1852 
1853  /* RIGHT-HAND SIDE (MATERIAL) */
1854 
1855  // Side volume element computes the deformation gradient F=hH^-1
1856  boost::shared_ptr<VolumeElementForcesAndSourcesCoreOnSide> feMatSideRhs =
1857  boost::make_shared<VolumeElementForcesAndSourcesCoreOnSide>(mField);
1858 
1859  feMatSideRhs->getOpPtrVector().push_back(
1861  data_at_pts->getHMatPtr()));
1862  feMatSideRhs->getOpPtrVector().push_back(
1864  data_at_pts->getSmallhMatPtr()));
1865 
1866  feMatSideRhs->getOpPtrVector().push_back(
1867  new OpCalculateDeformation(X_field, data_at_pts, ho_geometry));
1868 
1869  feMatRhs.getOpPtrVector().push_back(new OpNeumannPressureMaterialRhs_dX(
1870  X_field, data_at_pts, feMatSideRhs, side_fe_name, F, mapPressure[ms_id],
1871  ho_geometry));
1872 
1873  /* LEFT-HAND SIDE (MATERIAL) */
1874 
1875  // Side volume element computes linearisation with spatial coordinates
1876  boost::shared_ptr<VolumeElementForcesAndSourcesCoreOnSide> feMatSideLhs_dx =
1877  boost::make_shared<VolumeElementForcesAndSourcesCoreOnSide>(mField);
1878  // Side volume element computes linearisation with material coordinates
1879  boost::shared_ptr<VolumeElementForcesAndSourcesCoreOnSide> feMatSideLhs_dX =
1880  boost::make_shared<VolumeElementForcesAndSourcesCoreOnSide>(mField);
1881 
1882  feMatSideLhs_dx->getOpPtrVector().push_back(
1884  data_at_pts->getHMatPtr()));
1885  feMatSideLhs_dx->getOpPtrVector().push_back(
1887  data_at_pts->getSmallhMatPtr()));
1888 
1889  feMatSideLhs_dx->getOpPtrVector().push_back(
1890  new OpCalculateDeformation(X_field, data_at_pts, ho_geometry));
1891  feMatSideLhs_dx->getOpPtrVector().push_back(
1892  new OpNeumannPressureMaterialVolOnSideLhs_dX_dx(
1893  X_field, x_field, data_at_pts, aij, mapPressure[ms_id], ho_geometry));
1894 
1895  feMatLhs.getOpPtrVector().push_back(new OpNeumannPressureMaterialLhs_dX_dx(
1896  X_field, x_field, data_at_pts, feMatSideLhs_dx, side_fe_name, aij,
1897  mapPressure[ms_id], ho_geometry));
1898 
1899  feMatSideLhs_dX->getOpPtrVector().push_back(
1901  data_at_pts->getHMatPtr()));
1902  feMatSideLhs_dX->getOpPtrVector().push_back(
1904  data_at_pts->getSmallhMatPtr()));
1905  feMatSideLhs_dX->getOpPtrVector().push_back(
1906  new OpCalculateDeformation(X_field, data_at_pts, ho_geometry));
1907  feMatSideLhs_dX->getOpPtrVector().push_back(
1908  new OpNeumannPressureMaterialVolOnSideLhs_dX_dX(
1909  X_field, X_field, data_at_pts, aij, mapPressure[ms_id], ho_geometry));
1910 
1911  feMatLhs.getOpPtrVector().push_back(new OpGetTangent(X_field, data_at_pts));
1912  feMatLhs.getOpPtrVector().push_back(new OpNeumannPressureMaterialLhs_dX_dX(
1913  X_field, X_field, data_at_pts, feMatSideLhs_dX, side_fe_name, aij,
1914  mapPressure[ms_id], ho_geometry));
1915 
1917 }

◆ getLoopFe()

MyTriangleFE& NeumannForcesSurface::getLoopFe ( )
inline

Definition at line 67 of file SurfacePressure.hpp.

67 { return fe; }

◆ getLoopFeLhs()

MyTriangleFE& NeumannForcesSurface::getLoopFeLhs ( )
inline

Definition at line 71 of file SurfacePressure.hpp.

71 { return feLhs; }

◆ getLoopFeMatLhs()

MyTriangleFE& NeumannForcesSurface::getLoopFeMatLhs ( )
inline

Definition at line 79 of file SurfacePressure.hpp.

79 { return feMatLhs; }

◆ getLoopFeMatRhs()

MyTriangleFE& NeumannForcesSurface::getLoopFeMatRhs ( )
inline

Definition at line 75 of file SurfacePressure.hpp.

75 { return feMatRhs; }

Member Data Documentation

◆ analyticalForceOp

boost::ptr_vector<MethodForAnalyticalForce> NeumannForcesSurface::analyticalForceOp

Definition at line 98 of file SurfacePressure.hpp.

◆ bCPreassure

DEPRECATED typedef bCPressure NeumannForcesSurface::bCPreassure
Deprecated:
Do not use spelling mistake

Definition at line 1249 of file SurfacePressure.hpp.

◆ fe

MyTriangleFE NeumannForcesSurface::fe

Definition at line 66 of file SurfacePressure.hpp.

◆ feLhs

MyTriangleFE NeumannForcesSurface::feLhs

Definition at line 70 of file SurfacePressure.hpp.

◆ feMatLhs

MyTriangleFE NeumannForcesSurface::feMatLhs

Definition at line 78 of file SurfacePressure.hpp.

◆ feMatRhs

MyTriangleFE NeumannForcesSurface::feMatRhs

Definition at line 74 of file SurfacePressure.hpp.

◆ mapForce

std::map<int, bCForce> NeumannForcesSurface::mapForce

Definition at line 89 of file SurfacePressure.hpp.

◆ mapPressure

std::map<int, bCPressure> NeumannForcesSurface::mapPressure

Definition at line 95 of file SurfacePressure.hpp.

◆ MethodForAnaliticalForce

DEPRECATED typedef MethodForAnalyticalForce NeumannForcesSurface::MethodForAnaliticalForce
Deprecated:
fixed spelling mistake

Definition at line 1244 of file SurfacePressure.hpp.

◆ methodsOp

boost::ptr_vector<MethodForForceScaling> NeumannForcesSurface::methodsOp

Definition at line 97 of file SurfacePressure.hpp.

◆ mField

MoFEM::Interface& NeumannForcesSurface::mField

Definition at line 16 of file SurfacePressure.hpp.

◆ OpNeumannPreassure

DEPRECATED typedef OpNeumannPressure NeumannForcesSurface::OpNeumannPreassure

Definition at line 1246 of file SurfacePressure.hpp.


The documentation for this struct was generated from the following files:
MoFEM::UnknownInterface::getInterface
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface refernce to pointer of interface.
Definition: UnknownInterface.hpp:93
SIDESET
@ SIDESET
Definition: definitions.h:147
MoFEM::Types::VectorDouble3
VectorBoundedArray< double, 3 > VectorDouble3
Definition: Types.hpp:92
MoFEM::CubitMeshSets
this struct keeps basic methods for moab meshset about material and boundary conditions
Definition: BCMultiIndices.hpp:19
NeumannForcesSurface::addPressure
MoFEMErrorCode addPressure(const std::string field_name, Vec F, int ms_id, bool ho_geometry=false, bool block_set=false)
Add operator to calculate pressure on element.
Definition: SurfacePressure.cpp:1764
MoFEM::CubitMeshSets::getBcDataStructure
MoFEMErrorCode getBcDataStructure(CUBIT_BC_DATA_TYPE &data) const
Definition: BCMultiIndices.hpp:296
NODESET
@ NODESET
Definition: definitions.h:146
NeumannForcesSurface::feMatRhs
MyTriangleFE feMatRhs
Definition: SurfacePressure.hpp:74
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:535
NeumannForcesSurface::feMatLhs
MyTriangleFE feMatLhs
Definition: SurfacePressure.hpp:78
MoFEM::CoreInterface::get_moab
virtual moab::Interface & get_moab()=0
MoFEM::CubitMeshSets::meshset
EntityHandle meshset
Definition: BCMultiIndices.hpp:21
NeumannForcesSurface::mapPressure
std::map< int, bCPressure > mapPressure
Definition: SurfacePressure.hpp:95
field_name
constexpr auto field_name
Definition: poisson_2d_homogeneous.cpp:13
NeumannForcesSurface::mapForce
std::map< int, bCForce > mapForce
Definition: SurfacePressure.hpp:89
MoFEM::OpCalculateVectorFieldGradient
Get field gradients at integration pts for scalar filed rank 0, i.e. vector field.
Definition: UserDataOperators.hpp:1536
Range
NeumannForcesSurface::mField
MoFEM::Interface & mField
Definition: SurfacePressure.hpp:16
MoFEM::CubitMeshSets::getAttributes
MoFEMErrorCode getAttributes(std::vector< double > &attributes) const
get Cubit block attributes
Definition: BCMultiIndices.cpp:290
BLOCKSET
@ BLOCKSET
Definition: definitions.h:148
MoFEM::ForcesAndSourcesCore::getOpPtrVector
boost::ptr_deque< UserDataOperator > & getOpPtrVector()
Use to push back operator for row operator.
Definition: ForcesAndSourcesCore.hpp:83
MOFEM_DATA_INCONSISTENCY
@ MOFEM_DATA_INCONSISTENCY
Definition: definitions.h:31
MoFEM::MeshsetsManager
Interface for managing meshsets containing materials and boundary conditions.
Definition: MeshsetsManager.hpp:104
MoFEM::Types::VectorDouble
UBlasVector< double > VectorDouble
Definition: Types.hpp:68
MoFEM::MeshsetsManager::getCubitMeshsetPtr
MoFEMErrorCode getCubitMeshsetPtr(const int ms_id, const CubitBCType cubit_bc_type, const CubitMeshSets **cubit_meshset_ptr) const
get cubit meshset
Definition: MeshsetsManager.cpp:575
NeumannForcesSurface::feLhs
MyTriangleFE feLhs
Definition: SurfacePressure.hpp:70
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:416
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:346
MOFEM_INVALID_DATA
@ MOFEM_INVALID_DATA
Definition: definitions.h:36
F
@ F
Definition: free_surface.cpp:394
NeumannForcesSurface::fe
MyTriangleFE fe
Definition: SurfacePressure.hpp:66
NeumannForcesSurface::methodsOp
boost::ptr_vector< MethodForForceScaling > methodsOp
Definition: SurfacePressure.hpp:97