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

#include <tools/src/SurfaceSlidingConstrains.hpp>

Inheritance diagram for EdgeSlidingConstrains:
[legend]
Collaboration diagram for EdgeSlidingConstrains:
[legend]

Classes

struct  CalculateEdgeBase
 
struct  MyEdgeFE
 
struct  OpJacobian
 

Public Member Functions

MyEdgeFEgetLoopFeRhs ()
 
MyEdgeFEgetLoopFeLhs ()
 
MoFEMErrorCode getOptions ()
 
 EdgeSlidingConstrains (MoFEM::Interface &m_field)
 
MoFEMErrorCode setOperators (int tag, Range edges, Range faces, const std::string lagrange_multipliers_field_name, const std::string material_field_name)
 
MoFEMErrorCode setOperators (int tag, const std::string lagrange_multipliers_field_name, const std::string material_field_name, const double *alpha=nullptr)
 
MoFEMErrorCode setOperatorsConstrainOnly (int tag, Range edges, Range faces, const std::string lagrange_multipliers_field_name, const std::string material_field_name)
 
MoFEMErrorCode setOperatorsConstrainOnly (int tag, const std::string lagrange_multipliers_field_name, const std::string material_field_name)
 
MyEdgeFEgetLoopFeRhs ()
 
MyEdgeFEgetLoopFeLhs ()
 
MoFEMErrorCode getOptions ()
 
 EdgeSlidingConstrains (MoFEM::Interface &m_field)
 
MoFEMErrorCode setOperators (int tag, Range edges, Range faces, const std::string lagrange_multipliers_field_name, const std::string material_field_name)
 
MoFEMErrorCode setOperators (int tag, const std::string lagrange_multipliers_field_name, const std::string material_field_name, const double *alpha=nullptr)
 
MoFEMErrorCode setOperatorsConstrainOnly (int tag, Range edges, Range faces, const std::string lagrange_multipliers_field_name, const std::string material_field_name)
 
MoFEMErrorCode setOperatorsConstrainOnly (int tag, const std::string lagrange_multipliers_field_name, const std::string material_field_name)
 
- Public Member Functions inherited from GenericSliding
 GenericSliding ()=default
 
virtual ~GenericSliding ()=default
 
 GenericSliding ()=default
 
virtual ~GenericSliding ()=default
 

Public Attributes

MoFEM::InterfacemField
 
boost::shared_ptr< MyEdgeFEfeRhsPtr
 
boost::shared_ptr< MyEdgeFEfeLhsPtr
 
MyEdgeFEfeRhs
 
MyEdgeFEfeLhs
 
double aLpha
 

Detailed Description

Examples
mesh_smoothing.cpp.

Definition at line 639 of file SurfaceSlidingConstrains.hpp.

Constructor & Destructor Documentation

◆ EdgeSlidingConstrains() [1/2]

EdgeSlidingConstrains::EdgeSlidingConstrains ( MoFEM::Interface m_field)
inline

Definition at line 925 of file SurfaceSlidingConstrains.hpp.

926  : mField(m_field), feRhsPtr(new MyEdgeFE(m_field)),
927  feLhsPtr(new MyEdgeFE(m_field)), feRhs(*feRhsPtr), feLhs(*feLhsPtr),
928  aLpha(1) {
929  ierr = getOptions();
930  CHKERRABORT(PETSC_COMM_WORLD, ierr);
931  }

◆ EdgeSlidingConstrains() [2/2]

EdgeSlidingConstrains::EdgeSlidingConstrains ( MoFEM::Interface m_field)
inline

Definition at line 925 of file SurfaceSlidingConstrains.hpp.

926  : mField(m_field), feRhsPtr(new MyEdgeFE(m_field)),
927  feLhsPtr(new MyEdgeFE(m_field)), feRhs(*feRhsPtr), feLhs(*feLhsPtr),
928  aLpha(1) {
929  ierr = getOptions();
930  CHKERRABORT(PETSC_COMM_WORLD, ierr);
931  }

Member Function Documentation

◆ getLoopFeLhs() [1/2]

MyEdgeFE& EdgeSlidingConstrains::getLoopFeLhs ( )
inline

Definition at line 908 of file SurfaceSlidingConstrains.hpp.

