v0.13.0
Public Member Functions | Public Attributes | List of all members
SphereRigidBody Struct Reference

#include <users_modules/multifield_plasticity/src/RigidBodies.hpp>

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

Public Member Functions

 SphereRigidBody (VectorDouble c_coords, VectorDouble roller_disp, int id)
 
MoFEMErrorCode getRollerDataForTag ()
 
Tensor1< double, 3 > getNormal (Tensor1< TPack3, 3 > &t_coords, Tensor1< TPack1, 3 > &t_disp)
 
Tensor1< double, 3 > getNormal (Tensor1< TPack3, 3 > &t_coords, Tensor1< double, 3 > &t_disp)
 
Tensor1< double, 3 > getNormal (Tensor1< double, 3 > &t_coords, Tensor1< double, 3 > &t_disp)
 
Tensor2< double, 3, 3 > getDiffNormal (Tensor1< TPack3, 3 > &t_coords, Tensor1< TPack1, 3 > &t_disp, Tensor1< TPack1, 3 > &t_normal)
 
double getGap (Tensor1< TPack3, 3 > &t_coords)
 
Tensor1< double, 3 > getdGap (Tensor1< TPack3, 3 > &t_coords, Tensor1< TPack1, 3 > &t_normal)
 
template<typename T1 , typename T2 >
Tensor1< double, 3 > & getNormalImpl (Tensor1< T1, 3 > &t_coords, Tensor1< T2, 3 > &t_disp)
 
template<typename T1 , typename T2 , typename T3 >
Tensor2< double, 3, 3 > getDiffNormalImpl (Tensor1< T1, 3 > &t_coords, Tensor1< T2, 3 > &t_disp, Tensor1< T3, 3 > &t_normal)
 
template<typename T1 >
double getGapImpl (Tensor1< T1, 3 > &t_coords)
 
template<typename T1 , typename T2 >
Tensor1< double, 3 > getdGapImpl (Tensor1< T1, 3 > &t_coords, Tensor1< T2, 3 > &t_normal)
 
MoFEMErrorCode getBodyOptions ()
 
- Public Member Functions inherited from RigidBodyData
 RigidBodyData (VectorDouble c_coords, VectorDouble roller_disp, int id)
 
 RigidBodyData ()=delete
 
virtual ~RigidBodyData ()
 
MoFEMErrorCode computeRotationMatrix ()
 
Tensor1< double, 3 > getBodyOffset ()
 
template<typename T1 , typename T2 >
Tensor1< double, 3 > & getPointCoords (Tensor1< T1, 3 > &t_coords, Tensor1< T2, 3 > &t_disp)
 
MoFEMErrorCode saveBasicDataOnTag (moab::Interface &moab_debug, EntityHandle &vertex)
 

Public Attributes

double rAdius
 
- Public Attributes inherited from RigidBodyData
const int iD
 
Index< 'i', 3 > i
 
Index< 'j', 3 > j
 
Index< 'k', 3 > k
 
VectorDouble originCoords
 
VectorDouble rollerDisp
 
VectorDouble BodyDispScaled
 
double gAp
 
Tensor1< double, 3 > tNormal
 
Tensor1< double, 3 > dGap
 
Tensor1< double, 3 > pointCoords
 
Tensor1< double, 3 > closestPoint
 
Tensor1< double, 3 > defaultOrientation
 
Tensor1< double, 3 > oRientation
 
Tensor2< double, 3, 3 > rotationMat
 
Tensor2< double, 3, 3 > diffNormal
 
string positionDataParamName
 
int bodyType
 
array< double, 9 > dataForTags
 

Additional Inherited Members

- Public Types inherited from RigidBodyData
using TPack3 = PackPtr< double *, 3 >
 
using TPack1 = PackPtr< double *, 1 >
 

Detailed Description

Definition at line 257 of file RigidBodies.hpp.

Constructor & Destructor Documentation

◆ SphereRigidBody()

SphereRigidBody::SphereRigidBody ( VectorDouble  c_coords,
VectorDouble  roller_disp,
int  id 
)

Definition at line 259 of file RigidBodies.hpp.

260  : RigidBodyData(c_coords, roller_disp, id), rAdius(1) {}
RigidBodyData()=delete

Member Function Documentation

◆ getBodyOptions()

MoFEMErrorCode SphereRigidBody::getBodyOptions ( )
virtual

Implements RigidBodyData.

Definition at line 338 of file RigidBodies.hpp.

338  {
340 
341  CHKERR PetscOptionsBegin(PETSC_COMM_WORLD, "", "", "");
342 
343  string param = "-radius" + to_string(iD);
344  CHKERR PetscOptionsScalar(param.c_str(), "set roller radius", "", rAdius,
345  &rAdius, PETSC_NULL);
346  ierr = PetscOptionsEnd();
347  CHKERRG(ierr);
348 
350  }
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:496
#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
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Exceptions.hpp:87
const int iD
Definition: RigidBodies.hpp:30

◆ getdGap()

Tensor1<double, 3> SphereRigidBody::getdGap ( Tensor1< TPack3, 3 > &  t_coords,
Tensor1< TPack1, 3 > &  t_normal 
)
virtual

Implements RigidBodyData.

Definition at line 292 of file RigidBodies.hpp.

293  {
294  return getdGapImpl(t_coords, t_normal);
295  }
Tensor1< double, 3 > getdGapImpl(Tensor1< T1, 3 > &t_coords, Tensor1< T2, 3 > &t_normal)

◆ getdGapImpl()

template<typename T1 , typename T2 >
Tensor1<double, 3> SphereRigidBody::getdGapImpl ( Tensor1< T1, 3 > &  t_coords,
Tensor1< T2, 3 > &  t_normal 
)

