-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSHELL_CROSS_SECTION_H_master.txt.bak
1345 lines (1127 loc) · 43 KB
/
SHELL_CROSS_SECTION_H_master.txt.bak
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// KRATOS ___| | | |
// \___ \ __| __| | | __| __| | | __| _` | |
// | | | | | ( | | | | ( | |
// _____/ \__|_| \__,_|\___|\__|\__,_|_| \__,_|_| MECHANICS
//
// License: BSD License
// license: structural_mechanics_application/license.txt
//
// Main authors: Massimo Petracca
//
#if !defined(SHELL_CROSS_SECTION_H_INCLUDED)
#define SHELL_CROSS_SECTION_H_INCLUDED
// System includes
#include <string>
#include <iostream>
// Project includes
#include "includes/define.h"
#include "includes/serializer.h"
#include "includes/constitutive_law.h"
#include "properties_extensions.hpp"
#include "containers/flags.h"
namespace Kratos
{
/** \brief ShellCrossSection
*
* ShellCrossSection is the base class for all shell cross sections.
* This object is meant to be used by shell elements to obtain the material response
* in terms of generalized strains (membrane strains, shear strains, curvatures) and
* generalized stresses (stress resultants, stress couples) by numerical integration
* of several through-the-thickness constitutive laws.
*
* Homogeneous / Composite Section...
*
* Constitutive Law Adaptation...
*
* References...
*
*/
class ShellCrossSection : public Flags
{
public:
class Ply;
KRATOS_CLASS_POINTER_DEFINITION(ShellCrossSection);
typedef Geometry<Node < 3 > > GeometryType;
typedef std::vector< Ply > PlyCollection;
typedef std::size_t SizeType;
///@name Enums
///@{
/** SectionBehaviorType Enum
* Defines the supported behaviors of the cross section
*/
enum SectionBehaviorType
{
Thick, /**< Thick section (Mindlin-Reissner Plate Theory) */
Thin /**< Thin section (Kirchhoff-Love Plate Theory) */
};
///@}
///@name Classes
///@{
struct Features
{
Flags mOptions;
double mStrainSize;
double mSpaceDimension;
std::vector< ConstitutiveLaw::StrainMeasure > mStrainMeasures;
};
class Parameters
{
private:
Flags mOptions;
Vector* mpGeneralizedStrainVector;
Vector* mpGeneralizedStressVector;
Matrix* mpConstitutiveMatrix;
const Vector* mpShapeFunctionsValues;
const Matrix* mpShapeFunctionsDerivatives;
const ProcessInfo* mpCurrentProcessInfo;
const Properties* mpMaterialProperties;
const GeometryType* mpElementGeometry;
public:
Parameters()
: mpGeneralizedStrainVector(NULL)
, mpGeneralizedStressVector(NULL)
, mpConstitutiveMatrix(NULL)
, mpShapeFunctionsValues(NULL)
, mpShapeFunctionsDerivatives(NULL)
, mpCurrentProcessInfo(NULL)
, mpMaterialProperties(NULL)
, mpElementGeometry(NULL)
{}
Parameters (const GeometryType& rElementGeometry,
const Properties& rMaterialProperties,
const ProcessInfo& rCurrentProcessInfo)
: mpGeneralizedStrainVector(NULL)
, mpGeneralizedStressVector(NULL)
, mpConstitutiveMatrix(NULL)
, mpShapeFunctionsValues(NULL)
, mpShapeFunctionsDerivatives(NULL)
, mpCurrentProcessInfo(&rCurrentProcessInfo)
, mpMaterialProperties(&rMaterialProperties)
, mpElementGeometry(&rElementGeometry)
{}
Parameters (const Parameters & rNewParameters)
: mOptions(rNewParameters.mOptions)
, mpGeneralizedStrainVector(rNewParameters.mpGeneralizedStrainVector)
, mpGeneralizedStressVector(rNewParameters.mpGeneralizedStressVector)
, mpConstitutiveMatrix(rNewParameters.mpConstitutiveMatrix)
, mpShapeFunctionsValues(rNewParameters.mpShapeFunctionsValues)
, mpShapeFunctionsDerivatives(rNewParameters.mpShapeFunctionsDerivatives)
, mpCurrentProcessInfo(rNewParameters.mpCurrentProcessInfo)
, mpMaterialProperties(rNewParameters.mpMaterialProperties)
, mpElementGeometry(rNewParameters.mpElementGeometry)
{}
public:
/**
*Checks shape functions and shape function derivatives
*/
bool CheckShapeFunctions ()
{
if(!mpShapeFunctionsValues)
KRATOS_THROW_ERROR(std::invalid_argument,"ShapeFunctionsValues NOT SET","");
if(!mpShapeFunctionsDerivatives)
KRATOS_THROW_ERROR(std::invalid_argument,"ShapeFunctionsDerivatives NOT SET","");
return 1;
}
/**
*Checks currentprocessinfo, material properties and geometry
*/
bool CheckInfoMaterialGeometry ()
{
if(!mpCurrentProcessInfo)
KRATOS_THROW_ERROR(std::invalid_argument,"CurrentProcessInfo NOT SET","");
if(!mpMaterialProperties)
KRATOS_THROW_ERROR(std::invalid_argument,"MaterialProperties NOT SET","");
if(!mpElementGeometry)
KRATOS_THROW_ERROR(std::invalid_argument,"ElementGeometry NOT SET","");
return 1;
}
/**
*Check deformation gradient, strains ans stresses assigned
*/
bool CheckMechanicalVariables ()
{
if(!mpGeneralizedStrainVector)
KRATOS_THROW_ERROR(std::invalid_argument,"GenralizedStrainVector NOT SET","");
if(!mpGeneralizedStressVector)
KRATOS_THROW_ERROR(std::invalid_argument,"GenralizedStressVector NOT SET","");
if(!mpConstitutiveMatrix)
KRATOS_THROW_ERROR(std::invalid_argument,"ConstitutiveMatrix NOT SET","");
return 1;
}
/**
* Public Methods to access variables of the struct class
*/
/**
* sets the variable or the pointer of a specified variable: assigns the direction of the pointer for the mpvariables, only non const values can be modified
*/
void Set (Flags ThisFlag)
{
mOptions.Set(ThisFlag);
};
void Reset (Flags ThisFlag)
{
mOptions.Reset(ThisFlag);
};
void SetOptions (const Flags& rOptions)
{
mOptions=rOptions;
};
void SetGeneralizedStrainVector (Vector& rGeneralizedStrainVector)
{
mpGeneralizedStrainVector=&rGeneralizedStrainVector;
};
void SetGeneralizedStressVector (Vector& rGeneralizedStressVector)
{
mpGeneralizedStressVector=&rGeneralizedStressVector;
};
void SetConstitutiveMatrix (Matrix& rConstitutiveMatrix)
{
mpConstitutiveMatrix =&rConstitutiveMatrix;
};
void SetShapeFunctionsValues (const Vector& rShapeFunctionsValues)
{
mpShapeFunctionsValues=&rShapeFunctionsValues;
};
void SetShapeFunctionsDerivatives (const Matrix& rShapeFunctionsDerivatives)
{
mpShapeFunctionsDerivatives=&rShapeFunctionsDerivatives;
};
void SetProcessInfo (const ProcessInfo& rProcessInfo)
{
mpCurrentProcessInfo =&rProcessInfo;
};
void SetMaterialProperties (const Properties& rMaterialProperties)
{
mpMaterialProperties =&rMaterialProperties;
};
void SetElementGeometry (const GeometryType& rElementGeometry)
{
mpElementGeometry =&rElementGeometry;
};
/**
* returns the reference or the value of a specified variable: returns the value of the parameter, only non const values can be modified
*/
Flags& GetOptions ()
{
return mOptions;
};
Vector& GetGeneralizedStrainVector ()
{
return *mpGeneralizedStrainVector;
};
Vector& GetGeneralizedStressVector ()
{
return *mpGeneralizedStressVector;
};
Matrix& GetConstitutiveMatrix ()
{
return *mpConstitutiveMatrix;
};
const Vector& GetShapeFunctionsValues ()
{
return *mpShapeFunctionsValues;
};
const Matrix& GetShapeFunctionsDerivatives ()
{
return *mpShapeFunctionsDerivatives;
};
const ProcessInfo& GetProcessInfo ()
{
return *mpCurrentProcessInfo;
};
const Properties& GetMaterialProperties ()
{
return *mpMaterialProperties;
};
const GeometryType& GetElementGeometry ()
{
return *mpElementGeometry;
};
};
class IntegrationPoint
{
private:
double mWeight;
double mLocation;
ConstitutiveLaw::Pointer mConstitutiveLaw;
public:
IntegrationPoint()
: mWeight(0.0)
, mLocation(0.0)
, mConstitutiveLaw(ConstitutiveLaw::Pointer())
{}
IntegrationPoint(double location, double weight, const ConstitutiveLaw::Pointer pMaterial)
: mWeight(weight)
, mLocation(location)
, mConstitutiveLaw(pMaterial)
{}
IntegrationPoint(const IntegrationPoint& other)
: mWeight(other.mWeight)
, mLocation(other.mLocation)
, mConstitutiveLaw(other.mConstitutiveLaw != NULL ? other.mConstitutiveLaw->Clone() : ConstitutiveLaw::Pointer())
{}
IntegrationPoint & operator = (const IntegrationPoint & other)
{
if(this != &other)
{
mWeight = other.mWeight;
mLocation = other.mLocation;
mConstitutiveLaw = other.mConstitutiveLaw != NULL ? other.mConstitutiveLaw->Clone() : ConstitutiveLaw::Pointer();
}
return *this;
}
public:
inline double GetWeight()const
{
return mWeight;
}
inline void SetWeight(double w)
{
mWeight = w;
}
inline double GetLocation()const
{
return mLocation;
}
inline void SetLocation(double l)
{
mLocation = l;
}
inline const ConstitutiveLaw::Pointer& GetConstitutiveLaw()const
{
return mConstitutiveLaw;
}
inline void SetConstitutiveLaw(const ConstitutiveLaw::Pointer& pLaw)
{
mConstitutiveLaw = pLaw;
}
private:
friend class Serializer;
virtual void save(Serializer& rSerializer) const
{
rSerializer.save("W", mWeight);
rSerializer.save("L", mLocation);
rSerializer.save("CLaw", mConstitutiveLaw);
}
virtual void load(Serializer& rSerializer)
{
rSerializer.load("W", mWeight);
rSerializer.load("L", mLocation);
rSerializer.load("CLaw", mConstitutiveLaw);
}
};
class Ply
{
public:
typedef std::vector< IntegrationPoint > IntegrationPointCollection;
private:
double mThickness;
double mLocation;
double mOrientationAngle;
IntegrationPointCollection mIntegrationPoints;
Properties::Pointer mpProperties;
public:
Ply()
: mThickness(0.0)
, mLocation(0.0)
, mOrientationAngle(0.0)
, mIntegrationPoints()
, mpProperties(Properties::Pointer())
{}
Ply(double thickness, double location, double orientationAngle, int numPoints, const Properties::Pointer & pProperties)
: mThickness(thickness)
, mLocation(location)
, mIntegrationPoints()
, mpProperties(pProperties)
{
this->SetOrientationAngle(orientationAngle);
this->SetUpIntegrationPoints(numPoints);
}
Ply(const Ply& other)
: mThickness(other.mThickness)
, mLocation(other.mLocation)
, mOrientationAngle(other.mOrientationAngle)
, mIntegrationPoints(other.mIntegrationPoints)
, mpProperties(other.mpProperties)
{}
Ply & operator = (const Ply & other)
{
if(this != &other)
{
mThickness = other.mThickness;
mLocation = other.mLocation;
mOrientationAngle = other.mOrientationAngle;
mIntegrationPoints = other.mIntegrationPoints;
mpProperties = other.mpProperties;
}
return *this;
}
public:
inline double GetThickness()const
{
return mThickness;
}
inline void SetThickness(double thickness)
{
mThickness = thickness;
}
inline double GetLocation()const
{
return mLocation;
}
inline void SetLocation(double location)
{
if(location != mLocation)
{
for(IntegrationPointCollection::iterator it = mIntegrationPoints.begin(); it != mIntegrationPoints.end(); ++it)
(*it).SetLocation((*it).GetLocation() + location - mLocation); // remove the last location and add the new one (this avoids to re-setup the integration points.
mLocation = location; // update the current location
}
}
inline double GetOrientationAngle()const
{
return mOrientationAngle;
}
inline void SetOrientationAngle(double degrees)
{
mOrientationAngle = std::fmod(degrees, 360.0);
if(mOrientationAngle < 0.0)
mOrientationAngle += 360.0;
}
inline const IntegrationPointCollection& GetIntegrationPoints()const
{
return mIntegrationPoints;
}
inline IntegrationPointCollection& GetIntegrationPoints()
{
return mIntegrationPoints;
}
inline const Properties::Pointer & GetPropertiesPointer()const
{
return mpProperties;
}
inline const Properties & GetProperties()const
{
return *mpProperties;
}
inline double CalculateMassPerUnitArea()const
{
return mpProperties->GetValue(DENSITY) * mThickness;
}
inline IntegrationPointCollection::size_type NumberOfIntegrationPoints()const
{
return mIntegrationPoints.size();
}
inline void SetConstitutiveLawAt(IntegrationPointCollection::size_type integrationPointID, const ConstitutiveLaw::Pointer& pNewConstitutiveLaw)
{
if(integrationPointID < mIntegrationPoints.size())
mIntegrationPoints[integrationPointID].SetConstitutiveLaw(pNewConstitutiveLaw);
}
private:
void SetUpIntegrationPoints(int n)
{
KRATOS_TRY
const ConstitutiveLaw::Pointer & pMaterial = GetProperties()[CONSTITUTIVE_LAW];
if(pMaterial == NULL)
KRATOS_THROW_ERROR(std::logic_error, "A Ply needs a constitutive law to be set. Missing constitutive law in property : ", GetProperties().Id());
// make sure the number is greater than 0 and odd
if(n < 0) n = -n;
if(n == 0) n = 5;
if(n % 2 == 0) n += 1;
// generate the weights (composite simpson rule)
Vector ip_w(n, 1.0);
if(n >= 3)
{
for(int i = 1; i < n-1; i++)
{
double iw = (i % 2 == 0) ? 2.0 : 4.0;
ip_w(i) = iw;
}
ip_w /= sum( ip_w );
}
// generate locations (direction: top(+thickness/2) to bottom(-thickness/2)
Vector ip_loc(n, 0.0);
if(n >= 3)
{
double loc_start = mLocation + 0.5 * mThickness;
double loc_incr = mThickness / double(n-1);
for(int i = 0; i < n; i++)
{
ip_loc(i) = loc_start;
loc_start -= loc_incr;
}
}
// generate the integration points
mIntegrationPoints.clear();
mIntegrationPoints.resize(n);
for(int i = 0; i < n; i++)
{
IntegrationPoint& intp = mIntegrationPoints[i];
intp.SetWeight(ip_w(i) * mThickness);
intp.SetLocation(ip_loc(i));
intp.SetConstitutiveLaw(pMaterial->Clone());
}
KRATOS_CATCH("")
}
private:
friend class Serializer;
virtual void save(Serializer& rSerializer) const
{
rSerializer.save("T", mThickness);
rSerializer.save("L", mLocation);
rSerializer.save("O", mOrientationAngle);
rSerializer.save("IntP", mIntegrationPoints);
rSerializer.save("Prop", mpProperties);
}
virtual void load(Serializer& rSerializer)
{
rSerializer.load("T", mThickness);
rSerializer.load("L", mLocation);
rSerializer.load("O", mOrientationAngle);
rSerializer.load("IntP", mIntegrationPoints);
rSerializer.load("Prop", mpProperties);
}
};
protected:
struct GeneralVariables
{
double DeterminantF;
double DeterminantF0;
Vector StrainVector_2D;
Vector StressVector_2D;
Matrix ConstitutiveMatrix_2D;
Matrix DeformationGradientF_2D;
Matrix DeformationGradientF0_2D;
Vector StrainVector_3D;
Vector StressVector_3D;
Matrix ConstitutiveMatrix_3D;
Matrix DeformationGradientF_3D;
Matrix DeformationGradientF0_3D;
double GYZ;
double GXZ;
Matrix H;
Matrix L;
Matrix LT;
Vector CondensedStressVector;
};
///@}
public:
///@name Life Cycle
///@{
/**
* Default constructor
*/
ShellCrossSection();
/**
* Copy constructor
* @param other the other cross section
*/
ShellCrossSection(const ShellCrossSection & other);
/**
* Destructor
*/
~ShellCrossSection() override;
///@}
///@name Operators
///@{
/**
* Assignment operator
* @param other the other cross section
*/
ShellCrossSection & operator = (const ShellCrossSection & other);
///@}
///@name Public Methods
///@{
/**
* Initializes the editing of the Composite Layup.
* After a call to this method, one or more calls to AddPly(...) can be done to create the stack.
* After the stack is properly set it is necessary to call EndStack() to finalize the stack editing.
*/
void BeginStack();
/**
* Adds a new Ply below the current one.
* After the stack is properly set it is necessary to call EndStack() to finalize the stack editing.
* @param thickness the thickness of the new ply.
* @param orientationAngle the angle (degrees) between the new ply and the cross section.
* @param numPoints the number of integration points. can be 1,3,5,7,9,... and so on.
For numPoints = 3, the Simpson rule is used.
For numPoints = odd number > 3, the composite Simpson rule is used.
* @param pProperties the pointer to the properties assigned to the new ply.
*/
void AddPly(double thickness, double orientationAngle, int numPoints, const Properties::Pointer & pProperties);
/**
* Finalizes the editing of the Composite Layup.
*/
void EndStack();
/**
* Returns the string containing a detailed description of this object.
* @return the string with informations
*/
virtual std::string GetInfo()const;
/**
* Clone function
* @return a pointer to a new instance of this cross section
*/
virtual ShellCrossSection::Pointer Clone()const;
/**
* returns whether this cross section has specified variable
* @param rThisVariable the variable to be checked for
* @return true if the variable is defined in the cross section
*/
virtual bool Has(const Variable<double>& rThisVariable);
/**
* returns whether this cross section has specified variable
* @param rThisVariable the variable to be checked for
* @return true if the variable is defined in the cross section
*/
virtual bool Has(const Variable<Vector>& rThisVariable);
/**
* returns whether this cross section has specified variable
* @param rThisVariable the variable to be checked for
* @return true if the variable is defined in the cross section
*/
virtual bool Has(const Variable<Matrix>& rThisVariable);
/**
* returns whether this cross section has specified variable
* @param rThisVariable the variable to be checked for
* @return true if the variable is defined in the cross section
* NOTE: fixed size array of 3 doubles (e.g. for 2D stresses, plastic strains, ...)
*/
virtual bool Has(const Variable<array_1d<double, 3 > >& rThisVariable);
/**
* returns whether this cross section has specified variable
* @param rThisVariable the variable to be checked for
* @return true if the variable is defined in the cross section
* NOTE: fixed size array of 6 doubles (e.g. for stresses, plastic strains, ...)
*/
virtual bool Has(const Variable<array_1d<double, 6 > >& rThisVariable);
/**
* returns the value of a specified variable
* @param rThisVariable the variable to be returned
* @param rValue a reference to the returned value
* @param rValue output: the value of the specified variable
*/
virtual double& GetValue(const Variable<double>& rThisVariable, double& rValue);
/**
* returns the value of a specified variable
* @param rThisVariable the variable to be returned
* @param rValue a reference to the returned value
* @return the value of the specified variable
*/
virtual Vector& GetValue(const Variable<Vector>& rThisVariable, Vector& rValue);
/**
* returns the value of a specified variable
* @param rThisVariable the variable to be returned
* @return the value of the specified variable
*/
virtual Matrix& GetValue(const Variable<Matrix>& rThisVariable, Matrix& rValue);
/**
* returns the value of a specified variable
* @param rThisVariable the variable to be returned
* @param rValue a reference to the returned value
* @return the value of the specified variable
*/
virtual array_1d<double, 3 > & GetValue(const Variable<array_1d<double, 3 > >& rVariable,
array_1d<double, 3 > & rValue);
/**
* returns the value of a specified variable
* @param rThisVariable the variable to be returned
* @param rValue a reference to the returned value
* @return the value of the specified variable
*/
virtual array_1d<double, 6 > & GetValue(const Variable<array_1d<double, 6 > >& rVariable,
array_1d<double, 6 > & rValue);
/**
* sets the value of a specified variable
* @param rVariable the variable to be returned
* @param rValue new value of the specified variable
* @param rCurrentProcessInfo the process info
*/
virtual void SetValue(const Variable<double>& rVariable,
const double& rValue,
const ProcessInfo& rCurrentProcessInfo);
/**
* sets the value of a specified variable
* @param rVariable the variable to be returned
* @param rValue new value of the specified variable
* @param rCurrentProcessInfo the process info
*/
virtual void SetValue(const Variable<Vector >& rVariable,
const Vector& rValue,
const ProcessInfo& rCurrentProcessInfo);
/**
* sets the value of a specified variable
* @param rVariable the variable to be returned
* @param rValue new value of the specified variable
* @param rCurrentProcessInfo the process info
*/
virtual void SetValue(const Variable<Matrix >& rVariable,
const Matrix& rValue,
const ProcessInfo& rCurrentProcessInfo);
/**
* sets the value of a specified variable
* @param rVariable the variable to be returned
* @param rValue new value of the specified variable
* @param rCurrentProcessInfo the process info
*/
virtual void SetValue(const Variable<array_1d<double, 3 > >& rVariable,
const array_1d<double, 3 > & rValue,
const ProcessInfo& rCurrentProcessInfo);
/**
* sets the value of a specified variable
* @param rVariable the variable to be returned
* @param rValue new value of the specified variable
* @param rCurrentProcessInfo the process info
*/
virtual void SetValue(const Variable<array_1d<double, 6 > >& rVariable,
const array_1d<double, 6 > & rValue,
const ProcessInfo& rCurrentProcessInfo);
/**
* Is called to check whether the provided material parameters in the Properties
* match the requirements of current constitutive model.
* @param rMaterialProperties the current Properties to be validated against.
* @return true, if parameters are correct; false, if parameters are insufficient / faulty
* NOTE: this has to be implemented by each constitutive model. Returns false in base class since
* no valid implementation is contained here.
*/
virtual bool ValidateInput(const Properties& rMaterialProperties);
/**
* This is to be called at the very beginning of the calculation
* (e.g. from InitializeElement) in order to initialize all relevant
* attributes of the cross section
* @param rMaterialProperties the Properties instance of the current element
* @param rElementGeometry the geometry of the current element
* @param rShapeFunctionsValues the shape functions values in the current integration point
*/
virtual void InitializeCrossSection(const Properties& rMaterialProperties,
const GeometryType& rElementGeometry,
const Vector& rShapeFunctionsValues);
/**
* to be called at the beginning of each solution step
* (e.g. from Element::InitializeSolutionStep)
* @param rMaterialProperties the Properties instance of the current element
* @param rElementGeometry the geometry of the current element
* @param rShapeFunctionsValues the shape functions values in the current integration point
* @param rCurrentProcessInfo the current ProcessInfo instance
*/
virtual void InitializeSolutionStep(const Properties& rMaterialProperties,
const GeometryType& rElementGeometry,
const Vector& rShapeFunctionsValues,
const ProcessInfo& rCurrentProcessInfo);
/**
* to be called at the end of each solution step
* (e.g. from Element::FinalizeSolutionStep)
* @param rMaterialProperties the Properties instance of the current element
* @param rElementGeometry the geometry of the current element
* @param rShapeFunctionsValues the shape functions values in the current integration point
* @param rCurrentProcessInfo the current ProcessInfo instance
*/
virtual void FinalizeSolutionStep(const Properties& rMaterialProperties,
const GeometryType& rElementGeometry,
const Vector& rShapeFunctionsValues,
const ProcessInfo& rCurrentProcessInfo);
/**
* to be called at the beginning of each step iteration
* (e.g. from Element::InitializeNonLinearIteration)
* @param rMaterialProperties the Properties instance of the current element
* @param rElementGeometry the geometry of the current element
* @param rShapeFunctionsValues the shape functions values in the current integration point
* @param rCurrentProcessInfo he current ProcessInfo instance
*/
virtual void InitializeNonLinearIteration(const Properties& rMaterialProperties,
const GeometryType& rElementGeometry,
const Vector& rShapeFunctionsValues,
const ProcessInfo& rCurrentProcessInfo);
/**
* to be called at the end of each step iteration
* (e.g. from Element::FinalizeNonLinearIteration)
* @param rMaterialProperties the Properties instance of the current element
* @param rElementGeometry the geometry of the current element
* @param rShapeFunctionsValues the shape functions values in the current integration point
* @param rCurrentProcessInfo the current ProcessInfo instance
*/
virtual void FinalizeNonLinearIteration(const Properties& rMaterialProperties,
const GeometryType& rElementGeometry,
const Vector& rShapeFunctionsValues,
const ProcessInfo& rCurrentProcessInfo);
/**
* Computes the section response in terms of generalized stresses and constitutive tensor
* @param rValues the parameters for the current calculation
* @param rStressMeasure the required stress measure
* @see Parameters
*/
virtual void CalculateSectionResponse(Parameters& rValues, const ConstitutiveLaw::StressMeasure& rStressMeasure);
/**
* Updates the section response, called by the element in FinalizeSolutionStep.
* @param rValues the parameters for the current calculation
* @param rStressMeasure the required stress measure
* @see Parameters
*/
virtual void FinalizeSectionResponse(Parameters& rValues, const ConstitutiveLaw::StressMeasure& rStressMeasure);
/**
* This can be used in order to reset all internal variables of the
* cross section (e.g. if a model should be reset to its reference state)
* @param rMaterialProperties the Properties instance of the current element
* @param rElementGeometry the geometry of the current element
* @param rShapeFunctionsValues the shape functions values in the current integration point
*/
virtual void ResetCrossSection(const Properties& rMaterialProperties,
const GeometryType& rElementGeometry,
const Vector& rShapeFunctionsValues);
/**
* This function is designed to be called once to perform all the checks needed
* on the input provided. Checks can be "expensive" as the function is designed
* to catch user's errors.
* @param rMaterialProperties
* @param rElementGeometry
* @param rCurrentProcessInfo
* @return
*/
virtual int Check(const Properties& rMaterialProperties,
const GeometryType& rElementGeometry,
const ProcessInfo& rCurrentProcessInfo);
/**
* Computes the transformations matrix for shell generalized strains, given an orientation angle in radians.
* @param radians the input angle in radians
* @param T the output transformation matrix
* @return
*/
inline void GetRotationMatrixForGeneralizedStrains(double radians, Matrix & T)
{
double c = std::cos(radians);
double s = std::sin(radians);
SizeType strain_size = GetStrainSize();
if(T.size1() != strain_size || T.size2() != strain_size)
T.resize(strain_size, strain_size, false);
noalias( T ) = ZeroMatrix(strain_size, strain_size);
T(0, 0) = c * c;
T(0, 1) = s * s;
T(0, 2) = - s * c;
T(1, 0) = s * s;
T(1, 1) = c * c;
T(1, 2) = s * c;
T(2, 0) = 2.0 * s * c;
T(2, 1) = - 2.0 * s * c;
T(2, 2) = c * c - s * s;
project( T, range(3, 6), range(3, 6) ) = project( T, range(0, 3), range(0, 3) );
if(strain_size == 8)
{
T(6, 6) = c;
T(6, 7) = s;
T(7, 6) = - s;
T(7, 7) = c;
}
}
/**
* Computes the transformations matrix for condensed strains, given an orientation angle in radians.
* @param radians the input angle in radians
* @param T the output transformation matrix
* @return
*/
inline void GetRotationMatrixForCondensedStrains(double radians, Matrix & T)
{
SizeType strain_size = GetCondensedStrainSize();
if(T.size1() != strain_size || T.size2() != strain_size)
T.resize(strain_size, strain_size, false);
noalias( T ) = ZeroMatrix(strain_size, strain_size);
T(0, 0) = 1.0; // condensed strain E.zz is always at index 0
if(strain_size == 3) // if section is thin the condensed strains are (in order): E.zz E.yz E.xz
{
double c = std::cos(radians);
double s = std::sin(radians);
T(1, 1) = c;
T(1, 2) = s;
T(2, 1) = - s;
T(2, 2) = c;
}
}
/**
* Computes the transformations matrix for shell generalized stresses, given an orientation angle in radians.
* @param radians the input angle in radians
* @param T the output transformation matrix
* @return
*/
inline void GetRotationMatrixForGeneralizedStresses(double radians, Matrix & T)