908 { return feLhs; }

◆ getLoopFeLhs() [2/2]

MyEdgeFE& EdgeSlidingConstrains::getLoopFeLhs ( )
inline

Definition at line 908 of file SurfaceSlidingConstrains.hpp.

908 { return feLhs; }

◆ getLoopFeRhs() [1/2]

MyEdgeFE& EdgeSlidingConstrains::getLoopFeRhs ( )
inline

Definition at line 906 of file SurfaceSlidingConstrains.hpp.

906 { return feRhs; }

◆ getLoopFeRhs() [2/2]

MyEdgeFE& EdgeSlidingConstrains::getLoopFeRhs ( )
inline

Definition at line 906 of file SurfaceSlidingConstrains.hpp.

906 { return feRhs; }

◆ getOptions() [1/2]

MoFEMErrorCode EdgeSlidingConstrains::getOptions ( )
inline

Definition at line 912 of file SurfaceSlidingConstrains.hpp.

912  {
914  ierr = PetscOptionsBegin(PETSC_COMM_WORLD, "",
915  "Get edge sliding constrains element scaling",
916  "none");
917  CHKERRQ(ierr);
918  CHKERR PetscOptionsScalar("-edge_sliding_alpha", "scaling parameter", "",
919  aLpha, &aLpha, PETSC_NULL);
920  ierr = PetscOptionsEnd();
921  CHKERRQ(ierr);
923  }

◆ getOptions() [2/2]

MoFEMErrorCode EdgeSlidingConstrains::getOptions ( )
inline

Definition at line 912 of file SurfaceSlidingConstrains.hpp.

912  {
914  ierr = PetscOptionsBegin(PETSC_COMM_WORLD, "",
915  "Get edge sliding constrains element scaling",
916  "none");
917  CHKERRQ(ierr);
918  CHKERR PetscOptionsScalar("-edge_sliding_alpha", "scaling parameter", "",
919  aLpha, &aLpha, PETSC_NULL);
920  ierr = PetscOptionsEnd();
921  CHKERRQ(ierr);
923  }

◆ setOperators() [1/4]

MoFEMErrorCode EdgeSlidingConstrains::setOperators ( int  tag,
const std::string  lagrange_multipliers_field_name,
const std::string  material_field_name,
const double alpha = nullptr 
)
inline

Definition at line 1103 of file SurfaceSlidingConstrains.hpp.

1106  {
1108 
1109  if (alpha) {
1110  aLpha = *alpha;
1111  }
1112 
1113  boost::shared_ptr<VectorDouble> active_variables_ptr(
1114  new VectorDouble(4 + 6));
1115  boost::shared_ptr<VectorDouble> results_ptr(new VectorDouble(4 + 6));
1116  boost::shared_ptr<MatrixDouble> jacobian_ptr(
1117  new MatrixDouble(4 + 6, 4 + 6));
1118 
1119  feRhs.getOpPtrVector().clear();
1120  feRhs.getOpPtrVector().push_back(new OpGetActiveDofsLambda(
1121  lagrange_multipliers_field_name, active_variables_ptr));
1122  feRhs.getOpPtrVector().push_back(new OpGetActiveDofsPositions<4>(
1123  material_field_name, active_variables_ptr));
1124  feRhs.getOpPtrVector().push_back(new OpJacobian(
1125  tag, lagrange_multipliers_field_name, active_variables_ptr, results_ptr,
1126  jacobian_ptr, false, aLpha));
1127  feRhs.getOpPtrVector().push_back(
1128  new OpAssembleRhs<4, 6>(lagrange_multipliers_field_name, results_ptr));
1129  feRhs.getOpPtrVector().push_back(
1130  new OpAssembleRhs<4, 6>(material_field_name, results_ptr));
1131 
1132  // Adding operators to calculate the left hand side
1133  feLhs.getOpPtrVector().clear();
1134  feLhs.getOpPtrVector().push_back(new OpGetActiveDofsLambda(
1135  lagrange_multipliers_field_name, active_variables_ptr));
1136  feLhs.getOpPtrVector().push_back(new OpGetActiveDofsPositions<4>(
1137  material_field_name, active_variables_ptr));
1138  feLhs.getOpPtrVector().push_back(new OpJacobian(
1139  tag, lagrange_multipliers_field_name, active_variables_ptr, results_ptr,
1140  jacobian_ptr, true, aLpha));
1141  feLhs.getOpPtrVector().push_back(new OpAssembleLhs<4, 6>(
1142  lagrange_multipliers_field_name, material_field_name, jacobian_ptr));
1143  feLhs.getOpPtrVector().push_back(new OpAssembleLhs<4, 6>(
1144  material_field_name, lagrange_multipliers_field_name, jacobian_ptr));
1145  feLhs.getOpPtrVector().push_back(new OpAssembleLhs<4, 6>(
1146  material_field_name, material_field_name, jacobian_ptr));
1147 
1149  }