Definition at line 329 of file RigidBodies.hpp.

330  {
331  // d gap / d normal
332  dGap(i) =
333  pointCoords(j) * diffNormal(i, j) +
334  tNormal(j) * (kronecker_delta(i, j) - 2. * rAdius * diffNormal(i, j));
335  return dGap;
336  };
Tensor2_Expr< Kronecker_Delta< T >, T, Dim0, Dim1, i, j > kronecker_delta(const Index< i, Dim0 > &, const Index< j, Dim1 > &)
Rank 2.
Tensor1< double, 3 > pointCoords
Definition: RigidBodies.hpp:40
Tensor1< double, 3 > tNormal
Definition: RigidBodies.hpp:38
Tensor1< double, 3 > dGap
Definition: RigidBodies.hpp:39
Index< 'i', 3 > i
Definition: RigidBodies.hpp:31
Index< 'j', 3 > j
Definition: RigidBodies.hpp:32
Tensor2< double, 3, 3 > diffNormal
Definition: RigidBodies.hpp:45

◆ getDiffNormal()

Tensor2<double, 3, 3> SphereRigidBody::getDiffNormal ( Tensor1< TPack3, 3 > &  t_coords,
Tensor1< TPack1, 3 > &  t_disp,
Tensor1< TPack1, 3 > &  t_normal 
)
virtual

Implements RigidBodyData.

Definition at line 282 of file RigidBodies.hpp.

284  {
285  return getDiffNormalImpl(t_coords, t_disp, t_normal);
286  }
Tensor2< double, 3, 3 > getDiffNormalImpl(Tensor1< T1, 3 > &t_coords, Tensor1< T2, 3 > &t_disp, Tensor1< T3, 3 > &t_normal)

◆ getDiffNormalImpl()

template<typename T1 , typename T2 , typename T3 >
Tensor2<double, 3, 3> SphereRigidBody::getDiffNormalImpl ( Tensor1< T1, 3 > &  t_coords,
Tensor1< T2, 3 > &  t_disp,
Tensor1< T3, 3 > &  t_normal 
)

Definition at line 308 of file RigidBodies.hpp.

310  {
311 
312  auto t_d = getPointCoords(t_coords, t_disp);
313 
314  const double norm = t_d.l2();
315  const double norm3 = norm * norm * norm;
316  diffNormal(i, j) =
317  kronecker_delta(i, j) * (1. / norm) - (1. / norm3) * t_d(i) * t_d(j);
318 
319  return diffNormal;
320  };
Tensor1< double, 3 > & getPointCoords(Tensor1< T1, 3 > &t_coords, Tensor1< T2, 3 > &t_disp)

◆ getGap()

double SphereRigidBody::getGap ( Tensor1< TPack3, 3 > &  t_coords)
virtual

Implements RigidBodyData.

Definition at line 288 of file RigidBodies.hpp.

288  {
289  return getGapImpl(t_coords);
290  }
double getGapImpl(Tensor1< T1, 3 > &t_coords)

◆ getGapImpl()

template<typename T1 >
double SphereRigidBody::getGapImpl ( Tensor1< T1, 3 > &  t_coords)

Definition at line 322 of file RigidBodies.hpp.

322  {
323 
324  gAp = tNormal(i) * (pointCoords(i) - tNormal(i) * rAdius);
325  return gAp;
326  };

◆ getNormal() [1/3]

Tensor1<double, 3> SphereRigidBody::getNormal ( Tensor1< double, 3 > &  t_coords,
Tensor1< double, 3 > &  t_disp 
)
virtual

Implements RigidBodyData.

Definition at line 277 of file RigidBodies.hpp.

278  {
279  return getNormalImpl(t_coords, t_disp);
280  }
Tensor1< double, 3 > & getNormalImpl(Tensor1< T1, 3 > &t_coords, Tensor1< T2, 3 > &t_disp)

◆ getNormal() [2/3]

Tensor1<double, 3> SphereRigidBody::getNormal ( Tensor1< TPack3, 3 > &  t_coords,
Tensor1< double, 3 > &  t_disp 
)
virtual

Implements RigidBodyData.

Definition at line 273 of file RigidBodies.hpp.

274  {
275  return getNormalImpl(t_coords, t_disp);
276  }

◆ getNormal() [3/3]

Tensor1<double, 3> SphereRigidBody::getNormal ( Tensor1< TPack3, 3 > &  t_coords,
Tensor1< TPack1, 3 > &  t_disp 
)
virtual

Implements RigidBodyData.

Definition at line 269 of file RigidBodies.hpp.

270  {
271  return getNormalImpl(t_coords, t_disp);
272  }

◆ getNormalImpl()

template<typename T1 , typename T2 >
Tensor1<double, 3>& SphereRigidBody::getNormalImpl ( Tensor1< T1, 3 > &  t_coords,
Tensor1< T2, 3 > &  t_disp 
)

Definition at line 298 of file RigidBodies.hpp.

299  {
300  auto t_d = getPointCoords(t_coords, t_disp);
301  tNormal(i) = t_d(i);
302  tNormal.normalize();
303 
304  return tNormal;
305  };

◆ getRollerDataForTag()

MoFEMErrorCode SphereRigidBody::getRollerDataForTag ( )
virtual

Implements RigidBodyData.

Definition at line 262 of file RigidBodies.hpp.

262  {
264  bodyType = SPHERE;
265  dataForTags[0] = rAdius;
267  }
@ SPHERE
Definition: RigidBodies.hpp:19
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:460
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:453
array< double, 9 > dataForTags
Definition: RigidBodies.hpp:50

Member Data Documentation

◆ rAdius

double SphereRigidBody::rAdius

Definition at line 258 of file RigidBodies.hpp.


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