MarmotFiniteElementSpatialWrapper.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  *
16  * This file is part of the MAteRialMOdellingToolbox (marmot).
17  *
18  * This library is free software; you can redistribute it and/or
19  * modify it under the terms of the GNU Lesser General Public
20  * License as published by the Free Software Foundation; either
21  * version 2.1 of the License, or (at your option) any later version.
22  *
23  * The full text of the license can be found in the file LICENSE.md at
24  * the top level directory of marmot.
25  * ---------------------------------------------------------------------
26  */
27 #pragma once
28 #include "Eigen/Sparse"
29 #include "Marmot/MarmotElement.h"
31 #include <functional>
32 #include <memory>
33 
35  /* Wrapper for Reduced Dimension Elements (e.g. Truss elements) to be used in higher order
36  * dimensions (2D, 3D). The Projected is computed automatically based on the provided node
37  * coordinates, and the actual (child) element is created through a provided generator functor
38  * (e.g, function pointer)
39  * */
40 
41 public:
42  const int nDim;
43  const int nDimChild;
44  const int nNodes;
45  const int nRhsChild;
46  const Eigen::Map< const Eigen::VectorXi > rhsIndicesToBeProjected;
48 
49  std::unique_ptr< MarmotElement > childElement;
50  Eigen::MatrixXd T;
51  Eigen::MatrixXd P;
52  Eigen::MatrixXd projectedCoordinates;
53 
55  int nChildDim,
56  int nNodes,
57  int sizeRhsChild,
58  const int rhsIndicesToBeWrapped_[],
59  int nRhsIndicesToBeWrapped,
60  std::unique_ptr< MarmotElement > childElement );
61 
63 
64  std::vector< std::vector< std::string > > getNodeFields();
65 
66  std::vector< int > getDofIndicesPermutationPattern();
67 
68  int getNNodes();
69 
71 
72  int getNDofPerElement();
73 
74  std::string getElementShape();
75 
76  void assignStateVars( double* stateVars, int nStateVars );
77 
78  void assignProperty( const ElementProperties& property );
79 
80  void assignProperty( const MarmotMaterialSection& property );
81 
82  void assignNodeCoordinates( const double* coordinates );
83 
84  void initializeYourself();
85 
86  void computeYourself( const double* QTotal,
87  const double* dQ,
88  double* Pe,
89  double* Ke,
90  const double* time,
91  double dT,
92  double& pNewdT );
93 
94  void setInitialConditions( StateTypes state, const double* values );
95 
97  double* P,
98  double* K,
99  int elementFace,
100  const double* load,
101  const double* QTotal,
102  const double* time,
103  double dT );
104 
105  void computeBodyForce( double* P,
106  double* K,
107  const double* load,
108  const double* QTotal,
109  const double* time,
110  double dT );
111 
112  StateView getStateView( const std::string& stateName, int quadraturePoint );
113 
114  std::vector< double > getCoordinatesAtCenter();
115 
116  std::vector< std::vector< double > > getCoordinatesAtQuadraturePoints();
117 
119 };
MarmotElementSpatialWrapper::assignProperty
void assignProperty(const ElementProperties &property)
Definition: MarmotFiniteElementSpatialWrapper.cpp:61
MarmotElementSpatialWrapper::assignStateVars
void assignStateVars(double *stateVars, int nStateVars)
Definition: MarmotFiniteElementSpatialWrapper.cpp:96
MarmotElementSpatialWrapper::MarmotElementSpatialWrapper
MarmotElementSpatialWrapper(int nDim, int nChildDim, int nNodes, int sizeRhsChild, const int rhsIndicesToBeWrapped_[], int nRhsIndicesToBeWrapped, std::unique_ptr< MarmotElement > childElement)
Definition: MarmotFiniteElementSpatialWrapper.cpp:7
MarmotElementSpatialWrapper::getCoordinatesAtQuadraturePoints
std::vector< std::vector< double > > getCoordinatesAtQuadraturePoints()
Definition: MarmotFiniteElementSpatialWrapper.cpp:251
MarmotElementSpatialWrapper::nNodes
const int nNodes
Definition: MarmotFiniteElementSpatialWrapper.h:44
ElementProperties
Definition: MarmotElementProperty.h:42
MarmotElementSpatialWrapper::projectedSize
const int projectedSize
Definition: MarmotFiniteElementSpatialWrapper.h:47
MarmotElement
Definition: MarmotElement.h:34
MarmotElementSpatialWrapper::computeBodyForce
void computeBodyForce(double *P, double *K, const double *load, const double *QTotal, const double *time, double dT)
Definition: MarmotFiniteElementSpatialWrapper.cpp:209
MarmotElementSpatialWrapper::nDim
const int nDim
Definition: MarmotFiniteElementSpatialWrapper.h:42
MarmotElementSpatialWrapper::childElement
std::unique_ptr< MarmotElement > childElement
Definition: MarmotFiniteElementSpatialWrapper.h:49
MarmotElementSpatialWrapper::getNNodes
int getNNodes()
Definition: MarmotFiniteElementSpatialWrapper.cpp:36
MarmotElementSpatialWrapper::assignNodeCoordinates
void assignNodeCoordinates(const double *coordinates)
Definition: MarmotFiniteElementSpatialWrapper.cpp:106
MarmotElementSpatialWrapper::computeYourself
void computeYourself(const double *QTotal, const double *dQ, double *Pe, double *Ke, const double *time, double dT, double &pNewdT)
Definition: MarmotFiniteElementSpatialWrapper.cpp:147
MarmotElementSpatialWrapper::getNDofPerElement
int getNDofPerElement()
Definition: MarmotFiniteElementSpatialWrapper.cpp:46
MarmotElementSpatialWrapper::setInitialConditions
void setInitialConditions(StateTypes state, const double *values)
Definition: MarmotFiniteElementSpatialWrapper.cpp:182
MarmotElementProperty.h
MarmotElementSpatialWrapper::initializeYourself
void initializeYourself()
Definition: MarmotFiniteElementSpatialWrapper.cpp:101
MarmotElement::DistributedLoadTypes
DistributedLoadTypes
Definition: MarmotElement.h:47
MarmotElementSpatialWrapper::nDimChild
const int nDimChild
Definition: MarmotFiniteElementSpatialWrapper.h:43
MarmotElementSpatialWrapper::unprojectedSize
const int unprojectedSize
Definition: MarmotFiniteElementSpatialWrapper.h:47
StateView
Definition: MarmotUtils.h:29
MarmotElementSpatialWrapper
Definition: MarmotFiniteElementSpatialWrapper.h:34
MarmotElement::StateTypes
StateTypes
Definition: MarmotElement.h:37
MarmotElementSpatialWrapper::T
Eigen::MatrixXd T
Definition: MarmotFiniteElementSpatialWrapper.h:50
MarmotElementSpatialWrapper::getStateView
StateView getStateView(const std::string &stateName, int quadraturePoint)
Definition: MarmotFiniteElementSpatialWrapper.cpp:228
MarmotElementSpatialWrapper::getNodeFields
std::vector< std::vector< std::string > > getNodeFields()
Definition: MarmotFiniteElementSpatialWrapper.cpp:31
MarmotElement.h
MarmotElementSpatialWrapper::rhsIndicesToBeProjected
const Eigen::Map< const Eigen::VectorXi > rhsIndicesToBeProjected
Definition: MarmotFiniteElementSpatialWrapper.h:46
MarmotElementSpatialWrapper::nRhsChild
const int nRhsChild
Definition: MarmotFiniteElementSpatialWrapper.h:45
MarmotElementSpatialWrapper::getDofIndicesPermutationPattern
std::vector< int > getDofIndicesPermutationPattern()
Definition: MarmotFiniteElementSpatialWrapper.cpp:66
MarmotElementSpatialWrapper::getNSpatialDimensions
int getNSpatialDimensions()
Definition: MarmotFiniteElementSpatialWrapper.cpp:41
MarmotElementSpatialWrapper::getNumberOfQuadraturePoints
int getNumberOfQuadraturePoints()
Definition: MarmotFiniteElementSpatialWrapper.cpp:270
MarmotElementSpatialWrapper::getNumberOfRequiredStateVars
int getNumberOfRequiredStateVars()
Definition: MarmotFiniteElementSpatialWrapper.cpp:26
MarmotElementSpatialWrapper::getCoordinatesAtCenter
std::vector< double > getCoordinatesAtCenter()
Definition: MarmotFiniteElementSpatialWrapper.cpp:237
MarmotElementSpatialWrapper::computeDistributedLoad
void computeDistributedLoad(DistributedLoadTypes loadType, double *P, double *K, int elementFace, const double *load, const double *QTotal, const double *time, double dT)
Definition: MarmotFiniteElementSpatialWrapper.cpp:187
MarmotMaterialSection
Definition: MarmotElementProperty.h:30
MarmotElementSpatialWrapper::getElementShape
std::string getElementShape()
Definition: MarmotFiniteElementSpatialWrapper.cpp:51
MarmotElementSpatialWrapper::P
Eigen::MatrixXd P
Definition: MarmotFiniteElementSpatialWrapper.h:51
MarmotElementSpatialWrapper::projectedCoordinates
Eigen::MatrixXd projectedCoordinates
Definition: MarmotFiniteElementSpatialWrapper.h:52