TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Structural_dynamic_mesh_model.cpp
1/****************************************************************************
2* Copyright (c) 2025, CEA
3* All rights reserved.
4*
5* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
6* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8* 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
9*
10* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
11* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
12* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
13*
14*****************************************************************************/
15
16#include <Structural_dynamic_mesh_model.h>
17
18#include <Domaine_ALE.h>
19#include <stdexcept>
20
21Implemente_instanciable_sans_constructeur(Structural_dynamic_mesh_model,"Structural_dynamic_mesh_model",Interprete_geometrique_base);
22
23// Syntaxe:
24//Structural_dynamic_mesh_model NOMDOMAINE
25//{
26// Mfront_library path_to_libBehaviour.so
27// Mfront_model_name Ogden|SaintVenantKirchhoffElasticity
28// Mfront_material_property
29// [ Grid_dt_min ]
30// [ YoungModulus ]
31// [ Density ]
32// [ Inertial_Damping ]
33//}
34
35// XD Structural_dynamic_mesh_model interprete Structural_dynamic_mesh_model NO_BRACE Fictitious structural model for
36// XD_CONT mesh motion. Link with MGIS library
37// XD attr dom ref_domaine dom REQ domain name
38// XD attr bloc bloc_lecture_Structural_dynamic_mesh_model bloc REQ not_set
39
40// XD bloc_lecture_Structural_dynamic_mesh_model objet_lecture nul NO_BRACE bloc
41// XD attr aco chaine(into=["{"]) aco REQ Opening curly bracket.
42// XD attr Mfront_library chaine(into=["Mfront_library"]) Mfront_library OPT Keyword to specify the
43// XD_CONT path_to_libBehaviour.so If the user does not define the MFront library path, we use the default one instead:
44// XD_CONT path = \$project_directory/share/MFront_material_libraries/<MFront_library_keyword>/src/libBehaviour.so
45// XD attr Mfront_model_name chaine(into=["Mfront_model_name"]) Mfront_model OPT keyword to specify the Mfront model.
46// XD_CONT Choice between Ogden and SaintVenantKirchhoffElasticity.
47// XD attr Mfront_material_property chaine(into=["Mfront_material_property"]) Mfront_material_property OPT keyword to
48// XD_CONT specify the material property. Eg. Ogden_alpha_, Ogden_mu_, Ogden_K
49// XD attr YoungModulus floattant young OPT Young Module
50// XD attr Density floattant rho OPT fictitious structural density
51// XD attr Inertial_Damping floattant inertial_Damping OPT fictitious structural inertial damping
52// XD attr Grid_dt_min floattant grid_dt_min OPT fictitious structural time step
53// XD attr acof chaine(into=["}"]) acof REQ Closing curly bracket.
54
56{
57
58 l_ = "unset string" ;
59 f_ = "unset string" ;
60 h_ = "unset string" ;
61
62 nSymSize_ = (dimension == 2) ? 5 : 9;
63 symSize_ = (dimension == 2) ? 4 : 6;
64 nbn_ = (dimension == 2) ? 3 : 4;
66
67 x.reset();
68 u.reset();
69 v.reset();
70 vp.reset();
71 a.reset();
72 ff.reset();
73 mass.reset() ;
74 nodalScaleMass.reset() ;
75 Eta_.reset() ;
76 xl_.reset() ;
77 ul_.reset() ;
78 fl_.reset() ;
79 B0l_ .reset() ;
80 invertNum_.reset() ;
81 B0_.reset() ;
82 Ft_.reset() ;
83 Stress_.reset() ;
84 massElem_ .reset();
85 meshPbPressure_.reset() ;
86 meshPbVonMises_.reset() ;
87 meshPbForceFace_.reset() ;
88 mfrontEvars_.reset() ;
89}
90
92{
93 return os;
94}
95
96
98{
99 return is;
100}
101
110
112{
113
114 if ( l_ == "unset string")
115 {
116 std::string path;
117 if(f_ != "unset string")
118 {
119 // If the user does not define the MFront library path,
120 // use the default one instead:
121 // path = $project_directory/share/MFront_material_libraries/<MFront_library_keyword>/src/libBehaviour.so
122 path = std::string(getenv("TrioCFD_project_directory")) + "/share/Mfront_material_libraries/" + f_+ "/src/libBehaviour.so";
123 l_=path;
124 }
125 else
126 {
127 Cerr << "MFront model name is undefined (keyword: Mfront_model_name)." << finl;
128 Cerr << "Cannot set the default MFront library path: "
129 << "$project_directory/share/MFront_material_libraries/<Mfront_library_keyword>/src/libBehaviour.so" << finl;
130 Cerr << "Please define either the MFront library path (keyword: Mfront_library) "
131 << "or the MFront model name (keyword: Mfront_model_name)." << finl;
132 Process::exit() ;
133 }
134 }
135
136 if ( f_ == "unset string")
137 {
138 Cerr << "Error: Mfront model name undefined (Mfront_model_name keyword)" << finl ;
139 Process::exit() ;
140 }
141
142 if (h_ == "unset string")
143 {
144 switch (dimension)
145 {
146 case (2) :
147 Cerr << "Use default Mfront hypothesis for 2D (PlaneStrain)" << finl ;
148 h_ = "PlaneStrain" ;
149 break ;
150 case (3) :
151 Cerr << "Use default Mfront hypothesis for 3D (Tridimensional)" << finl ;
152 h_ = "Tridimensional" ;
153 break ;
154 }
155
156 }
157 hypothesis_= mgis::behaviour::fromString(h_) ;
158
159 // dt/rdt
160 mgisBehaviourData_.dt = 0.;
162
163 load_behaviour_(StressMeasureKind::cauchy, TangentOperatorKind::none) ;
164 if ( nbIvars_ > 0)
165 {
166 Cerr << "Mfront behaviour: internal state variables:" << finl ;
167 for (auto isvs : mgisBehaviour_.isvs)
168 {
169 size_t vOffset = mgis::behaviour::getVariableOffset(mgisBehaviour_.isvs, isvs.name, hypothesis_);
170 size_t vSize = mgis::behaviour::getVariableSize(isvs, hypothesis_);
171 Cerr << " - " << isvs.name << ": " << vOffset << " -> " << vOffset + vSize << finl ;
172 }
173
174 Cerr << "Wrong Mfront behaviour for structural dynamic mesh motion" << finl ;
175 Cerr << "Only pure elastic materials are allowed" << finl ;
177 }
178 if ( nbEvars_ > 0)
179 {
180 Cerr << "Mfront behaviour: external state variables:" << finl ;
181 sizeEvars_ = 0 ;
182 for (auto esvs : mgisBehaviour_.esvs)
183 {
184 size_t vOffset = mgis::behaviour::getVariableOffset(mgisBehaviour_.esvs, esvs.name, hypothesis_);
185 size_t vSize = mgis::behaviour::getVariableSize(esvs, hypothesis_);
186 Cerr << " - " << esvs.name << ": " << vOffset << " -> " << vOffset + vSize << finl ;
187 sizeEvars_ += static_cast<int> (vSize) ;
188 }
189
190 Cerr << "Warning: external variables ignored for mesh motion" << finl ;
191 }
192
193 // Check and fill material properties for Mfront behaviour
194 matpSize_ = static_cast<int> (mgis::behaviour::getArraySize(mgisBehaviour_.mps, hypothesis_));
195 s0MaterialProperties_.resize(matpSize_);
196 s1MaterialProperties_.resize(matpSize_);
197 mgisBehaviourData_.s0.material_properties = s0MaterialProperties_.data();
198 mgisBehaviourData_.s1.material_properties = s1MaterialProperties_.data();
199 for (auto mps : mgisBehaviour_.mps)
200 {
201 size_t vOffset = mgis::behaviour::getVariableOffset(mgisBehaviour_.mps, mps.name, hypothesis_);
202 size_t vSize = mgis::behaviour::getVariableSize(mps, hypothesis_);
203 auto it = matp_.find(mps.name);
204 if (it != matp_.end())
205 {
206 if (vSize != (it->second).size())
207 {
208 Cerr << "Error with input for Mfront behaviour " << f_ << finl ;
209 Cerr << "The number of scalar values must be " << vSize << " for property " << mps.name << finl ;
211 }
212 for (size_t i = 0; i < vSize; ++i)
213 {
214 s0MaterialProperties_[vOffset + i] = it->second[i];
215 s1MaterialProperties_[vOffset + i] = it->second[i];
216 }
217 }
218 else // missing property: set its value(s) to zero with a warning
219 {
220 Cerr << "Warning with input for Mfront behaviour " << f_ << finl ;
221 Cerr << "Missing data for for property " << mps.name << ", default value(s) set to zero" << finl ;
222 for (size_t i = 0; i < vSize; ++i)
223 {
224 s0MaterialProperties_[vOffset + i] = 0;
225 s1MaterialProperties_[vOffset + i] = 0;
226 }
227 }
228 }
229 mgisBehaviourData_.s0.mass_density = &density_;
230 mgisBehaviourData_.s1.mass_density = &density_;
231
232}
233
234void Structural_dynamic_mesh_model::initDynamicMeshProblem(const double temps, const int nsom, const int nelem, const int nface, const MD_Vector& mds, const MD_Vector& mde, const MD_Vector& mdf)
235{
236 switch (dimension)
237 {
238 case (2) :
239 nbn_ = 3 ;
240 nSymSize_ = 5 ;
241 symSize_ = 4 ;
242
243 Eta_.resize(dimension,nbn_) ;
244 Eta_(0,0) = -1. ;
245 Eta_(0,1) = 1. ;
246 Eta_(0,2) = 0. ;
247 Eta_(1,0) = -1. ;
248 Eta_(1,1) = 0. ;
249 Eta_(1,2) = 1. ;
250
251 break ;
252 case (3) :
253 nbn_ = 4 ;
254 nSymSize_ = 9 ;
255 symSize_ = 6 ;
256
257 Eta_.resize(dimension,nbn_) ;
258 Eta_(0,0) = -1. ;
259 Eta_(0,1) = 1. ;
260 Eta_(0,2) = 0. ;
261 Eta_(0,3) = 0. ;
262 Eta_(1,0) = -1. ;
263 Eta_(1,1) = 0. ;
264 Eta_(1,2) = 1. ;
265 Eta_(1,3) = 0. ;
266 Eta_(2,0) = -1. ;
267 Eta_(2,1) = 0. ;
268 Eta_(2,2) = 0. ;
269 Eta_(2,3) = 1. ;
270
271 break ;
272 }
273
274 if(!resumption)
275 {
276 u.resize(nsom,dimension) ;
278 v.resize(nsom,dimension) ;
280
281 a.resize(nsom,dimension) ;
283
284 x.resize(nsom,dimension) ;
286
287 }
288
289 vp.resize(nsom,dimension) ;
290 ff.resize(nsom,dimension) ;
291
292 mass.resize(nsom) ;
293 if (getGridDtMin() > 0.) nodalScaleMass.resize(nsom) ;
294
296 if(!resumption)
297 {
298 B0_.resize(nelem,dimB0_) ;
300 Ft_.resize(nelem, nSymSize_) ;
302 Stress_.resize(nelem, symSize_) ;
304
305 }
306
307 invertNum_.resize(nelem) ;
308
309 massElem_.resize(nelem) ;
310
311 cSoundElem_.resize(nelem) ;
312
313 meshPbPressure_.resize(nelem) ;
314 meshPbVonMises_.resize(nelem) ;
315 meshPbForceFace_.resize(nface,dimension) ;
316
317 mfrontEvars_.resize(nelem, sizeEvars_) ;
318
319 // Only ff and mass need to be built as distributed arrays
323
324 if(!resumption)
325 {
326 u=0 ;
327 v=0 ;
328 a=0 ;
329 }
330 vp=0 ;
331 ff=0 ;
332 mass=0. ;
333 if (getGridDtMin() > 0.) nodalScaleMass=0. ;
334
335 if(!resumption)
336 {
337 B0_ = 0. ;
338 Stress_ = 0. ;
339 }
340 invertNum_ = 0 ; // 0 = no numerotation inversion by default
341 massElem_ = 0. ;
342 mfrontEvars_ = 0. ;
343
344 // Arrays for postprocessing
345 meshPbPressure_ = 0. ;
346 meshPbVonMises_ = 0. ;
347 meshPbForceFace_ = 0. ;
351
352 // Initial transformation gradient is identity
353 if(!resumption)
354 {
355 for(int i=0; i<nelem; i++)
356 {
357 switch (dimension)
358 {
359 case (2) :
360
361 Ft_(i,0) = 1. ;
362 Ft_(i,1) = 1. ;
363 Ft_(i,2) = 1. ;
364 Ft_(i,3) = 0. ;
365 Ft_(i,4) = 0. ;
366
367 break ;
368
369 case (3) :
370
371 Ft_(i,0) = 1. ;
372 Ft_(i,1) = 1. ;
373 Ft_(i,2) = 1. ;
374 Ft_(i,3) = 0. ;
375 Ft_(i,4) = 0. ;
376 Ft_(i,5) = 0. ;
377 Ft_(i,6) = 0. ;
378 Ft_(i,7) = 0. ;
379 Ft_(i,8) = 0. ;
380
381 break ;
382 }
383 }
384 }
385
386 xl_.resize(nbn_,dimension) ;
387 ul_.resize(nbn_,dimension) ;
388 fl_.resize(nbn_,dimension) ;
389
390 B0l_.resize(dimension,nbn_) ;
391
392 xLast = x ;
393 vpLast =vp ;
394
395}
396
397void Structural_dynamic_mesh_model::computeInternalForces(double& Vol, double& Xlong, double& cSound, double& Pressure, double& VonMises)
398{
399
400 // Integration with 1 single gauss point on triangular (dimension=2) or tetrahedral (dimension=3) finite element
401
402 // Compute jacobian and B matrices
403
404 DoubleTab Jac(dimension, dimension) ;
405
406 Jac=0 ;
407 for (int k=0; k < nbn_; k++)
408 {
409 for (int j=0; j < dimension; j++)
410 {
411 for (int i=0; i < dimension ; i++)
412 {
413 Jac(j,i) += Eta_(j,k) * xl_(k,i) ;
414 }
415 }
416 }
417
418 double Det ;
419 DoubleTab InvJac(dimension, dimension) ;
420 double aux ;
421 switch (dimension)
422 {
423 case (2) :
424 Det = Jac(0,0) * Jac(1,1) - Jac(0,1) * Jac(1,0) ;
425 aux = 1. / Det ;
426 InvJac(0,0) = Jac(1,1) * aux ;
427 InvJac(0,1) = -Jac(0,1) * aux ;
428 InvJac(1,0) = -Jac(1,0) * aux ;
429 InvJac(1,1) = Jac(0,0) * aux ;
430
431 triangleSurfLength_(Vol, Xlong, Det) ;
432
433 break ;
434 case (3) :
435 Det= Jac(0,0) * (Jac(1,1) * Jac(2,2) - Jac(1,2) * Jac(2,1))
436 - Jac(0,1) * (Jac(1,0) * Jac(2,2) - Jac(1,2) * Jac(2,0))
437 + Jac(0,2) * (Jac(1,0) * Jac(2,1) - Jac(1,1) * Jac(2,0)) ;
438 aux = 1. / Det ;
439 InvJac(0,0) = (Jac(1,1) * Jac(2,2) - Jac(2,1) * Jac(1,2)) * aux ;
440 InvJac(0,1) = -(Jac(0,1) * Jac(2,2) - Jac(2,1) * Jac(0,2)) * aux ;
441 InvJac(0,2) = (Jac(0,1) * Jac(1,2) - Jac(1,1) * Jac(0,2)) * aux ;
442 InvJac(1,0) = -(Jac(1,0) * Jac(2,2) - Jac(2,0) * Jac(1,2)) * aux ;
443 InvJac(1,1) = (Jac(0,0) * Jac(2,2) - Jac(2,0) * Jac(0,2)) * aux ;
444 InvJac(1,2) = -(Jac(0,0) * Jac(1,2) - Jac(1,0) * Jac(0,2)) * aux ;
445 InvJac(2,0) = (Jac(1,0) * Jac(2,1) - Jac(2,0) * Jac(1,1)) * aux ;
446 InvJac(2,1) = -(Jac(0,0) * Jac(2,1) - Jac(2,0) * Jac(0,1)) * aux ;
447 InvJac(2,2) = (Jac(0,0) * Jac(1,1) - Jac(1,0) * Jac(0,1)) * aux ;
448
449 tetrahedronVolLength_(Vol, Xlong, Det) ;
450
451 break ;
452 }
453
454 DoubleTab B(dimension, nbn_) ;
455 B=0 ;
456 for (int k=0; k < dimension; k++)
457 {
458 for (int j=0; j < dimension; j++)
459 {
460 for (int i=0; i < nbn_ ; i++)
461 {
462 B(j,i) += InvJac(j,k) * Eta_(k,i) ;
463 }
464 }
465 }
466
467 if (gridNStep == 0)
468 {
469 setB0_(B) ; // save B matrix on initial configuration
470 B0l_ = B ;
471 }
472
473 if (doConfigurationReset) // take current configuration as the reference configuration
474 // for further mesh deformation
475 {
476 setB0_(B) ;
477 B0l_ = B ;
478
479 for (int i=0; i<symSize_; i++) Stress_(iel_,i) = 0. ;
480 switch (dimension)
481 {
482 case (2) :
483
484 Ft_(iel_,0) = 1. ;
485 Ft_(iel_,1) = 1. ;
486 Ft_(iel_,2) = 1. ;
487 Ft_(iel_,3) = 0. ;
488 Ft_(iel_,4) = 0. ;
489
490 break ;
491
492 case (3) :
493
494 Ft_(iel_,0) = 1. ;
495 Ft_(iel_,1) = 1. ;
496 Ft_(iel_,2) = 1. ;
497 Ft_(iel_,3) = 0. ;
498 Ft_(iel_,4) = 0. ;
499 Ft_(iel_,5) = 0. ;
500 Ft_(iel_,6) = 0. ;
501 Ft_(iel_,7) = 0. ;
502 Ft_(iel_,8) = 0. ;
503
504 break ;
505 }
506 }
507
508#define _xikbjk(i,j) xl_(k,i)*B0l_(j,k)
509 std::vector <double> stress(symSize_) ;
510
512 {
513
514 // Next transformation gradient
515
516 std::vector <double> ftpdt(nSymSize_) ;
517 for (int i=0; i<nSymSize_; i++) ftpdt[i] = 0 ;
518
519 for (int k=0; k<nbn_; k++)
520 {
521 ftpdt[0] += _xikbjk(0,0); // F11=x1k*dNk/dx01
522 ftpdt[1] += _xikbjk(1,1); // F22=x2k*dNk/dx02
523 ftpdt[3] += _xikbjk(0,1); // F12=x1k*dNk/dx02
524 ftpdt[4] += _xikbjk(1,0); // F21=x2k*dNk/dx01
525 if (dimension == 2)
526 {
527 ftpdt[2] = 1. ;
528 }
529 else if (dimension == 3)
530 {
531 ftpdt[2] += _xikbjk(2,2); // F33=x3k*dNk/dx03
532 ftpdt[5] += _xikbjk(0,2); // F13=x1k*dNk/dx03
533 ftpdt[6] += _xikbjk(2,0); // F31=x3k*dNk/dx01
534 ftpdt[7] += _xikbjk(1,2); // F23=x2k*dNk/dx03
535 ftpdt[8] += _xikbjk(2,1); // F32=x3k*dNk/dx02
536 }
537 }
538
539 // Integrate material behavior
540
541 std::vector <double> ft(nSymSize_) ;
542 for (int i=0; i<nSymSize_; i++) ft[i] = Ft_(iel_,i) ;
543
544 for (int i=0; i<symSize_; i++) stress[i] = Stress_(iel_,i) ;
545
546 std::vector <double> evars(sizeEvars_) ;
547 for (int i=0; i<sizeEvars_; i++) evars[i] = mfrontEvars_(iel_,i) ;
548
549 double voidInternalVars[1] ; // 0 size forbidden
550 std::vector <double> K(stiffnessMatrixMinSize_) ;
551 K[0] = 100; // Stiffness matrix not computed, see mfront/mgis convention
552 // Value >= 50: compute speed of sound
553
554 double speedOfSound[1] ;
555
556 integrate_behaviour_(&stress[0], voidInternalVars, &evars[0], &K[0], &ft[0], &ftpdt[0], speedOfSound) ;
557
558 if (speedOfSound[0] <= 0.)
559 {
560 Cerr << "Error (mesh motion): speed of sound not computed in provided Mfront behaviour" << finl ;
562 }
563 else
564 {
565 cSound = speedOfSound[0];
566 cSoundElem_(iel_) = cSound;
567 }
568
569 // Update stress and transformation gradient
570 for (int i=0; i<symSize_; i++) Stress_(iel_,i) = stress[i] ;
571 for (int i=0; i<nSymSize_; i++) Ft_(iel_,i) = ftpdt[i] ;
572 }
573 else
574 {
575 // Skipped stress computation: take stored values for stress and cSound
576 for (int i=0; i<symSize_; i++) stress[i] = Stress_(iel_,i) ;
577 cSound = cSoundElem_(iel_) ;
578 }
579
580 // Compute local forces
581 aux = 1./sqrt(2.) ;
582 fl_ = 0 ;
583 std::vector <double> cauchy(symSize_) ;
584 switch (dimension)
585 {
586 case (2) :
587 // Switch from Voigt notation (Mfront) to EPX notation
588 cauchy[0] = stress[0] ;
589 cauchy[1] = stress[1] ;
590 cauchy[2] = stress[3] * aux ;
591 cauchy[3] = stress[2] ;
592
593 for (int k=0; k<nbn_; k++)
594 {
595 fl_(k,0) += Vol * (B(0,k) * cauchy[0] + B(1,k) * cauchy[2]) ;
596 fl_(k,1) += Vol * (B(0,k) * cauchy[2] + B(1,k) * cauchy[1]) ;
597 }
598
599 Pressure = (cauchy[0] + cauchy[1] + cauchy[3]) / 3. ;
600 // abs to suppress the risk of negative values due to truncation with very small values
601 VonMises = sqrt(abs(cauchy[0] * (cauchy[0] - cauchy[1]) + cauchy[1] * (cauchy[1] - cauchy[3])
602 + cauchy[3] * (cauchy[3] - cauchy[0]) + 3. * cauchy[2] * cauchy[2])) ;
603
604 break ;
605 case (3) :
606 // Switch from Voigt notation (Mfront) to EPX notation
607 cauchy[0] = stress[0] ;
608 cauchy[1] = stress[1] ;
609 cauchy[2] = stress[2] ;
610 cauchy[3] = stress[3] * aux ;
611 cauchy[4] = stress[5] * aux ;
612 cauchy[5] = stress[4] * aux ;
613
614 for (int k=0; k<nbn_; k++)
615 {
616 fl_(k,0) += Vol * (B(0,k) * cauchy[0] + B(1,k) * cauchy[3] + B(2,k) * cauchy[5]) ;
617 fl_(k,1) += Vol * (B(0,k) * cauchy[3] + B(1,k) * cauchy[1] + B(2,k) * cauchy[4]) ;
618 fl_(k,2) += Vol * (B(0,k) * cauchy[5] + B(1,k) * cauchy[4] + B(2,k) * cauchy[2]) ;
619 }
620
621 Pressure = (cauchy[0] + cauchy[1] + cauchy[2]) / 3. ;
622 // abs to suppress the risk of negative values due to truncation with very small values
623 VonMises = sqrt(abs(cauchy[0] * (cauchy[0] - cauchy[1]) + cauchy[1] * (cauchy[1] - cauchy[2]) + cauchy[2] * (cauchy[2] - cauchy[0])
624 + 3. * (cauchy[3] * cauchy[3] + cauchy[4] * cauchy[4] + cauchy[5] * cauchy[5]))) ;
625
626 break ;
627 }
628
629}
630
631void Structural_dynamic_mesh_model::triangleSurfLength_(double& aire, double& xlong, const double Det)
632{
633
634 aire = Det / 2. ;
635
636 double v12[2] ;
637 double v13[2] ;
638 double v23[2] ;
639
640 for (int i=0; i<dimension; i++)
641 {
642 v12[i] = xl_(1,i) - xl_(0,i) ;
643 v13[i] = xl_(2,i) - xl_(0,i) ;
644 v23[i] = xl_(2,i) - xl_(1,i) ;
645 }
646
647 double w[3] ;
648
649 w[0] = v12[0] * v12[0] + v12[1] * v12[1] ;
650 w[1] = v13[0] * v13[0] + v13[1] * v13[1] ;
651 w[2] = v23[0] * v23[0] + v23[1] * v23[1] ;
652
653 double max_value = std::max({w[0], w[1], w[2]}) ;
654 xlong = Det / sqrt(max_value) ;
655
656}
657
658void Structural_dynamic_mesh_model::tetrahedronVolLength_(double& vol, double& xlong, const double Det)
659{
660
661 vol = Det / 6. ;
662
663 double v21[3] ;
664 double v31[3] ;
665 double v41[3] ;
666 double v32[3] ;
667 double v42[3] ;
668
669 for (int i=0; i<dimension; i++)
670 {
671 v21[i] = xl_(0,i) - xl_(1,i) ;
672 v31[i] = xl_(0,i) - xl_(2,i) ;
673 v41[i] = xl_(0,i) - xl_(3,i) ;
674 v32[i] = xl_(1,i) - xl_(2,i) ;
675 v42[i] = xl_(1,i) - xl_(3,i) ;
676 }
677
678 double w[3] ;
679 double s[4] ;
680
681 // face 1 2 3 : cross product 21^31
682 w[0] = v21[1]*v31[2] - v21[2]*v31[1] ;
683 w[1] = v21[2]*v31[0] - v21[0]*v31[2] ;
684 w[2] = v21[0]*v31[1] - v21[1]*v31[0] ;
685 s[0] = w[0]*w[0] + w[1]*w[1] + w[2]*w[2] ;
686 // face 1 2 4 : cross product 21^41
687 w[0] = v21[1]*v41[2] - v21[2]*v41[1] ;
688 w[1] = v21[2]*v41[0] - v21[0]*v41[2] ;
689 w[2] = v21[0]*v41[1] - v21[1]*v41[0] ;
690 s[1] = w[0]*w[0] + w[1]*w[1] + w[2]*w[2] ;
691 // face 1 3 4 : cross product 31^41
692 w[0] = v31[1]*v41[2] - v31[2]*v41[1] ;
693 w[1] = v31[2]*v41[0] - v31[0]*v41[2] ;
694 w[2] = v31[0]*v41[1] - v31[1]*v41[0] ;
695 s[2] = w[0]*w[0] + w[1]*w[1] + w[2]*w[2] ;
696 // face 2 3 4 : cross product 32^42
697 w[0] = v32[1]*v42[2] - v32[2]*v42[1] ;
698 w[1] = v32[2]*v42[0] - v32[0]*v42[2] ;
699 w[2] = v32[0]*v42[1] - v32[1]*v42[0] ;
700 s[3] = w[0]*w[0] + w[1]*w[1] + w[2]*w[2] ;
701
702 double max_value = std::max({s[0], s[1], s[2], s[3]}) ;
703 xlong = Det / sqrt(max_value) ;
704
705}
706
708{
709
710 // Save B operator at initial step to compute transformation gradient with respect to initial configuration
711
712 int pos = 0 ;
713
714 for (int j=0; j < dimension; j++)
715 {
716 for (int i=0; i < nbn_ ; i++)
717 {
718 B0_(iel_,pos) = B(j,i) ;
719 pos++ ;
720 }
721 }
722
723}
724
725void Structural_dynamic_mesh_model::load_behaviour_(StressMeasureKind smk, TangentOperatorKind tok)
726{
727 if (loaded_)
728 return;
729 else
730 loaded_ = true;
731
732 auto getMgisStressMeasureKind = [](StressMeasureKind k)
733 {
734 switch (k)
735 {
736 case StressMeasureKind::cauchy:
737 return mgis::behaviour::FiniteStrainBehaviourOptions::CAUCHY;
738 case StressMeasureKind::pk1:
739 return mgis::behaviour::FiniteStrainBehaviourOptions::PK1;
740 case StressMeasureKind::pk2:
741 return mgis::behaviour::FiniteStrainBehaviourOptions::PK2;
742 case StressMeasureKind::conjugate:
743 return mgis::behaviour::FiniteStrainBehaviourOptions::CAUCHY; // to avoid warning
744 }
745 return mgis::behaviour::FiniteStrainBehaviourOptions::CAUCHY; // to avoid warning
746 };
747
748 auto getMgisTangentOperatorKind = [](TangentOperatorKind k)
749 {
750 switch (k)
751 {
752 case TangentOperatorKind::none:
753 return mgis::behaviour::FiniteStrainBehaviourOptions::DSIG_DF; // default mgis tangent operator kind
754 case TangentOperatorKind::dCauchydF:
755 return mgis::behaviour::FiniteStrainBehaviourOptions::DSIG_DF;
756 case TangentOperatorKind::dPk2dE:
757 return mgis::behaviour::FiniteStrainBehaviourOptions::DS_DEGL;
758 case TangentOperatorKind::dPk1dF:
759 return mgis::behaviour::FiniteStrainBehaviourOptions::DPK1_DF;
760 }
761 return mgis::behaviour::FiniteStrainBehaviourOptions::DSIG_DF; // to avoid warning
762 };
763
764 mgisBehaviour_ = mgis::behaviour::load(
765 {getMgisStressMeasureKind(smk), getMgisTangentOperatorKind(tok)}, l_, f_, mgis::behaviour::fromString(h_));
766
767 // internal variables
768 this->nbIvars_ = static_cast<int> (mgis::behaviour::getArraySize(mgisBehaviour_.isvs, hypothesis_));
769
770 // external variables
771 this->nbEvars_ = static_cast<int> (mgis::behaviour::getArraySize(mgisBehaviour_.esvs, hypothesis_));
772
773 // K
774 this->KSize_ = static_cast<int> (mgis::behaviour::getArraySize(mgisBehaviour_.gradients, hypothesis_) *
775 mgis::behaviour::getArraySize(mgisBehaviour_.thermodynamic_forces, hypothesis_));
776}
777
778void Structural_dynamic_mesh_model::integrate_behaviour_(double *const stress, // stress tensor
779 double *const ivar, // state variables
780 const double *const evar, // external variables
781 double *const stiff, // stiffness matrix
782 const double *const gradientOrStrain0, // deformation gradient or strain at the beginning of the time step
783 const double *const gradientOrStrain1, // deformation gradient or strain at the end of the time step
784 double *const vsound // speed of sound variables
785 )
786{
787 mgisBehaviourData_.s0.gradients = const_cast<double *>(gradientOrStrain0);
788 mgisBehaviourData_.s1.gradients = const_cast<double *>(gradientOrStrain1);
789
790 mgisBehaviourData_.s0.thermodynamic_forces = stress;
791 mgisBehaviourData_.s1.thermodynamic_forces = stress;
792
793 mgisBehaviourData_.s0.internal_state_variables = ivar;
794 mgisBehaviourData_.s1.internal_state_variables = ivar;
795
796 mgisBehaviourData_.s0.external_state_variables = const_cast<double *>(evar);
797 mgisBehaviourData_.s1.external_state_variables = const_cast<double *>(evar);
798
799 mgisBehaviourData_.K = stiff;
800
801 mgisBehaviourData_.speed_of_sound = vsound;
802
803 int ierr = mgis::behaviour::integrate(mgisBehaviourData_, mgisBehaviour_);
804
805 if (ierr == -1)
806 {
807 // Message::error("Integration of the behavior failed");
808 Cerr << "Error: Integration of the behaviour with Mfront failed" << finl ;
809 Process::exit() ;
810 }
811 else if (ierr == 0)
812 {
813 // Message::warning("Integration of the behavior unreliable");
814 Cerr << "Warning: Integration of the behaviour with Mfront unreliable" << finl ;
815 }
816}
817
818void Structural_dynamic_mesh_model::setLocalFields(const int elnodes[4], const int elem)
819{
820
821 iel_ = elem ;
822
823 nbn_ = 3 ;
824 if (dimension == 3) nbn_ = 4 ;
825
826 for (int i=0; i<nbn_; i++)
827 {
828 int isom = elnodes[i] ;
829 for (int j=0; j<dimension; j++)
830 {
831 xl_(i,j) = x(isom,j) ;
832 ul_(i,j) = u(isom,j) ;
833 }
834 }
835
836 int pos = 0 ;
837 for (int j=0; j < dimension; j++)
838 {
839 for (int i=0; i < nbn_ ; i++)
840 {
841 B0l_(j,i) = B0_(iel_,pos) ;
842 pos++ ;
843 }
844 }
845
846}
847
848void Structural_dynamic_mesh_model::setGlobalFields(const int elnodes[4], const double Pressure, const double VonMises)
849{
850
851 for (int i=0; i<nbn_; i++)
852 {
853 int isom = elnodes[i] ;
854 for (int j=0; j<dimension; j++)
855 {
856 ff(isom,j) += fl_(i,j) ;
857 }
858 }
859
860 meshPbPressure_(iel_) = Pressure ;
861 meshPbVonMises_(iel_) = VonMises ;
862
863}
864
865double Structural_dynamic_mesh_model::computeCriticalDt(const double Vol, const double Xlong, const double cSound, const double dtMin, double& scaleMass)
866{
867
868 // Current density
869 double currDensity = massElem_(iel_) / Vol ;
870
871 // Speed of sound
872 if (currDensity <= 0.)
873 {
874 Cerr << "Error: negative density in grid mesh motion" << finl ;
875 Process::exit() ;
876 }
877
878 double cc = cSound ;
879 scaleMass = 0. ;
880 if (dtMin > 0.)
881 {
882 double dtc = Xlong / cc ;
883 if (dtc < dtMin)
884 {
885 cc = Xlong / dtMin ;
886 double newDensity = currDensity * pow(cSound,2) / pow(cc,2) ;
887 scaleMass = (newDensity - currDensity) * Vol ;
888 }
889 }
890
891 return Xlong / cc ;
892
893}
894
895void Structural_dynamic_mesh_model::computeForceFaces(const int nb_faces, const int nb_som_face, const IntTab& face_sommets)
896{
897
898 int i, j, s ;
899 meshPbForceFace_ = 0. ;
900 for (j=0; j<dimension; j++)
901 {
902 for (i=0; i<nb_faces; i++)
903 {
904 for (s=0; s<nb_som_face; s++)
905 {
906 meshPbForceFace_(i,j) += ff(face_sommets(i,s),j);
907 }
908 meshPbForceFace_(i,j)/=nb_som_face;
909 }
910 }
911
912}
913
914void Structural_dynamic_mesh_model::checkElemOrientation(int elnodes[4], const int elem)
915{
916
917 if (gridNStep == 0)
918 {
919 DoubleTab Jac(dimension, dimension) ;
920 double Det, Vol, Xlong ;
921 int nbn=0 ;
922
923 switch (dimension)
924 {
925 case (2) :
926 nbn = 3 ;
927
928 break ;
929 case (3) :
930 nbn = 4 ;
931
932 break ;
933 }
934
935 for (int i=0; i<nbn; i++)
936 {
937 int isom = elnodes[i] ;
938 for (int j=0; j<dimension; j++)
939 {
940 xl_(i,j) = x(isom,j) ;
941 }
942 }
943
944 Jac=0 ;
945 for (int k=0; k < nbn; k++)
946 {
947 for (int j=0; j < dimension; j++)
948 {
949 for (int i=0; i < dimension ; i++)
950 {
951 Jac(j,i) += Eta_(j,k) * xl_(k,i) ;
952 }
953 }
954 }
955
956 switch (dimension)
957 {
958 case (2) :
959 Det = Jac(0,0) * Jac(1,1) - Jac(0,1) * Jac(1,0) ;
960 triangleSurfLength_(Vol, Xlong, Det) ;
961
962 break ;
963 case (3) :
964 Det= Jac(0,0) * (Jac(1,1) * Jac(2,2) - Jac(1,2) * Jac(2,1))
965 - Jac(0,1) * (Jac(1,0) * Jac(2,2) - Jac(1,2) * Jac(2,0))
966 + Jac(0,2) * (Jac(1,0) * Jac(2,1) - Jac(1,1) * Jac(2,0)) ;
967 tetrahedronVolLength_(Vol, Xlong, Det) ;
968
969 break ;
970 }
971
972 if (Vol <= 0.) invertNum_[elem] = 1 ;
973
974 }
975
976 if (invertNum_[elem] == 1)
977 {
978 // negative volume in mesh numbering, invert vertices numbering in elnodes
979 int i1, i2, i3, i4 ;
980
981 switch (dimension)
982 {
983 case (2) :
984 i1 = elnodes[0] ;
985 i2 = elnodes[1] ;
986 i3 = elnodes[2] ;
987 elnodes[0] = i1 ;
988 elnodes[1] = i3 ;
989 elnodes[2] = i2 ;
990
991 break ;
992 case (3) :
993 i1 = elnodes[0] ;
994 i2 = elnodes[1] ;
995 i3 = elnodes[2] ;
996 i4 = elnodes[3] ;
997 elnodes[0] = i3 ;
998 elnodes[1] = i2 ;
999 elnodes[2] = i1 ;
1000 elnodes[3] = i4 ;
1001 }
1002 }
1003
1004}
1005void Structural_dynamic_mesh_model::resumptionMesh(double tinit,DoubleTab& u_res_n, DoubleTab& v_res_n, DoubleTab& a_res_n, DoubleTab& x_res_n, DoubleTab& B0_res_n, DoubleTab& Ft_res_n, DoubleTab& Stress_res_n)
1006{
1007 u=u_res_n;
1008 v=v_res_n;
1009 a=a_res_n;
1010 x=x_res_n;
1011
1012 B0_=B0_res_n;
1013 Ft_=Ft_res_n;
1014 Stress_=Stress_res_n;
1015
1016 gridTime=tinit;
1017 resumption = 1;
1018}
1019
1020void Structural_dynamic_mesh_model::solveDynamicMeshProblem(const double temps, const DoubleTab& imposedVelocity, const IntVect& imposedVelocityTag,
1021 DoubleTab& outputMeshVelocity, const int nbSom, const int nbElem, const int nbSomElem,
1022 const IntTab& sommets, const int nbFace, const int nbSomFace, const IntTab& face_sommets, const Domaine_ALE& dom)
1023{
1024 DoubleTab x0( x) ; // Copy coordinates at the beginning of the step
1025 double tt = gridTime ;
1026
1027 double t0 = tt ;
1028 bool loopOnGridProblem = true ;
1029 int nstepCurr = 0 ;
1030
1031 if ( configurationResetDt > 0)
1032 {
1033 if (tt > gridResetTime)
1034 {
1037 }
1038 }
1039
1040 // ICoCo + FSI : accelerated mode to activate within implicit iteration with subcycling
1041 if ( iCoCoImplicitIteration <= 0) acceleratedSolution=0 ; // No iCoCo coupling or no possible acceleration at iteration 0
1042 else
1043 {
1044 if (! acceleratedSolutionEnabled) acceleratedSolution=0 ; // Acceleration disabled after zero mesh motion at iteration 0
1045 }
1046
1047 if ( acceleratedSolution == 1) Cerr << "Domaine_ALE::solveDynamicMeshProblem, accelerated solution with iCoCo implicit iteration: " << iCoCoImplicitIteration << finl ;
1048
1049 while (loopOnGridProblem)
1050 {
1051 // Adjust the grid time step for smooth arrival at time = temps
1052 if ( gridDt >= temps - tt)
1053 {
1054 gridDt = temps - tt ;
1055 loopOnGridProblem = false ; // final time reached after this last step
1056 }
1057 else if ( gridDt >= 0.5 * (temps - tt)) // Avoid excessive time step variations
1058 {
1059 gridDt = 0.5 * (temps - tt) ;
1060 }
1061
1062 double Dt ;
1063 if ( acceleratedSolution == 0)
1064 {
1065
1066 Dt = gridDt ;
1067
1068 // Update mid-step velocities, displacements and coordinates
1069
1070 for (int i=0; i<nbSom; i++)
1071 {
1072 int ii = dom.get_renum_som_perio(i) ; // to get imposed velocity from periodic boundaries if any
1073 for (int j=0; j<dimension; j++)
1074 {
1075 vp(i,j) = v(i,j) + 0.5 * Dt * a(i,j) ;
1076 if (imposedVelocityTag[i] == 1) vp(i,j) = imposedVelocity(ii,j) ; // Apply imposed velocity from the boundary
1077
1078 double du = Dt * vp(i,j) ;
1079 u(i,j) += du ;
1080 x(i,j) += du ;
1081 }
1082 }
1083 }
1084 else
1085 {
1086 // Accelerated mode
1087
1088 Dt = temps - tt ; // One step only
1089 loopOnGridProblem = false ;
1090 x= xLast ;
1091 vp= vpLast ;
1092
1093 // Update mid-step velocities, displacements and coordinates for nodes on FSI boundary only
1094
1095 for (int i=0; i<nbSom; i++)
1096 {
1097 int ii = dom.get_renum_som_perio(i) ; // to get imposed velocity from periodic boundaries if any
1098 for (int j=0; j<dimension; j++)
1099 {
1100 if (imposedVelocityTag[i] == 1)
1101 {
1102 vp(i,j) = imposedVelocity(ii,j) ; // Apply imposed velocity from the boundary
1103 double du = Dt * vp(i,j) ;
1104 u(i,j) += du ;
1105 x(i,j) = x0(i,j) + du ;
1106 }
1107 }
1108 }
1109 }
1110 if ( iCoCoImplicitIteration == 0 && !loopOnGridProblem)
1111 {
1112 xLast = x ;
1113 vpLast = vp ;
1114 dtLast = Dt ;
1115 }
1116
1117 tt += Dt ;
1118
1119 // Compute internal forces
1120 ff = 0. ;
1121 int nbn = getNbNodesPerElem() ;
1122 int elnodes[4] ;
1123 double volume ;
1124 double xlong ;
1125 double cSound ;
1126 double density = getDensity() ;
1127 double dtm = getGridDtMin() ;
1128 double dts ;
1129 double scaleMass ;
1130 double totalScaleMass = 0 ;
1131 double dtmin ;
1132 double pressure ;
1133 double vonmises ;
1134 double mm = 0 ;
1135
1136 dtmin = 1.E12 ; // Initialize dtmin at <huge>
1137 if (dtm > 0.) nodalScaleMass = 0. ; // Initialize nodal additional masses if needed
1138
1139 if (! isMassBuilt) totalMass = 0. ;
1140
1141 for (int elem=0; elem<nbElem; elem++)
1142 {
1143 for (int i=0; i< nbn; i++) elnodes[i] = sommets(elem,i) ;
1144
1145 if ( acceleratedSolution == 0) skipStressComputation = false ;
1146 else
1147 {
1148 skipStressComputation = true ; // No stress computation by default in accelerated mode
1149 for (int i=0; i< nbn; i++)
1150 {
1151 int ii=elnodes[i];
1152 if (imposedVelocityTag[ii] == 1) skipStressComputation = false ; // Compute stress for cells connected to the moving boundary
1153 }
1154 }
1155
1156 checkElemOrientation(elnodes, elem) ; // check orientation to ensure a positive element volume
1157
1158 setLocalFields(elnodes, elem) ; // x, u, B0 global to local + elem id
1159
1160 computeInternalForces(volume, xlong, cSound, pressure, vonmises) ; // local force computation on element elem
1161
1162 setGlobalFields(elnodes, pressure, vonmises) ; // ff back to global + store elem pressure and vonmises for postprocessing
1163
1164 if (! isMassBuilt)
1165 {
1166 setMassElem(volume * density) ;
1167 totalMass += volume * density ;
1168 for (int i=0; i< nbn; i++)
1169 {
1170 int ii = elnodes[i] ;
1171 mass[ii] += volume * density / nbn ;
1172 }
1173 }
1174
1175 // Set next time step
1176 dts = computeCriticalDt(volume, xlong, cSound, dtm, scaleMass) ;
1177 dtmin = std::min(dtmin, dts) ;
1178
1179 if (scaleMass > 0.)
1180 {
1181 totalScaleMass += scaleMass ;
1182 for (int i=0; i< nbn; i++)
1183 {
1184 int ii = elnodes[i] ;
1185 nodalScaleMass[ii] += scaleMass / nbn ;
1186 }
1187 }
1188 }
1189
1191
1192 gridDt = mp_min(dtmin) ;
1193
1195 if (! isMassBuilt)
1196 {
1199 isMassBuilt = true ;
1200 }
1201
1202 if (dtm > 0.)
1203 {
1204 totalScaleMass = mp_sum(totalScaleMass) ;
1205 if (totalScaleMass > 0.)
1206 {
1208 if ( maxAddedMassRatio > 0.)
1209 {
1210 double r = totalScaleMass / totalMass ;
1212 }
1213 }
1214 }
1215
1216 // Compute accelerations and full step velocities
1217 double rhs ;
1218 double den ;
1219 double d = getDampingCoefficient() ;
1220
1221 double dtUpdate=Dt ;
1222 if ( acceleratedSolution == 1) dtUpdate= dtLast ; // Accelerated mode: acceleration and velocity update must be done with the last stable dt
1223
1224 for (int i=0; i<nbSom; i++)
1225 {
1226 mm = mass[i] ;
1227 if (dtm > 0.) mm += nodalScaleMass[i] ;
1228 for (int j=0; j<dimension; j++)
1229 {
1230 rhs = - ff(i,j) - d * mm * vp(i,j) ;
1231 den = mm * (1. + 0.5 * d * dtUpdate) ;
1232 a(i,j) = rhs / den ;
1233 v(i,j) = vp(i,j) + 0.5 * dtUpdate * a(i,j) ;
1234 }
1235 }
1236
1237 gridNStep += 1 ;
1239 gridTime = tt ;
1240 nstepCurr += 1 ;
1241 if (dtm > 0.)
1242 {
1243 if ( acceleratedSolution == 0) Cerr << "Grid dynamic problem, internal step: "<< nstepCurr << ", dt= " << Dt << ", dt_stab= " << gridDt << ", [mass scaling] added_mass_ratio= "<< totalScaleMass / totalMass << ", time= " << tt << ", target fluid time= " << temps << finl ;
1244 else Cerr << "Grid dynamic problem, accelerated internal step: "<< nstepCurr << ", dt= " << Dt << ", [mass scaling] added_mass_ratio= "<< totalScaleMass / totalMass << ", time= " << tt << ", target fluid time= " << temps << finl ;
1245 }
1246 else
1247 {
1248 if ( acceleratedSolution == 0) Cerr << "Grid dynamic problem, internal step: "<< nstepCurr << ", dt= " << Dt << ", dt_stab= " << gridDt << ", time= " << tt << ", target fluid time= " << temps << finl ;
1249 else Cerr << "Grid dynamic problem, accelerated internal step: "<< nstepCurr << ", dt= " << Dt << ", time= " << tt << ", target fluid time= " << temps << finl ;
1250 }
1251
1252 } // End time loop on grid problem
1253
1254 if (tt > t0)
1255 {
1256 for (int i=0; i<nbSom; i++)
1257 {
1258 for (int j=0; j<dimension; j++)
1259 {
1260 outputMeshVelocity(i,j) = ( x(i,j) - x0(i,j)) / (tt - t0) ;
1261 }
1262 }
1263
1264 }
1265 else
1266 {
1267 outputMeshVelocity = 0. ;
1268 }
1269
1270 outputMeshVelocity.echange_espace_virtuel();
1271
1272 // Compute forces at face centers for postprocessing only
1273 computeForceFaces(nbFace,nbSomFace,face_sommets) ;
1274}
int_t get_renum_som_perio(int_t i) const
Definition Domaine.h:281
void reading_structural_dynamic_mesh_model(Entree &is)
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
static void creer_tableau_distribue(const MD_Vector &, Array_base &, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT)
transforme v en un tableau parallele ayant la structure md.
static void echange_espace_virtuel(IntVect &, Operations_echange opt=ECHANGE_EV, IsExchangeBlocking is_exchange_blocking=IsExchangeBlocking::DefaultBlocking, const std::string kernel_name="noname")
: Cette classe est un OWN_PTR mais l'objet pointe est partage entre plusieurs
Definition MD_Vector.h:48
friend class Entree
Definition Objet_U.h:76
static int dimension
Definition Objet_U.h:99
virtual Entree & readOn(Entree &)
Lecture d'un Objet_U sur un flot d'entree Methode a surcharger.
Definition Objet_U.cpp:293
virtual Sortie & printOn(Sortie &) const
Ecriture de l'objet sur un flot de sortie Methode a surcharger.
Definition Objet_U.cpp:282
static double mp_min(double)
Definition Process.cpp:386
static double mp_sum(double)
Calcule la somme de x sur tous les processeurs du groupe courant.
Definition Process.cpp:146
static void exit(int exit_code=-1)
Routine de sortie de TRUST dans une region Kokkos.
Definition Process.cpp:455
Classe de base des flux de sortie.
Definition Sortie.h:52
mgis::behaviour::BehaviourDataView mgisBehaviourData_
std::map< std::string, std::vector< double > > matp_
void triangleSurfLength_(double &aire, double &xlong, const double Det)
void load_behaviour_(StressMeasureKind smk, TangentOperatorKind tok)
void initDynamicMeshProblem(const double temps, const int nsom, const int nelem, const int nface, const MD_Vector &md, const MD_Vector &mde, const MD_Vector &mdf)
void setLocalFields(const int elnodes[4], const int elem)
void computeForceFaces(const int nb_faces, const int nb_som_face, const IntTab &face_sommets)
void resumptionMesh(double, DoubleTab &, DoubleTab &, DoubleTab &, DoubleTab &, DoubleTab &, DoubleTab &, DoubleTab &)
void integrate_behaviour_(double *const stress, double *const ivar, const double *const evar, double *const stiff, const double *const gradientOrStrain0, const double *const gradientOrStrain1, double *const vsound)
void tetrahedronVolLength_(double &vol, double &xlong, const double Det)
void solveDynamicMeshProblem(const double, const DoubleTab &, const IntVect &, DoubleTab &, const int, const int, const int, const IntTab &, const int, const int, const IntTab &, const Domaine_ALE &)
double computeCriticalDt(const double volume, const double xlong, const double cSound, const double dtMin, double &scaleMass)
void setGlobalFields(const int elnodes[4], const double Pressure, const double VonMises)
void computeInternalForces(double &volume, double &xlong, double &cSound, double &Pressure, double &VonMises)
void checkElemOrientation(int elnodes[4], const int elem)
virtual void echange_espace_virtuel(IsExchangeBlocking exchange_type=IsExchangeBlocking::DefaultBlocking, const std::string kernel_name="noname")