◆ setOperators() [2/4]

MoFEMErrorCode EdgeSlidingConstrains::setOperators ( int  tag,
const std::string  lagrange_multipliers_field_name,
const std::string  material_field_name,
const double alpha = nullptr 
)
inline

Definition at line 1103 of file SurfaceSlidingConstrains.hpp.

1106  {
1108 
1109  if (alpha) {
1110  aLpha = *alpha;
1111  }
1112 
1113  boost::shared_ptr<VectorDouble> active_variables_ptr(
1114  new VectorDouble(4 + 6));
1115  boost::shared_ptr<VectorDouble> results_ptr(new VectorDouble(4 + 6));
1116  boost::shared_ptr<MatrixDouble> jacobian_ptr(
1117  new MatrixDouble(4 + 6, 4 + 6));
1118 
1119  feRhs.getOpPtrVector().clear();
1120  feRhs.getOpPtrVector().push_back(new OpGetActiveDofsLambda(
1121  lagrange_multipliers_field_name, active_variables_ptr));
1122  feRhs.getOpPtrVector().push_back(new OpGetActiveDofsPositions<4>(
1123  material_field_name, active_variables_ptr));
1124  feRhs.getOpPtrVector().push_back(new OpJacobian(
1125  tag, lagrange_multipliers_field_name, active_variables_ptr, results_ptr,
1126  jacobian_ptr, false, aLpha));
1127  feRhs.getOpPtrVector().push_back(
1128  new OpAssembleRhs<4, 6>(lagrange_multipliers_field_name, results_ptr));
1129  feRhs.getOpPtrVector().push_back(
1130  new OpAssembleRhs<4, 6>(material_field_name, results_ptr));
1131 
1132  // Adding operators to calculate the left hand side
1133  feLhs.getOpPtrVector().clear();
1134  feLhs.getOpPtrVector().push_back(new OpGetActiveDofsLambda(
1135  lagrange_multipliers_field_name, active_variables_ptr));
1136  feLhs.getOpPtrVector().push_back(new OpGetActiveDofsPositions<4>(
1137  material_field_name, active_variables_ptr));
1138  feLhs.getOpPtrVector().push_back(new OpJacobian(
1139  tag, lagrange_multipliers_field_name, active_variables_ptr, results_ptr,
1140  jacobian_ptr, true, aLpha));
1141  feLhs.getOpPtrVector().push_back(new OpAssembleLhs<4, 6>(
1142  lagrange_multipliers_field_name, material_field_name, jacobian_ptr));
1143  feLhs.getOpPtrVector().push_back(new OpAssembleLhs<4, 6>(
1144  material_field_name, lagrange_multipliers_field_name, jacobian_ptr));
1145  feLhs.getOpPtrVector().push_back(new OpAssembleLhs<4, 6>(
1146  material_field_name, material_field_name, jacobian_ptr));
1147 
1149  }

◆ setOperators() [3/4]

MoFEMErrorCode EdgeSlidingConstrains::setOperators ( int  tag,
Range  edges,
Range  faces,
const std::string  lagrange_multipliers_field_name,
const std::string  material_field_name 
)
inline

Definition at line 1092 of file SurfaceSlidingConstrains.hpp.

1094  {
1097  edges, faces);
1098  CHKERR setOperators(tag, lagrange_multipliers_field_name,
1099  material_field_name);
1101  }

◆ setOperators() [4/4]

