DisplacementFiniteElement.h
Go to the documentation of this file.
1 /* ---------------------------------------------------------------------
2  * _
3  * _ __ ___ __ _ _ __ _ __ ___ ___ | |_
4  * | '_ ` _ \ / _` | '__| '_ ` _ \ / _ \| __|
5  * | | | | | | (_| | | | | | | | | (_) | |_
6  * |_| |_| |_|\__,_|_| |_| |_| |_|\___/ \__|
7  *
8  * Unit of Strength of Materials and Structural Analysis
9  * University of Innsbruck,
10  * 2020 - today
11  *
12  * festigkeitslehre@uibk.ac.at
13  *
14  * Matthias Neuner matthias.neuner@uibk.ac.at
15  * Magdalena Schreter magdalena.schreter@uibk.ac.at
16  *
17  * This file is part of the MAteRialMOdellingToolbox (marmot).
18  *
19  * This library is free software; you can redistribute it and/or
20  * modify it under the terms of the GNU Lesser General Public
21  * License as published by the Free Software Foundation; either
22  * version 2.1 of the License, or (at your option) any later version.
23  *
24  * The full text of the license can be found in the file LICENSE.md at
25  * the top level directory of marmot.
26  * ---------------------------------------------------------------------
27  */
28 #pragma once
29 #include "Marmot/Marmot.h"
30 #include "Marmot/MarmotConstants.h"
31 #include "Marmot/MarmotElement.h"
35 #include "Marmot/MarmotJournal.h"
38 #include "Marmot/MarmotMath.h"
40 #include "Marmot/MarmotTypedefs.h"
41 #include "Marmot/MarmotVoigt.h"
42 #include <iostream>
43 #include <memory>
44 #include <vector>
45 
46 using namespace Marmot;
47 using namespace Eigen;
48 
49 namespace Marmot::Elements {
50 
51  template < int nDim, int nNodes >
52  class DisplacementFiniteElement : public MarmotElement, public MarmotGeometryElement< nDim, nNodes > {
53 
54  public:
55  enum SectionType {
60  };
61 
62  static constexpr int sizeLoadVector = nNodes * nDim;
63  static constexpr int nCoordinates = nNodes * nDim;
64 
70  using RhsSized = Matrix< double, sizeLoadVector, 1 >;
71  using KeSizedMatrix = Matrix< double, sizeLoadVector, sizeLoadVector >;
72  using CSized = Matrix< double, ParentGeometryElement::voigtSize, ParentGeometryElement::voigtSize >;
73  using Voigt = Matrix< double, ParentGeometryElement::voigtSize, 1 >;
74 
75  Map< const VectorXd > elementProperties;
76  const int elLabel;
78 
79  struct QuadraturePoint {
80 
81  const XiSized xi;
82  const double weight;
83 
84  double detJ;
85  double J0xW;
87 
89 
90  inline const static auto layout = makeLayout( {
91  { .name = "stress", .length = 6 },
92  { .name = "strain", .length = 6 },
93  { .name = "begin of material state", .length = 0 },
94  } );
95 
96  public:
99  Eigen::Map< Eigen::VectorXd > materialStateVars;
100 
101  static int getNumberOfRequiredStateVarsQuadraturePointOnly() { return layout.nRequiredStateVars; };
102 
103  QPStateVarManager( double* theStateVarVector, int nStateVars )
104  : MarmotStateVarVectorManager( theStateVarVector, layout ),
105  stress( &find( "stress" ) ),
106  strain( &find( "strain" ) ),
107  materialStateVars( &find( "begin of material state" ),
108  nStateVars - getNumberOfRequiredStateVarsQuadraturePointOnly() ){};
109  };
110 
111  std::unique_ptr< QPStateVarManager > managedStateVars;
112 
113  std::unique_ptr< MarmotMaterialHypoElastic > material;
114 
116  {
117  return QPStateVarManager::getNumberOfRequiredStateVarsQuadraturePointOnly();
118  };
119 
121  {
122  return getNumberOfRequiredStateVarsQuadraturePointOnly() + material->getNumberOfRequiredStateVars();
123  };
124 
125  void assignStateVars( double* stateVars, int nStateVars )
126  {
127  managedStateVars = std::make_unique< QPStateVarManager >( stateVars, nStateVars );
128  material->assignStateVars( managedStateVars->materialStateVars.data(),
129  managedStateVars->materialStateVars.size() );
130  }
131 
132  QuadraturePoint( XiSized xi, double weight )
133  : xi( xi ), weight( weight ), detJ( 0.0 ), J0xW( 0.0 ), B( BSized::Zero() ){};
134  };
135 
136  std::vector< QuadraturePoint > qps;
137 
138  DisplacementFiniteElement( int elementID,
140  SectionType sectionType );
141 
142  int getNumberOfRequiredStateVars();
143 
144  std::vector< std::vector< std::string > > getNodeFields();
145 
146  std::vector< int > getDofIndicesPermutationPattern();
147 
148  int getNNodes() { return nNodes; }
149 
150  int getNSpatialDimensions() { return nDim; }
151 
152  int getNDofPerElement() { return sizeLoadVector; }
153 
154  std::string getElementShape() { return ParentGeometryElement::getElementShape(); }
155 
156  void assignStateVars( double* stateVars, int nStateVars );
157 
158  void assignProperty( const ElementProperties& marmotElementProperty );
159 
160  void assignProperty( const MarmotMaterialSection& marmotElementProperty );
161 
162  void assignNodeCoordinates( const double* coordinates );
163 
164  void initializeYourself();
165 
166  void setInitialConditions( StateTypes state, const double* values );
167 
168  void computeDistributedLoad( MarmotElement::DistributedLoadTypes loadType,
169  double* P,
170  double* K,
171  const int elementFace,
172  const double* load,
173  const double* QTotal,
174  const double* time,
175  double dT );
176 
177  void computeBodyForce( double* P,
178  double* K,
179  const double* load,
180  const double* QTotal,
181  const double* time,
182  double dT );
183 
184  void computeYourself( const double* QTotal,
185  const double* dQ,
186  double* Pe,
187  double* Ke,
188  const double* time,
189  double dT,
190  double& pNewdT );
191 
192  StateView getStateView( const std::string& stateName, int qpNumber )
193  {
194  const auto& qp = qps[qpNumber];
195 
196  if ( qp.managedStateVars->contains( stateName ) ) {
197  return qp.managedStateVars->getStateView( stateName );
198  }
199 
200  if ( stateName == "sdv" ) {
201  std::cout << __PRETTY_FUNCTION__ << " on 'sdv' is discouraged and deprecated, please use precise state name";
202  return { qp.managedStateVars->materialStateVars.data(),
203  static_cast< int >( qp.managedStateVars->materialStateVars.size() ) };
204  }
205 
206  else {
207  return qp.material->getStateView( stateName );
208  }
209  }
210 
211  std::vector< double > getCoordinatesAtCenter();
212 
213  std::vector< std::vector< double > > getCoordinatesAtQuadraturePoints();
214 
215  int getNumberOfQuadraturePoints();
216  };
217 
218  template < int nDim, int nNodes >
220  int elementID,
222  SectionType sectionType )
224  elementProperties( Map< const VectorXd >( nullptr, 0 ) ),
225  elLabel( elementID ),
226  sectionType( sectionType )
227  {
228  for ( const auto& qpInfo : FiniteElement::Quadrature::getGaussPointInfo( this->shape, integrationType ) ) {
229  QuadraturePoint qp( qpInfo.xi, qpInfo.weight );
230  qps.push_back( std::move( qp ) );
231  }
232  }
233 
234  template < int nDim, int nNodes >
236  {
237  return qps[0].getNumberOfRequiredStateVars() * qps.size();
238  }
239 
240  template < int nDim, int nNodes >
241  std::vector< std::vector< std::string > > DisplacementFiniteElement< nDim, nNodes >::getNodeFields()
242  {
243  using namespace std;
244 
245  static vector< vector< string > > nodeFields;
246  if ( nodeFields.empty() )
247  for ( int i = 0; i < nNodes; i++ ) {
248  nodeFields.push_back( vector< string >() );
249  nodeFields[i].push_back( "displacement" );
250  }
251 
252  return nodeFields;
253  }
254 
255  template < int nDim, int nNodes >
257  {
258  static std::vector< int > permutationPattern;
259  if ( permutationPattern.empty() )
260  for ( int i = 0; i < nNodes * nDim; i++ )
261  permutationPattern.push_back( i );
262 
263  return permutationPattern;
264  }
265 
266  template < int nDim, int nNodes >
267  void DisplacementFiniteElement< nDim, nNodes >::assignStateVars( double* stateVars, int nStateVars )
268  {
269  const int nQpStateVars = nStateVars / qps.size();
270 
271  for ( size_t i = 0; i < qps.size(); i++ ) {
272  auto& qp = qps[i];
273  double* qpStateVars = stateVars + ( i * nQpStateVars );
274  qp.assignStateVars( qpStateVars, nQpStateVars );
275  }
276  }
277 
278  template < int nDim, int nNodes >
280  {
281  new ( &elementProperties ) Eigen::Map< const Eigen::VectorXd >( elementPropertiesInfo.elementProperties,
282  elementPropertiesInfo.nElementProperties );
283  }
284 
285  template < int nDim, int nNodes >
287  {
288  for ( auto& qp : qps ) {
289  qp.material = std::unique_ptr< MarmotMaterialHypoElastic >( dynamic_cast< MarmotMaterialHypoElastic* >(
291  section.materialProperties,
292  section.nMaterialProperties,
293  elLabel ) ) );
294 
295  if ( !qp.material )
296  throw std::invalid_argument( MakeString()
297  << __PRETTY_FUNCTION__
298  << ": invalid material assigned; cannot cast to MarmotMaterialHypoElastic!" );
299 
300  if constexpr ( nDim == 3 )
301  qp.material->setCharacteristicElementLength( std::cbrt( 8 * qp.detJ ) );
302  if constexpr ( nDim == 2 )
303  qp.material->setCharacteristicElementLength( std::sqrt( 4 * qp.detJ ) );
304  if constexpr ( nDim == 1 )
305  qp.material->setCharacteristicElementLength( 2 * qp.detJ );
306  }
307  }
308 
309  template < int nDim, int nNodes >
311  {
312  ParentGeometryElement::assignNodeCoordinates( coordinates );
313  }
314 
315  template < int nDim, int nNodes >
317  {
318  for ( QuadraturePoint& qp : qps ) {
319  const dNdXiSized dNdXi = this->dNdXi( qp.xi );
320  const JacobianSized J = this->Jacobian( dNdXi );
321  const JacobianSized JInv = J.inverse();
322  const dNdXiSized dNdX = this->dNdX( dNdXi, JInv );
323  qp.detJ = J.determinant();
324  qp.B = this->B( dNdX );
325 
326  if constexpr ( nDim == 3 ) {
327  qp.J0xW = qp.weight * qp.detJ;
328  }
329  if constexpr ( nDim == 2 ) {
330  const double& thickness = elementProperties[0];
331  qp.J0xW = qp.weight * qp.detJ * thickness;
332  }
333  if constexpr ( nDim == 1 ) {
334  const double& crossSection = elementProperties[0];
335  qp.J0xW = qp.weight * qp.detJ * crossSection;
336  }
337  }
338  }
339 
340  template < int nDim, int nNodes >
342  const double* dQ_,
343  double* Pe_,
344  double* Ke_,
345  const double* time,
346  double dT,
347  double& pNewDT )
348  {
349  using namespace Marmot;
350  using namespace ContinuumMechanics::VoigtNotation;
351 
352  Map< const RhsSized > QTotal( QTotal_ );
353  Map< const RhsSized > dQ( dQ_ );
354  Map< KeSizedMatrix > Ke( Ke_ );
355  Map< RhsSized > Pe( Pe_ );
356 
357  Voigt S, dE;
358  CSized C;
359 
360  for ( QuadraturePoint& qp : qps ) {
361 
362  const BSized& B = qp.B;
363  dE = B * dQ;
364 
365  if constexpr ( nDim == 1 ) {
366 
367  S = reduce3DVoigt< ParentGeometryElement::voigtSize >( qp.managedStateVars->stress );
368  qp.material->computeUniaxialStress( S.data(), C.data(), dE.data(), time, dT, pNewDT );
369  qp.managedStateVars->stress = make3DVoigt< ParentGeometryElement::voigtSize >( S );
370  }
371 
372  else if constexpr ( nDim == 2 ) {
373 
374  if ( sectionType == SectionType::PlaneStress ) {
375 
376  S = reduce3DVoigt< ParentGeometryElement::voigtSize >( qp.managedStateVars->stress );
377  qp.material->computePlaneStress( S.data(), C.data(), dE.data(), time, dT, pNewDT );
378  qp.managedStateVars->stress = make3DVoigt< ParentGeometryElement::voigtSize >( S );
379  }
380 
381  else if ( sectionType == SectionType::PlaneStrain ) {
382 
383  Vector6d dE6 = planeVoigtToVoigt( dE );
384  Matrix6d C66;
385 
386  Vector6d S6 = qp.managedStateVars->stress;
387  qp.material->computeStress( S6.data(), C66.data(), dE6.data(), time, dT, pNewDT );
388  qp.managedStateVars->stress = S6;
389 
390  S = reduce3DVoigt< ParentGeometryElement::voigtSize >( S6 );
392  }
393  }
394 
395  else if constexpr ( nDim == 3 ) {
396  if ( sectionType == SectionType::Solid ) {
397 
398  S = qp.managedStateVars->stress;
399  qp.material->computeStress( S.data(), C.data(), dE.data(), time, dT, pNewDT );
400  qp.managedStateVars->stress = S;
401  }
402  }
403 
404  qp.managedStateVars->strain += make3DVoigt< ParentGeometryElement::voigtSize >( dE );
405 
406  if ( pNewDT < 1.0 )
407  return;
408 
409  Ke += B.transpose() * C * B * qp.J0xW;
410  Pe -= B.transpose() * S * qp.J0xW;
411  }
412  }
413 
414  template < int nDim, int nNodes >
416  {
417  switch ( state ) {
419  for ( QuadraturePoint& qp : qps ) {
420  qp.material->initializeYourself();
421  }
422  break;
423  }
425  if ( nDim >= 2 )
426  for ( QuadraturePoint& qp : qps ) {
427  XiSized coordAtGauss = this->NB( this->N( qp.xi ) ) * this->coordinates;
428 
429  const double sigY1 = values[0];
430  const double sigY2 = values[2];
431  const double y1 = values[1];
432  const double y2 = values[3];
433 
434  using namespace Math;
435  qp.managedStateVars->stress( 1 ) = linearInterpolation( coordAtGauss[1], y1, y2, sigY1, sigY2 ); // sigma_y
436  qp.managedStateVars->stress( 0 ) = values[4] * qp.managedStateVars->stress( 1 ); // sigma_x
437  qp.managedStateVars->stress( 2 ) = values[5] * qp.managedStateVars->stress( 1 );
438  }
439  break;
440  }
442  throw std::invalid_argument( "Please use initializeStateVars directly on material" );
443  }
444  default: throw std::invalid_argument( MakeString() << __PRETTY_FUNCTION__ << ": invalid initial condition" );
445  }
446  }
447 
448  template < int nDim, int nNodes >
450  double* P,
451  double* K,
452  const int elementFace,
453  const double* load,
454  const double* QTotal,
455  const double* time,
456  double dT )
457  {
458  Map< RhsSized > fU( P );
459 
460  switch ( loadType ) {
461 
463  const double p = load[0];
464 
465  FiniteElement::BoundaryElement boundaryEl( this->shape, elementFace, nDim, this->coordinates );
466 
467  VectorXd Pk = -p * boundaryEl.computeSurfaceNormalVectorialLoadVector();
468 
469  if ( nDim == 2 )
470  Pk *= elementProperties[0]; // thickness
471 
472  boundaryEl.assembleIntoParentVectorial( Pk, fU );
473 
474  break;
475  }
477 
478  FiniteElement::BoundaryElement boundaryEl( this->shape, elementFace, nDim, this->coordinates );
479 
480  const XiSized tractionVector( load );
481 
482  auto Pk = boundaryEl.computeVectorialLoadVector( tractionVector );
483  if ( nDim == 2 )
484  Pk *= elementProperties[0]; // thickness
485  boundaryEl.assembleIntoParentVectorial( Pk, fU );
486 
487  break;
488  }
489  default: {
490  throw std::invalid_argument( "Invalid Load Type specified" );
491  }
492  }
493  }
494 
495  template < int nDim, int nNodes >
497  double* K,
498  const double* load,
499  const double* QTotal,
500  const double* time,
501  double dT )
502  {
503  Map< RhsSized > Pe( P_ );
504  const Map< const Matrix< double, nDim, 1 > > f( load );
505 
506  for ( const auto& qp : qps )
507  Pe += this->NB( this->N( qp.xi ) ).transpose() * f * qp.J0xW;
508  }
509 
510  template < int nDim, int nNodes >
512  {
513  std::vector< double > coords( nDim );
514 
515  Eigen::Map< XiSized > coordsMap( &coords[0] );
516  const auto centerXi = XiSized::Zero();
517  coordsMap = this->NB( this->N( centerXi ) ) * this->coordinates;
518  return coords;
519  }
520 
521  template < int nDim, int nNodes >
523  {
524  std::vector< std::vector< double > > listedCoords;
525 
526  std::vector< double > coords( nDim );
527  Eigen::Map< XiSized > coordsMap( &coords[0] );
528 
529  for ( const auto& qp : qps ) {
530  coordsMap = this->NB( this->N( qp.xi ) ) * this->coordinates;
531  listedCoords.push_back( coords );
532  }
533 
534  return listedCoords;
535  }
536 
537  template < int nDim, int nNodes >
539  {
540  return qps.size();
541  }
542 } // namespace Marmot::Elements
Marmot::Elements::DisplacementFiniteElement::XiSized
typename ParentGeometryElement::XiSized XiSized
Definition: DisplacementFiniteElement.h:69
MarmotMaterialHypoElastic.h
MarmotConstants.h
Marmot::Elements::DisplacementFiniteElement::sectionType
const SectionType sectionType
Definition: DisplacementFiniteElement.h:77
Marmot::Elements::DisplacementFiniteElement::elementProperties
Map< const VectorXd > elementProperties
Definition: DisplacementFiniteElement.h:75
MarmotElement::GeostaticStress
@ GeostaticStress
Definition: MarmotElement.h:42
Marmot::Elements::DisplacementFiniteElement::QuadraturePoint::B
BSized B
Definition: DisplacementFiniteElement.h:86
Marmot::Elements::DisplacementFiniteElement::assignProperty
void assignProperty(const ElementProperties &marmotElementProperty)
Definition: DisplacementFiniteElement.h:279
ElementProperties
Definition: MarmotElementProperty.h:42
MarmotElement::MarmotMaterialStateVars
@ MarmotMaterialStateVars
Definition: MarmotElement.h:43
Marmot::Elements::DisplacementFiniteElement::UniaxialStress
@ UniaxialStress
Definition: DisplacementFiniteElement.h:56
Marmot::FiniteElement::Spatial1D::Bar2::dNdXiSized
Eigen::Matrix< double, 1, nNodes > dNdXiSized
Definition: MarmotFiniteElement.h:94
Marmot::Elements::DisplacementFiniteElement::initializeYourself
void initializeYourself()
Definition: DisplacementFiniteElement.h:316
Marmot::Elements::DisplacementFiniteElement::getCoordinatesAtCenter
std::vector< double > getCoordinatesAtCenter()
Definition: DisplacementFiniteElement.h:511
MarmotElement::MarmotMaterialInitialization
@ MarmotMaterialInitialization
Definition: MarmotElement.h:44
MarmotElement
Definition: MarmotElement.h:34
MarmotGeometryElement
Definition: MarmotGeometryElement.h:36
MarmotJournal.h
Marmot::Elements::DisplacementFiniteElement::getNDofPerElement
int getNDofPerElement()
Definition: DisplacementFiniteElement.h:152
MarmotTypedefs.h
MarmotMath.h
Marmot::Matrix6d
Eigen::Matrix< double, 6, 6 > Matrix6d
Definition: MarmotTypedefs.h:35
MarmotVoigt.h
Marmot::Elements::DisplacementFiniteElement::KeSizedMatrix
Matrix< double, sizeLoadVector, sizeLoadVector > KeSizedMatrix
Definition: DisplacementFiniteElement.h:71
Marmot::Elements::DisplacementFiniteElement::setInitialConditions
void setInitialConditions(StateTypes state, const double *values)
Definition: DisplacementFiniteElement.h:415
Marmot::FiniteElement::BoundaryElement::assembleIntoParentVectorial
void assembleIntoParentVectorial(const Eigen::VectorXd &boundaryVector, Eigen::Ref< Eigen::VectorXd > ParentVector)
Definition: MarmotFiniteElementBoundary.cpp:274
Marmot::FiniteElement::BoundaryElement
Definition: MarmotFiniteElement.h:297
Marmot::Elements::DisplacementFiniteElement
Definition: DisplacementFiniteElement.h:52
Marmot::Elements::DisplacementFiniteElement::QuadraturePoint::material
std::unique_ptr< MarmotMaterialHypoElastic > material
Definition: DisplacementFiniteElement.h:113
Marmot::Elements::DisplacementFiniteElement::getNumberOfQuadraturePoints
int getNumberOfQuadraturePoints()
Definition: DisplacementFiniteElement.h:538
Marmot::FiniteElement::Spatial2D::nDim
constexpr int nDim
Definition: MarmotFiniteElement.h:112
Marmot::Elements::DisplacementFiniteElement::assignStateVars
void assignStateVars(double *stateVars, int nStateVars)
Definition: DisplacementFiniteElement.h:267
Marmot::Elements::DisplacementFiniteElement::PlaneStrain
@ PlaneStrain
Definition: DisplacementFiniteElement.h:58
MarmotElementProperty.h
Marmot::Elements::DisplacementFiniteElement::QuadraturePoint::assignStateVars
void assignStateVars(double *stateVars, int nStateVars)
Definition: DisplacementFiniteElement.h:125
MarmotGeometryElement::BSized
Eigen::Matrix< double, voigtSize, nNodes *nDim > BSized
Definition: MarmotGeometryElement.h:59
MarmotMaterialSection::nMaterialProperties
int nMaterialProperties
Definition: MarmotElementProperty.h:34
MarmotStateVarVectorManager
A convenience auxiliary class for managing multiple statevars with arbitrary length in a single conse...
Definition: MarmotStateVarVectorManager.h:37
Marmot::Elements::DisplacementFiniteElement::QuadraturePoint::getNumberOfRequiredStateVarsQuadraturePointOnly
int getNumberOfRequiredStateVarsQuadraturePointOnly()
Definition: DisplacementFiniteElement.h:115
MarmotStateVarVectorManager.h
MarmotElement::DistributedLoadTypes
DistributedLoadTypes
Definition: MarmotElement.h:47
MarmotFiniteElement.h
Marmot::mVector6d
Eigen::Map< Vector6d > mVector6d
Definition: MarmotTypedefs.h:49
MarmotGeometryElement::XiSized
Eigen::Matrix< double, nDim, 1 > XiSized
Definition: MarmotGeometryElement.h:53
MarmotElement::SurfaceTraction
@ SurfaceTraction
Definition: MarmotElement.h:50
Marmot::FiniteElement::BoundaryElement::computeVectorialLoadVector
Eigen::VectorXd computeVectorialLoadVector(const Eigen::VectorXd &direction)
compute the element load vector for a unit vectorial load in a given direction.
Definition: MarmotFiniteElementBoundary.cpp:206
Marmot::Math::linearInterpolation
double linearInterpolation(double x, double x0, double x1, double y0, double y1)
Definition: MarmotMath.cpp:7
MarmotLibrary::MarmotMaterialFactory::createMaterial
static MarmotMaterial * createMaterial(int materialCode, const double *materialProperties, int nMaterialProperties, int materialNumber)
ElementProperties::elementProperties
const double * elementProperties
Definition: MarmotElementProperty.h:44
MarmotGeometryElement.h
StateView
Definition: MarmotUtils.h:29
Marmot::Elements::DisplacementFiniteElement::SectionType
SectionType
Definition: DisplacementFiniteElement.h:55
Marmot::Elements::DisplacementFiniteElement::computeDistributedLoad
void computeDistributedLoad(MarmotElement::DistributedLoadTypes loadType, double *P, double *K, const int elementFace, const double *load, const double *QTotal, const double *time, double dT)
Definition: DisplacementFiniteElement.h:449
Marmot::Elements::DisplacementFiniteElement::Solid
@ Solid
Definition: DisplacementFiniteElement.h:59
Marmot::ContinuumMechanics::PlaneStrain::getPlaneStrainTangent
Eigen::Matrix3d getPlaneStrainTangent(const Matrix6d &C)
Definition: MarmotLowerDimensionalStress.cpp:37
Marmot::Elements::DisplacementFiniteElement::getNumberOfRequiredStateVars
int getNumberOfRequiredStateVars()
Definition: DisplacementFiniteElement.h:235
Marmot::Elements
Definition: DisplacementFiniteElement.h:49
Marmot
This file includes functions needed for calculations with stress and strain tensors written in voigt ...
Definition: MarmotTesting.h:30
Marmot::Elements::DisplacementFiniteElement::elLabel
const int elLabel
Definition: DisplacementFiniteElement.h:76
Marmot::FiniteElement::BoundaryElement::computeSurfaceNormalVectorialLoadVector
Eigen::VectorXd computeSurfaceNormalVectorialLoadVector()
compute the element load vector for a unit vectorial load normal to the surface.
Definition: MarmotFiniteElementBoundary.cpp:147
Marmot::Elements::DisplacementFiniteElement::PlaneStress
@ PlaneStress
Definition: DisplacementFiniteElement.h:57
Marmot::FiniteElement::Spatial2D::B
Eigen::Matrix< double, voigtSize, nNodes *nDim > B(const Eigen::Matrix< double, nDim, nNodes > &dNdX)
Definition: MarmotFiniteElement.h:116
Marmot::Elements::DisplacementFiniteElement::QuadraturePoint::detJ
double detJ
Definition: DisplacementFiniteElement.h:84
Marmot::Elements::DisplacementFiniteElement::qps
std::vector< QuadraturePoint > qps
Definition: DisplacementFiniteElement.h:136
MarmotGeometryElement::dNdXiSized
Eigen::Matrix< double, nDim, nNodes > dNdXiSized
Definition: MarmotGeometryElement.h:58
MarmotElement::StateTypes
StateTypes
Definition: MarmotElement.h:37
Marmot::ContinuumMechanics::VoigtNotation::P
const Marmot::Vector6d P
Definition: MarmotVoigt.cpp:16
Marmot::Elements::DisplacementFiniteElement::QuadraturePoint::QPStateVarManager::stress
mVector6d stress
Definition: DisplacementFiniteElement.h:97
Marmot::Elements::DisplacementFiniteElement::QuadraturePoint::J0xW
double J0xW
Definition: DisplacementFiniteElement.h:85
Marmot::Elements::DisplacementFiniteElement::Voigt
Matrix< double, ParentGeometryElement::voigtSize, 1 > Voigt
Definition: DisplacementFiniteElement.h:73
Marmot::Elements::DisplacementFiniteElement::getNodeFields
std::vector< std::vector< std::string > > getNodeFields()
Definition: DisplacementFiniteElement.h:241
Marmot::FiniteElement::NB
Eigen::MatrixXd NB(const Eigen::VectorXd &N, const int nDoFPerNode)
MarmotMaterialSection::materialProperties
const double * materialProperties
Definition: MarmotElementProperty.h:33
Marmot::Elements::DisplacementFiniteElement::QuadraturePoint
Definition: DisplacementFiniteElement.h:79
Marmot::Elements::DisplacementFiniteElement::QuadraturePoint::QPStateVarManager::materialStateVars
Eigen::Map< Eigen::VectorXd > materialStateVars
Definition: DisplacementFiniteElement.h:99
Marmot::Elements::DisplacementFiniteElement::QuadraturePoint::xi
const XiSized xi
Definition: DisplacementFiniteElement.h:81
MarmotElement.h
Marmot::FiniteElement::Spatial1D::Bar2::nNodes
constexpr int nNodes
Definition: MarmotFiniteElement.h:92
Marmot::Vector6d
Eigen::Matrix< double, 6, 1 > Vector6d
Definition: MarmotTypedefs.h:43
Marmot::FiniteElement::Quadrature::getGaussPointInfo
const std::vector< QuadraturePointInfo > & getGaussPointInfo(Marmot::FiniteElement::ElementShapes shape, IntegrationTypes integrationType)
Definition: MarmotFiniteElementBasic.cpp:100
MarmotGeometryElement::shape
const Marmot::FiniteElement::ElementShapes shape
Definition: MarmotGeometryElement.h:63
ElementProperties::nElementProperties
int nElementProperties
Definition: MarmotElementProperty.h:45
Marmot::FiniteElement::Spatial1D::Bar2::dNdXi
dNdXiSized dNdXi(double xi)
Definition: MarmotFiniteElement1D.cpp:22
Marmot::Elements::DisplacementFiniteElement::QuadraturePoint::getNumberOfRequiredStateVars
int getNumberOfRequiredStateVars()
Definition: DisplacementFiniteElement.h:120
Marmot.h
Marmot::Elements::DisplacementFiniteElement::getCoordinatesAtQuadraturePoints
std::vector< std::vector< double > > getCoordinatesAtQuadraturePoints()
Definition: DisplacementFiniteElement.h:522
Marmot::ContinuumMechanics::VoigtNotation::planeVoigtToVoigt
Marmot::Vector6d planeVoigtToVoigt(const Eigen::Vector3d &voigtPlane)
Marmot::FiniteElement::Quadrature::IntegrationTypes
IntegrationTypes
Definition: MarmotFiniteElement.h:358
Marmot::Elements::DisplacementFiniteElement::getNSpatialDimensions
int getNSpatialDimensions()
Definition: DisplacementFiniteElement.h:150
Marmot::Elements::DisplacementFiniteElement::QuadraturePoint::QPStateVarManager::QPStateVarManager
QPStateVarManager(double *theStateVarVector, int nStateVars)
Definition: DisplacementFiniteElement.h:103
Marmot::Elements::DisplacementFiniteElement::QuadraturePoint::managedStateVars
std::unique_ptr< QPStateVarManager > managedStateVars
Definition: DisplacementFiniteElement.h:111
Marmot::Elements::DisplacementFiniteElement::QuadraturePoint::weight
const double weight
Definition: DisplacementFiniteElement.h:82
Marmot::Elements::DisplacementFiniteElement::getNNodes
int getNNodes()
Definition: DisplacementFiniteElement.h:148
MarmotMaterialSection::materialCode
int materialCode
Definition: MarmotElementProperty.h:32
Marmot::Elements::DisplacementFiniteElement::QuadraturePoint::QPStateVarManager::getNumberOfRequiredStateVarsQuadraturePointOnly
static int getNumberOfRequiredStateVarsQuadraturePointOnly()
Definition: DisplacementFiniteElement.h:101
MarmotMaterialSection
Definition: MarmotElementProperty.h:30
Marmot::Elements::DisplacementFiniteElement::QuadraturePoint::QuadraturePoint
QuadraturePoint(XiSized xi, double weight)
Definition: DisplacementFiniteElement.h:132
MarmotElement::Pressure
@ Pressure
Definition: MarmotElement.h:48
MarmotLowerDimensionalStress.h
Marmot::FiniteElement::Jacobian
Eigen::MatrixXd Jacobian(const Eigen::MatrixXd &dN_dXi, const Eigen::VectorXd &coordinates)
Marmot::Elements::DisplacementFiniteElement::computeBodyForce
void computeBodyForce(double *P, double *K, const double *load, const double *QTotal, const double *time, double dT)
Definition: DisplacementFiniteElement.h:496
Marmot::FiniteElement::Spatial1D::Bar2::N
NSized N(double xi)
Definition: MarmotFiniteElement1D.cpp:15
Marmot::Elements::DisplacementFiniteElement::QuadraturePoint::QPStateVarManager
Definition: DisplacementFiniteElement.h:88
MarmotGeometryElement::JacobianSized
Eigen::Matrix< double, nDim, nDim > JacobianSized
Definition: MarmotGeometryElement.h:55
Marmot::Elements::DisplacementFiniteElement::computeYourself
void computeYourself(const double *QTotal, const double *dQ, double *Pe, double *Ke, const double *time, double dT, double &pNewdT)
Definition: DisplacementFiniteElement.h:341
Marmot::Elements::DisplacementFiniteElement::QuadraturePoint::QPStateVarManager::strain
mVector6d strain
Definition: DisplacementFiniteElement.h:98
Marmot::Elements::DisplacementFiniteElement::getDofIndicesPermutationPattern
std::vector< int > getDofIndicesPermutationPattern()
Definition: DisplacementFiniteElement.h:256
Marmot::Elements::DisplacementFiniteElement::RhsSized
Matrix< double, sizeLoadVector, 1 > RhsSized
Definition: DisplacementFiniteElement.h:70
Marmot::Elements::DisplacementFiniteElement::CSized
Matrix< double, ParentGeometryElement::voigtSize, ParentGeometryElement::voigtSize > CSized
Definition: DisplacementFiniteElement.h:72
Marmot::Elements::DisplacementFiniteElement::getElementShape
std::string getElementShape()
Definition: DisplacementFiniteElement.h:154
Marmot::Elements::DisplacementFiniteElement::getStateView
StateView getStateView(const std::string &stateName, int qpNumber)
Definition: DisplacementFiniteElement.h:192
MarmotMaterialHypoElastic
Definition: MarmotMaterialHypoElastic.h:54
Marmot::Elements::DisplacementFiniteElement::assignNodeCoordinates
void assignNodeCoordinates(const double *coordinates)
Definition: DisplacementFiniteElement.h:310
MakeString
Definition: MarmotJournal.h:32