15 #if !defined(KRATOS_GID_GAUSS_POINT_CONTAINER_H_INCLUDED)
16 #define KRATOS_GID_GAUSS_POINT_CONTAINER_H_INCLUDED
26 #include "gidpost/source/gidpost.h"
32 #define tet10_a 0.108103018168070
33 #define tet10_b 0.445948490915965
34 #define tet10_c 0.816847572980459
56 GiD_ElementType gid_element_type,
57 int number_of_integration_points,
58 std::vector<int> index_container )
71 && pElemIt->GetGeometry().IntegrationPoints(
72 pElemIt->GetIntegrationMethod() ).size() ==
mSize )
85 pCondIt->GetGeometry().IntegrationPoints(pCondIt->GetIntegrationMethod()).size() ==
mSize )
97 const std::string& rFlagName,
99 const double SolutionTag
104 GiD_fBeginResult(ResultFile, (
char *)(rFlagName).c_str(), (
char *)(
"Kratos"), SolutionTag, GiD_Scalar, GiD_OnGaussPoints,
mGPTitle, NULL, 0, NULL );
107 const double double_flag =
static_cast<double>(it->Is(rFlag));
109 GiD_fWriteScalar( ResultFile, it->Id(), double_flag);
115 const double double_flag =
static_cast<double>(it->Is(rFlag));
117 GiD_fWriteScalar( ResultFile, it->Id(), double_flag );
121 GiD_fEndResult(ResultFile);
126 const double SolutionTag,
const unsigned int ValueIndex )
130 GiD_fBeginResult(ResultFile, (
char *)(rVariable.
Name()).c_str(), (
char *)(
"Kratos"), SolutionTag,
131 GiD_Scalar, GiD_OnGaussPoints,
mGPTitle, NULL, 0, NULL );
133 std::vector<bool> ValuesOnIntPoint(
mSize);
137 it->CalculateOnIntegrationPoints( rVariable, ValuesOnIntPoint,
141 GiD_fWriteScalar( ResultFile, it->Id(),
static_cast<double>(ValuesOnIntPoint[index]) );
150 it->CalculateOnIntegrationPoints( rVariable, ValuesOnIntPoint,
154 GiD_fWriteScalar( ResultFile, it->Id(),
static_cast<double>(ValuesOnIntPoint[index]) );
159 GiD_fEndResult(ResultFile);
164 const double SolutionTag,
const unsigned int ValueIndex )
168 GiD_fBeginResult(ResultFile, (
char *)(rVariable.
Name()).c_str(), (
char *)(
"Kratos"), SolutionTag,
169 GiD_Scalar, GiD_OnGaussPoints,
mGPTitle, NULL, 0, NULL );
170 std::vector<int> ValuesOnIntPoint(
mSize);
174 it->CalculateOnIntegrationPoints( rVariable, ValuesOnIntPoint,
178 GiD_fWriteScalar( ResultFile, it->Id(),
static_cast<double>(ValuesOnIntPoint[index]) );
186 it->CalculateOnIntegrationPoints( rVariable, ValuesOnIntPoint,
190 GiD_fWriteScalar( ResultFile, it->Id(),
static_cast<double>(ValuesOnIntPoint[index]) );
195 GiD_fEndResult(ResultFile);
200 const double SolutionTag,
const unsigned int ValueIndex = 0)
205 GiD_fBeginResult(ResultFile, (
char *)(rVariable.
Name()).c_str(), (
char *)(
"Kratos"), SolutionTag,
206 GiD_Scalar, GiD_OnGaussPoints,
mGPTitle, NULL, 0, NULL );
207 std::vector<double> ValuesOnIntPoint(
mSize);
211 it->CalculateOnIntegrationPoints( rVariable, ValuesOnIntPoint,
215 GiD_fWriteScalar( ResultFile, it->Id(), ValuesOnIntPoint[index] );
223 it->CalculateOnIntegrationPoints( rVariable, ValuesOnIntPoint,
227 GiD_fWriteScalar( ResultFile, it->Id(), ValuesOnIntPoint[index] );
232 GiD_fEndResult(ResultFile);
237 const double SolutionTag,
const unsigned int ValueIndex = 0)
241 GiD_fBeginResult( ResultFile, (
char *)(rVariable.Name()).c_str(), (
char *)(
"Kratos"), SolutionTag,
242 GiD_Vector, GiD_OnGaussPoints,
mGPTitle, NULL, 0, NULL );
243 std::vector<array_1d<double,3> > ValuesOnIntPoint(
mSize,
ZeroVector(3));
247 it->CalculateOnIntegrationPoints( rVariable, ValuesOnIntPoint,
251 if( ValuesOnIntPoint[0].size() == 3 )
252 GiD_fWriteVector( ResultFile, it->Id(), ValuesOnIntPoint[index][0],
253 ValuesOnIntPoint[index][1], ValuesOnIntPoint[index][2] );
261 it->CalculateOnIntegrationPoints( rVariable, ValuesOnIntPoint,
265 GiD_fWriteVector( ResultFile, it->Id(), ValuesOnIntPoint[index][0],
266 ValuesOnIntPoint[index][1], ValuesOnIntPoint[index][2] );
271 GiD_fEndResult(ResultFile);
276 const double SolutionTag,
const unsigned int ValueIndex = 0)
281 GiD_fBeginResult( ResultFile, (
char *)(rVariable.Name()).c_str(), (
char*)(
"Kratos"),
282 SolutionTag, GiD_Matrix, GiD_OnGaussPoints,
mGPTitle, NULL, 0, NULL );
283 std::vector<array_1d<double, 6> > ValuesOnIntPoint(
mSize);
288 it->CalculateOnIntegrationPoints( rVariable, ValuesOnIntPoint,
292 GiD_fWrite3DMatrix( ResultFile, it->Id(), ValuesOnIntPoint[index][0],
293 ValuesOnIntPoint[index][1], ValuesOnIntPoint[index][2],
294 ValuesOnIntPoint[index][3], ValuesOnIntPoint[index][4],
295 ValuesOnIntPoint[index][5] );
303 it->CalculateOnIntegrationPoints( rVariable, ValuesOnIntPoint,
307 GiD_fWrite3DMatrix( ResultFile, it->Id(), ValuesOnIntPoint[index][0],
308 ValuesOnIntPoint[index][1], ValuesOnIntPoint[index][2],
309 ValuesOnIntPoint[index][3], ValuesOnIntPoint[index][4],
310 ValuesOnIntPoint[index][5] );
315 GiD_fEndResult(ResultFile);
321 const double SolutionTag,
const unsigned int ValueIndex = 0)
326 GiD_fBeginResult( ResultFile, (
char *)(rVariable.
Name()).c_str(), (
char *)(
"Kratos"), SolutionTag,
327 GiD_Matrix, GiD_OnGaussPoints,
mGPTitle, NULL, 0, NULL );
329 std::vector<Vector> ValuesOnIntPoint(
mSize);
333 it->CalculateOnIntegrationPoints( rVariable, ValuesOnIntPoint,
337 const auto&
values = ValuesOnIntPoint[index];
340 else if (
values.size() == 6 )
350 it->CalculateOnIntegrationPoints( rVariable, ValuesOnIntPoint,
354 const auto&
values = ValuesOnIntPoint[index];
357 else if (
values.size() == 6 )
364 GiD_fEndResult(ResultFile);
369 const double SolutionTag,
const unsigned int ValueIndex = 0)
373 GiD_fBeginResult(ResultFile, (
char *)(rVariable.
Name()).c_str(), (
char *)(
"Kratos"),
374 SolutionTag, GiD_Matrix, GiD_OnGaussPoints,
mGPTitle, NULL, 0, NULL );
375 std::vector<Matrix> ValuesOnIntPoint(
mSize);
379 it->CalculateOnIntegrationPoints( rVariable, ValuesOnIntPoint,
383 if(ValuesOnIntPoint[index].size1() ==3
384 && ValuesOnIntPoint[index].size2() ==3) {
385 GiD_fWrite3DMatrix( ResultFile, it->Id(), ValuesOnIntPoint[index](0,0),
386 ValuesOnIntPoint[index](1,1), ValuesOnIntPoint[index](2,2),
387 ValuesOnIntPoint[index](0,1), ValuesOnIntPoint[index](1,2),
388 ValuesOnIntPoint[index](0,2) );
390 else if(ValuesOnIntPoint[index].size1() ==2
391 && ValuesOnIntPoint[index].size2() ==2) {
392 GiD_fWrite3DMatrix( ResultFile, it->Id(), ValuesOnIntPoint[index](0,0),
393 ValuesOnIntPoint[index](1,1), 0.0,
394 ValuesOnIntPoint[index](0,1), 0.0, 0.0);
396 else if(ValuesOnIntPoint[index].size1() ==1
397 && ValuesOnIntPoint[index].size2() ==3) {
398 GiD_fWrite3DMatrix( ResultFile, it->Id(), ValuesOnIntPoint[index](0,0),
399 ValuesOnIntPoint[index](0,1), 0.0,
400 ValuesOnIntPoint[index](0,2), 0.0, 0.0);
402 else if(ValuesOnIntPoint[index].size1() ==1
403 && ValuesOnIntPoint[index].size2() ==4) {
404 GiD_fWrite3DMatrix( ResultFile, it->Id(), ValuesOnIntPoint[index](0,0),
405 ValuesOnIntPoint[index](0,1), ValuesOnIntPoint[index](0,2),
406 ValuesOnIntPoint[index](0,3), 0.0, 0.0);
408 else if(ValuesOnIntPoint[index].size1() ==1
409 && ValuesOnIntPoint[index].size2() ==6) {
410 GiD_fWrite3DMatrix( ResultFile, it->Id(), ValuesOnIntPoint[index](0,0),
411 ValuesOnIntPoint[index](0,1), ValuesOnIntPoint[index](0,2),
412 ValuesOnIntPoint[index](0,3), ValuesOnIntPoint[index](0,4),
413 ValuesOnIntPoint[index](0,5) );
420 ValuesOnIntPoint[0].resize(0, 0,
false);
426 it->CalculateOnIntegrationPoints( rVariable, ValuesOnIntPoint,
429 if (ValuesOnIntPoint[0].size1() == 0 && ValuesOnIntPoint[0].size2() == 0) {
436 if(ValuesOnIntPoint[index].size1() ==3
437 && ValuesOnIntPoint[index].size2() ==3) {
438 GiD_fWrite3DMatrix( ResultFile, it->Id(), ValuesOnIntPoint[index](0,0),
439 ValuesOnIntPoint[index](1,1), ValuesOnIntPoint[index](2,2),
440 ValuesOnIntPoint[index](0,1), ValuesOnIntPoint[index](1,2),
441 ValuesOnIntPoint[index](0,2) );
443 else if(ValuesOnIntPoint[index].size1() ==1
444 && ValuesOnIntPoint[index].size2() ==6) {
445 GiD_fWrite3DMatrix( ResultFile, it->Id(), ValuesOnIntPoint[index](0,0),
446 ValuesOnIntPoint[index](0,1), ValuesOnIntPoint[index](0,2),
447 ValuesOnIntPoint[index](0,3), ValuesOnIntPoint[index](0,4),
448 ValuesOnIntPoint[index](0,5) );
450 else if(ValuesOnIntPoint[index].size1() ==1
451 && ValuesOnIntPoint[index].size2() ==3) {
452 GiD_fWrite3DMatrix( ResultFile, it->Id(), ValuesOnIntPoint[index](0,0),
453 ValuesOnIntPoint[index](0,1), 0.0,
454 ValuesOnIntPoint[index](0,2), 0.0, 0.0);
456 else if(ValuesOnIntPoint[index].size1() ==1
457 && ValuesOnIntPoint[index].size2() ==4) {
458 GiD_fWrite3DMatrix( ResultFile, it->Id(), ValuesOnIntPoint[index](0,0),
459 ValuesOnIntPoint[index](0,1), ValuesOnIntPoint[index](0,2),
460 ValuesOnIntPoint[index](0,3), 0.0, 0.0);
466 GiD_fEndResult(ResultFile);
484 GiD_fBeginGaussPoint( MeshFile,
mGPTitle, GiD_Tetrahedra, NULL, 4, 0, 0 );
485 GiD_fWriteGaussPoint3D( MeshFile, 0.58541020,0.13819660,0.13819660 );
486 GiD_fWriteGaussPoint3D( MeshFile, 0.13819660,0.58541020,0.13819660 );
487 GiD_fWriteGaussPoint3D( MeshFile, 0.13819660,0.13819660,0.58541020 );
488 GiD_fWriteGaussPoint3D( MeshFile, 0.13819660,0.13819660,0.13819660 );
489 GiD_fEndGaussPoint(MeshFile);
493 GiD_fBeginGaussPoint( MeshFile,
mGPTitle, GiD_Quadrilateral, NULL, 4, 0, 0 );
494 GiD_fWriteGaussPoint2D( MeshFile, - 1.00/std::sqrt(3.0), - 1.00/std::sqrt(3.0) );
495 GiD_fWriteGaussPoint2D( MeshFile, 1.00/std::sqrt(3.0), - 1.00/std::sqrt(3.0) );
496 GiD_fWriteGaussPoint2D( MeshFile, 1.00/std::sqrt(3.0), 1.00/std::sqrt(3.0) );
497 GiD_fWriteGaussPoint2D( MeshFile, - 1.00/std::sqrt(3.0), 1.00/std::sqrt(3.0) );
498 GiD_fEndGaussPoint(MeshFile);
502 GiD_fBeginGaussPoint( MeshFile,
mGPTitle, GiD_Quadrilateral, NULL, 9, 0, 0 );
503 GiD_fWriteGaussPoint2D( MeshFile, -std::sqrt(3.00/5.00) , -std::sqrt(3.00/5.00));
504 GiD_fWriteGaussPoint2D( MeshFile, 0.00 , -std::sqrt(3.00/5.00) );
505 GiD_fWriteGaussPoint2D( MeshFile, std::sqrt(3.00/5.00) , -std::sqrt(3.00/5.00) );
506 GiD_fWriteGaussPoint2D( MeshFile, -std::sqrt(3.00/5.00), 0.00 );
507 GiD_fWriteGaussPoint2D( MeshFile, 0.00 , 0.00 );
508 GiD_fWriteGaussPoint2D( MeshFile, std::sqrt(3.00/5.00), 0.00);
509 GiD_fWriteGaussPoint2D( MeshFile, -std::sqrt(3.00/5.00), std::sqrt(3.00/5.00) );
510 GiD_fWriteGaussPoint2D( MeshFile, 0.00, std::sqrt(3.00/5.00) );
511 GiD_fWriteGaussPoint2D( MeshFile, std::sqrt(3.00/5.00), std::sqrt(3.00/5.00) );
512 GiD_fEndGaussPoint(MeshFile);
516 GiD_fBeginGaussPoint( MeshFile,
mGPTitle, GiD_Tetrahedra, NULL, 4, 0, 0 );
517 GiD_fWriteGaussPoint3D( MeshFile, 1.0/6.0, 1.0/6.0, 1.0/6.0 );
518 GiD_fWriteGaussPoint3D( MeshFile, 1.0/2.0, 1.0/6.0, 1.0/6.0 );
519 GiD_fWriteGaussPoint3D( MeshFile, 1.0/6.0, 1.0/2.0, 1.0/6.0 );
520 GiD_fWriteGaussPoint3D( MeshFile, 1.0/6.0, 1.0/6.0, 1.0/2.0 );
521 GiD_fEndGaussPoint(MeshFile);
525 GiD_fBeginGaussPoint(MeshFile,
"tet10_element_gp", GiD_Tetrahedra, NULL, 10, 0, 0);
536 GiD_fEndGaussPoint(MeshFile);
540 GiD_fBeginGaussPoint( MeshFile,
mGPTitle, GiD_Tetrahedra, NULL, 4, 0, 0 );
541 GiD_fWriteGaussPoint3D( MeshFile, 1.0/14.0, 1.0/14.0, 1.0/14.0 );
542 GiD_fWriteGaussPoint3D( MeshFile, 11.0/14.0, 1.0/14.0, 1.0/14.0 );
543 GiD_fWriteGaussPoint3D( MeshFile, 1.0/14.0, 11.0/14.0, 1.0/14.0 );
544 GiD_fWriteGaussPoint3D( MeshFile, 1.0/14.0, 1.0/14.0, 11.0/14.0 );
545 GiD_fEndGaussPoint(MeshFile);
549 GiD_fBeginGaussPoint( MeshFile,
mGPTitle, GiD_Triangle, NULL, 3, 0, 0 );
550 GiD_fWriteGaussPoint2D( MeshFile, 1.0/6.0, 1.0/6.0 );
551 GiD_fWriteGaussPoint2D( MeshFile, 2.0/3.0, 1.0/6.0 );
552 GiD_fWriteGaussPoint2D( MeshFile, 1.0/6.0, 2.0/3.0 );
553 GiD_fEndGaussPoint(MeshFile);
557 GiD_fBeginGaussPoint( MeshFile,
mGPTitle, GiD_Prism, NULL, 6, 0, 0 );
559 GiD_fWriteGaussPoint3D(MeshFile, 1.00 / 6.00, 1.00 / 6.00, 0.5 * (1.0 - std::sqrt(1.00 / 3.00)));
560 GiD_fWriteGaussPoint3D(MeshFile, 2.00 / 3.00, 1.00 / 6.00, 0.5 * (1.0 - std::sqrt(1.00 / 3.00)));
561 GiD_fWriteGaussPoint3D(MeshFile, 1.00 / 6.00, 2.00 / 3.00, 0.5 * (1.0 - std::sqrt(1.00 / 3.00)));
563 GiD_fWriteGaussPoint3D(MeshFile, 1.00 / 6.00, 1.00 / 6.00, 0.5 * (1.0 + std::sqrt(1.00 / 3.00)));
564 GiD_fWriteGaussPoint3D(MeshFile, 2.00 / 3.00, 1.00 / 6.00, 0.5 * (1.0 + std::sqrt(1.00 / 3.00)));
565 GiD_fWriteGaussPoint3D(MeshFile, 1.00 / 6.00, 2.00 / 3.00, 0.5 * (1.0 + std::sqrt(1.00 / 3.00)));
567 GiD_fEndGaussPoint(MeshFile);
576 GiD_fEndGaussPoint(MeshFile);
IntegrationMethod
Definition: geometry_data.h:76
KratosGeometryFamily
Definition: geometry_data.h:91
Definition: gid_gauss_point_container.h:52
KratosGeometryFamily mKratosElementFamily
Definition: gid_gauss_point_container.h:592
const char * mGPTitle
member variables
Definition: gid_gauss_point_container.h:591
void Reset()
Definition: gid_gauss_point_container.h:470
std::vector< int > mIndexContainer
Definition: gid_gauss_point_container.h:595
virtual void PrintResults(GiD_FILE ResultFile, const Variable< Vector > &rVariable, const ModelPart &rModelPart, const double SolutionTag, const unsigned int ValueIndex=0)
Definition: gid_gauss_point_container.h:320
virtual ~GidGaussPointsContainer()
Destructor.
Definition: gid_gauss_point_container.h:65
virtual void PrintResults(GiD_FILE ResultFile, const Variable< int > &rVariable, const ModelPart &rModelPart, const double SolutionTag, const unsigned int ValueIndex)
Definition: gid_gauss_point_container.h:163
virtual void PrintResults(GiD_FILE ResultFile, const Variable< array_1d< double, 6 > > &rVariable, const ModelPart &rModelPart, const double SolutionTag, const unsigned int ValueIndex=0)
Definition: gid_gauss_point_container.h:275
virtual bool AddCondition(const ModelPart::ConditionConstantIterator pCondIt)
Definition: gid_gauss_point_container.h:81
virtual void PrintResults(GiD_FILE ResultFile, const Variable< Matrix > &rVariable, const ModelPart &rModelPart, const double SolutionTag, const unsigned int ValueIndex=0)
Definition: gid_gauss_point_container.h:368
virtual void PrintResults(GiD_FILE ResultFile, const Variable< bool > &rVariable, const ModelPart &rModelPart, const double SolutionTag, const unsigned int ValueIndex)
Definition: gid_gauss_point_container.h:125
GidGaussPointsContainer(const char *gp_title, KratosGeometryFamily geometryFamily, GiD_ElementType gid_element_type, int number_of_integration_points, std::vector< int > index_container)
Constructor.
Definition: gid_gauss_point_container.h:55
unsigned int mSize
Definition: gid_gauss_point_container.h:594
ModelPart::ConditionsContainerType mMeshConditions
Definition: gid_gauss_point_container.h:597
virtual void PrintFlagsResults(GiD_FILE ResultFile, const Kratos::Flags &rFlag, const std::string &rFlagName, const ModelPart &rModelPart, const double SolutionTag)
Definition: gid_gauss_point_container.h:94
ModelPart::ElementsContainerType mMeshElements
Definition: gid_gauss_point_container.h:596
void WriteGaussPoints(GiD_FILE MeshFile)
Definition: gid_gauss_point_container.h:477
virtual void PrintResults(GiD_FILE ResultFile, const Variable< double > &rVariable, const ModelPart &rModelPart, const double SolutionTag, const unsigned int ValueIndex=0)
Definition: gid_gauss_point_container.h:199
GiD_ElementType mGidElementFamily
Definition: gid_gauss_point_container.h:593
virtual void PrintResults(GiD_FILE ResultFile, const Variable< array_1d< double, 3 > > &rVariable, const ModelPart &rModelPart, const double SolutionTag, const unsigned int ValueIndex=0)
Definition: gid_gauss_point_container.h:236
virtual bool AddElement(const ModelPart::ElementConstantIterator pElemIt)
Definition: gid_gauss_point_container.h:67
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
MeshType::ConditionsContainerType ConditionsContainerType
Condintions container. A vector set of Conditions with their Id's as key.
Definition: model_part.h:183
MeshType::ElementsContainerType ElementsContainerType
Element container. A vector set of Elements with their Id's as key.
Definition: model_part.h:168
MeshType::ConditionConstantIterator ConditionConstantIterator
Definition: model_part.h:195
ProcessInfo & GetProcessInfo()
Definition: model_part.h:1746
MeshType::NodesContainerType NodesContainerType
Nodes container. Which is a vector set of nodes with their Id's as key.
Definition: model_part.h:128
MeshType::ElementConstantIterator ElementConstantIterator
Definition: model_part.h:180
const std::string & Name() const
Definition: variable_data.h:201
Variable class contains all information needed to store and retrive data from a data container.
Definition: variable.h:63
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_TRY
Definition: define.h:109
#define tet10_b
Definition: gid_gauss_point_container.h:33
#define tet10_a
Definition: gid_gauss_point_container.h:32
#define tet10_c
Definition: gid_gauss_point_container.h:34
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
KratosZeroVector< double > ZeroVector
Definition: amatrix_interface.h:561
GeometryData::IntegrationMethod IntegrationMethodType
Definition: gid_gauss_point_container.h:44
ModelPart::ConditionsContainerType ConditionsArrayType
Definition: gid_gauss_point_container.h:43
ModelPart::NodesContainerType NodesArrayType
Definition: gid_gauss_point_container.h:42
ModelPart::ElementsContainerType ElementsArrayType
Definition: gid_gauss_point_container.h:41
GeometryData::KratosGeometryFamily KratosGeometryFamily
Definition: gid_gauss_point_container.h:45
list values
Definition: bombardelli_test.py:42
integer i
Definition: TensorModule.f:17