MoFEMErrorCode EdgeSlidingConstrains::setOperators ( int  tag,
Range  edges,
Range  faces,
const std::string  lagrange_multipliers_field_name,
const std::string  material_field_name 
)
inline

Definition at line 1092 of file SurfaceSlidingConstrains.hpp.

1094  {
1097  edges, faces);
1098  CHKERR setOperators(tag, lagrange_multipliers_field_name,
1099  material_field_name);
1101  }

◆ setOperatorsConstrainOnly() [1/4]

MoFEMErrorCode EdgeSlidingConstrains::setOperatorsConstrainOnly ( int  tag,
const std::string  lagrange_multipliers_field_name,
const std::string  material_field_name 
)
inline

Definition at line 1165 of file SurfaceSlidingConstrains.hpp.

1167  {
1169 
1170  boost::shared_ptr<VectorDouble> active_variables_ptr(
1171  new VectorDouble(4 + 6));
1172  boost::shared_ptr<VectorDouble> results_ptr(new VectorDouble(4 + 6));
1173  boost::shared_ptr<MatrixDouble> jacobian_ptr(
1174  new MatrixDouble(4 + 6, 4 + 6));
1175 
1176  // Adding operators to calculate the left hand side
1177  feLhs.getOpPtrVector().clear();
1178  feLhs.getOpPtrVector().push_back(new OpGetActiveDofsLambda(
1179  lagrange_multipliers_field_name, active_variables_ptr));
1180  feLhs.getOpPtrVector().push_back(new OpGetActiveDofsPositions<4>(
1181  material_field_name, active_variables_ptr));
1182  feLhs.getOpPtrVector().push_back(new OpJacobian(
1183  tag, lagrange_multipliers_field_name, active_variables_ptr, results_ptr,
1184  jacobian_ptr, true, aLpha));
1185  feLhs.getOpPtrVector().push_back(new OpAssembleLhs<4, 6>(
1186  lagrange_multipliers_field_name, material_field_name, jacobian_ptr));
1187 
1189  }

◆ setOperatorsConstrainOnly() [2/4]

MoFEMErrorCode EdgeSlidingConstrains::setOperatorsConstrainOnly ( int  tag,
const std::string  lagrange_multipliers_field_name,
const std::string  material_field_name 
)
inline

Definition at line 1165 of file SurfaceSlidingConstrains.hpp.

1167  {
1169 
1170  boost::shared_ptr<VectorDouble> active_variables_ptr(
1171  new VectorDouble(4 + 6));
1172  boost::shared_ptr<VectorDouble> results_ptr(new VectorDouble(4 + 6));
1173  boost::shared_ptr<MatrixDouble> jacobian_ptr(
1174  new MatrixDouble(4 + 6, 4 + 6));
1175 
1176  // Adding operators to calculate the left hand side
1177  feLhs.getOpPtrVector().clear();
1178  feLhs.getOpPtrVector().push_back(new OpGetActiveDofsLambda(
1179  lagrange_multipliers_field_name, active_variables_ptr));
1180  feLhs.getOpPtrVector().push_back(new OpGetActiveDofsPositions<4>(
1181  material_field_name, active_variables_ptr));
1182  feLhs.getOpPtrVector().push_back(new OpJacobian(
1183  tag, lagrange_multipliers_field_name, active_variables_ptr, results_ptr,
1184  jacobian_ptr, true, aLpha));
1185  feLhs.getOpPtrVector().push_back(new OpAssembleLhs<4, 6>(
1186  lagrange_multipliers_field_name, material_field_name, jacobian_ptr));
1187 
1189  }

◆ setOperatorsConstrainOnly() [3/4]

MoFEMErrorCode EdgeSlidingConstrains::setOperatorsConstrainOnly ( int  tag,
Range  edges,
Range  faces,
const std::string  lagrange_multipliers_field_name,
const std::string  material_field_name 
)
inline

Definition at line 1152 of file SurfaceSlidingConstrains.hpp.

1154  {
1156 
1158  edges, faces);
1159  CHKERR setOperatorsConstrainOnly(tag, lagrange_multipliers_field_name,
1160  material_field_name);
1162  }

◆ setOperatorsConstrainOnly() [4/4]

MoFEMErrorCode EdgeSlidingConstrains::setOperatorsConstrainOnly ( int  tag,
Range  edges,
Range  faces,
const std::string  lagrange_multipliers_field_name,
const std::string  material_field_name 
)
inline

Definition at line 1152 of file SurfaceSlidingConstrains.hpp.

1154  {
1156 
1158  edges, faces);
1159  CHKERR setOperatorsConstrainOnly(tag, lagrange_multipliers_field_name,
1160  material_field_name);
1162  }

Member Data Documentation

◆ aLpha

double EdgeSlidingConstrains::aLpha

Definition at line 910 of file SurfaceSlidingConstrains.hpp.

◆ feLhs

MyEdgeFE & EdgeSlidingConstrains::feLhs

Definition at line 907 of file SurfaceSlidingConstrains.hpp.

◆ feLhsPtr

boost::shared_ptr< MyEdgeFE > EdgeSlidingConstrains::feLhsPtr

Definition at line 903 of file SurfaceSlidingConstrains.hpp.

◆ feRhs

MyEdgeFE & EdgeSlidingConstrains::feRhs

Definition at line 905 of file SurfaceSlidingConstrains.hpp.

◆ feRhsPtr

boost::shared_ptr< MyEdgeFE > EdgeSlidingConstrains::feRhsPtr

Definition at line 903 of file SurfaceSlidingConstrains.hpp.

◆ mField

MoFEM::Interface & EdgeSlidingConstrains::mField

Definition at line 874 of file SurfaceSlidingConstrains.hpp.


The documentation for this struct was generated from the following file:
EdgeSlidingConstrains::setOperatorsConstrainOnly
MoFEMErrorCode setOperatorsConstrainOnly(int tag, Range edges, Range faces, const std::string lagrange_multipliers_field_name, const std::string material_field_name)
Definition: SurfaceSlidingConstrains.hpp:1152
EdgeSlidingConstrains::mField
MoFEM::Interface & mField
Definition: SurfaceSlidingConstrains.hpp:874
EdgeSlidingConstrains::getOptions
MoFEMErrorCode getOptions()
Definition: SurfaceSlidingConstrains.hpp:912
EdgeSlidingConstrains::CalculateEdgeBase::setTags
static MoFEMErrorCode setTags(moab::Interface &moab, Range edges, Range tris, bool number_pathes=true, boost::shared_ptr< SurfaceSlidingConstrains::DriverElementOrientation > surface_orientation=nullptr, MoFEM::Interface *m_field_ptr=nullptr)
Definition: SurfaceSlidingConstrains.hpp:716
MoFEM::Types::MatrixDouble
UBlasMatrix< double > MatrixDouble
Definition: Types.hpp:77
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:548
MoFEM::CoreInterface::get_moab
virtual moab::Interface & get_moab()=0
EdgeSlidingConstrains::aLpha
double aLpha
Definition: SurfaceSlidingConstrains.hpp:910
EdgeSlidingConstrains::setOperators
MoFEMErrorCode setOperators(int tag, Range edges, Range faces, const std::string lagrange_multipliers_field_name, const std::string material_field_name)
Definition: SurfaceSlidingConstrains.hpp:1092
EdgeSlidingConstrains::feRhsPtr
boost::shared_ptr< MyEdgeFE > feRhsPtr
Definition: SurfaceSlidingConstrains.hpp:903
EdgeSlidingConstrains::feRhs
MyEdgeFE & feRhs
Definition: SurfaceSlidingConstrains.hpp:905
MoFEM::Exceptions::ierr
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Exceptions.hpp:76
MoFEM::ForcesAndSourcesCore::getOpPtrVector
boost::ptr_deque< UserDataOperator > & getOpPtrVector()
Use to push back operator for row operator.
Definition: ForcesAndSourcesCore.hpp:83
MoFEM::Types::VectorDouble
UBlasVector< double > VectorDouble
Definition: Types.hpp:68
EdgeSlidingConstrains::feLhsPtr
boost::shared_ptr< MyEdgeFE > feLhsPtr
Definition: SurfaceSlidingConstrains.hpp:903
EdgeSlidingConstrains::feLhs
MyEdgeFE & feLhs
Definition: SurfaceSlidingConstrains.hpp:907
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:429
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359