Arcane  v3.14.10.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
AdiProjectionModule.cc
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2023 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4// See the top-level COPYRIGHT file for details.
5// SPDX-License-Identifier: Apache-2.0
6//-----------------------------------------------------------------------------
7/*---------------------------------------------------------------------------*/
8/* AdiProjectionModule.cc (C) 2000-2023 */
9/* */
10/* Module de test d'une projection sur maillage cartésien. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
14#include "arcane/ITimeLoopMng.h"
15#include "arcane/ITimeLoopService.h"
16#include "arcane/ITimeLoop.h"
17#include "arcane/TimeLoopEntryPointInfo.h"
18
19#include "arcane/cea/ICartesianMesh.h"
20#include "arcane/cea/CellDirectionMng.h"
21#include "arcane/cea/NodeDirectionMng.h"
22
23#include "arcane/MeshAreaAccessor.h"
24#include "arcane/MeshArea.h"
25#include "arcane/ISubDomain.h"
26
27#include "arcane/IMesh.h"
28
29#include "arcane/accelerator/core/Runner.h"
30#include "arcane/accelerator/core/IAcceleratorMng.h"
31
34
35#include "arcane/tests/AdiProjection_axl.h"
36
37/*---------------------------------------------------------------------------*/
38/*---------------------------------------------------------------------------*/
39
40namespace Arcane
41{
42namespace ax = Arcane::Accelerator;
43
44/*---------------------------------------------------------------------------*/
45/*---------------------------------------------------------------------------*/
46
48: public ArcaneAdiProjectionObject
49{
50 public:
51
52 explicit AdiProjectionModule(const ModuleBuildInfo& mb);
54
55 public:
56
57 virtual VersionInfo versionInfo() const { return VersionInfo(1, 1, 1); }
58
59 public:
60
61 void copyEulerianCoordinates();
62 void cartesianHydroMain();
63 virtual void cartesianHydroStartInit();
64
65 public:
66
67 static void staticInitialize(ISubDomain* sd);
68
69 private:
70
71 ICartesianMesh* m_cartesian_mesh = nullptr;
72
73 private:
74
75 void evolvePrimalUpwindedVariables(Integer direction);
76 void evolveDualUpwindedVariables(Integer direction);
77 void computePressure();
78 void computePressureGradient(Integer direction);
79 void checkNodalMassConservation();
80 void copyCurrentVariablesToOldVariables();
81
82 void computePrimalMassFluxInner(Integer direction);
83
84 void computeDualMassFluxInner(Integer direction);
85 void prepareLagrangianVariables();
86 void checkLagrangianVariablesConsistency();
87
88 void _evolveDualUpwindedVariables1();
89 void _evolvePrimalUpwindedVariablesV2(Integer direction);
90
91 public:
92
93 // Fonctions publiques pour CUDA
94 void computePrimalMassFluxBoundary(Integer direction);
95 void computeDualMassFluxBoundary(Integer direction);
96};
97
98/*---------------------------------------------------------------------------*/
99/*---------------------------------------------------------------------------*/
100
101ARCANE_REGISTER_MODULE_ADIPROJECTION(AdiProjectionModule);
102
103/*---------------------------------------------------------------------------*/
104/*---------------------------------------------------------------------------*/
105
106AdiProjectionModule::
107AdiProjectionModule(const ModuleBuildInfo& mb)
108: ArcaneAdiProjectionObject(mb)
109{
110}
111
112/*---------------------------------------------------------------------------*/
113/*---------------------------------------------------------------------------*/
114
115AdiProjectionModule::
116~AdiProjectionModule()
117{
118}
119
120/*---------------------------------------------------------------------------*/
121/*---------------------------------------------------------------------------*/
122
123void AdiProjectionModule::
124copyCurrentVariablesToOldVariables()
125{
126 ENUMERATE_CELL (current_cell, allCells()) {
127
128 m_old_density[current_cell] = m_density[current_cell];
129 }
130
131 ENUMERATE_NODE (current_node, allNodes()) {
132
133 m_old_velocity[current_node] = m_velocity[current_node];
134 }
135}
136
137/*---------------------------------------------------------------------------*/
138/*---------------------------------------------------------------------------*/
139
140void AdiProjectionModule::
141prepareLagrangianVariables()
142{
143 // Position des noeuds après la phase Lagrange (= position des
144 // noeuds stockée dans le maillage).
145 VariableNodeReal3& nodes_coord = defaultMesh()->nodesCoordinates();
146 m_lagrangian_coordinates.copy(nodes_coord);
147
148 ENUMERATE_ (Node, inode, allNodes()) {
149
150 // Vitesse de déplacement des noeuds (valable en prédicteur correcteur).
151 m_lagrangian_velocity[inode] = 0.5 * (m_old_velocity[inode] + m_velocity[inode]);
152 }
153}
154
155/*---------------------------------------------------------------------------*/
156/*---------------------------------------------------------------------------*/
157
158void AdiProjectionModule::
159checkLagrangianVariablesConsistency()
160{
161 // Vérifier que : u * dt = x_lagrange - x_euler.
162
163 Real residu = 0.0;
164
165 ENUMERATE_NODE (current_node, allNodes()) {
166 }
167
168 info() << "Test de coherence vitesses lagrangiennes/positions lagrangiennes : residu="
169 << residu << "\n";
170
171 // masse = rho * volume.
172}
173
174/*---------------------------------------------------------------------------*/
175/*---------------------------------------------------------------------------*/
176
177void AdiProjectionModule::
178computePrimalMassFluxInner(Integer direction)
179{
180 ARCANE_UNUSED(direction);
181}
182
183/*---------------------------------------------------------------------------*/
184/*---------------------------------------------------------------------------*/
185
186void AdiProjectionModule::
187computePrimalMassFluxBoundary(Integer direction)
188{
189 info() << A_FUNCINFO;
190
191 auto queue = makeQueue(acceleratorMng()->defaultRunner());
192 auto command = makeCommand(queue);
193
194 auto inout_mass_flux_right = viewInOut(command, m_mass_flux_right);
195 auto inout_mass_flux_left = viewInOut(command, m_mass_flux_left);
196
197 CellDirectionMng cdm(m_cartesian_mesh->cellDirection(direction));
198
199 // Calcul des flux de masse pour les mailles de bord dans la direction de calcul.
200 command << RUNCOMMAND_ENUMERATE(Cell, current_cell, cdm.outerCells())
201 {
202 // Pour maille gauche/maille droite.
203 DirCellLocalId cc(cdm.dirCellId(current_cell));
204
205 CellLocalId right_cell = cc.next();
206 CellLocalId left_cell = cc.previous();
207
208 if (left_cell.isNull()) {
209 // Frontière gauche.
210
211 inout_mass_flux_right[current_cell] = inout_mass_flux_left[right_cell];
212 inout_mass_flux_left[current_cell] = inout_mass_flux_right[current_cell];
213 }
214 else if (right_cell.isNull()) {
215 // Frontière droite.
216
217 inout_mass_flux_left[current_cell] = inout_mass_flux_right[left_cell];
218 inout_mass_flux_right[current_cell] = inout_mass_flux_left[current_cell];
219 }
220 };
221}
222
223/*---------------------------------------------------------------------------*/
224/*---------------------------------------------------------------------------*/
225
226void AdiProjectionModule::
227computeDualMassFluxInner(Integer direction)
228{
229 ARCANE_UNUSED(direction);
230}
231
232/*---------------------------------------------------------------------------*/
233/*---------------------------------------------------------------------------*/
234
235void AdiProjectionModule::
236computeDualMassFluxBoundary(Integer direction)
237{
238 NodeDirectionMng ndm(m_cartesian_mesh->nodeDirection(direction));
239
240 auto queue = makeQueue(acceleratorMng()->defaultRunner());
241 auto command = makeCommand(queue);
242
243 auto inout_nodal_mass_flux_right = viewInOut(command, m_nodal_mass_flux_right);
244 auto inout_nodal_mass_flux_left = viewInOut(command, m_nodal_mass_flux_left);
245
246 // Calcul des flux de masse pour les mailles de bord dans la direction de calcul.
247 command << RUNCOMMAND_ENUMERATE(Node, current_node, ndm.outerNodes())
248 {
249 // Pour maille gauche/maille droite.
250 DirNodeLocalId cc(ndm.dirNodeId(current_node));
251
252 NodeLocalId right_node = cc.next();
253 NodeLocalId left_node = cc.previous();
254
255 if (left_node.isNull()) {
256 // Frontière gauche.
257
258 inout_nodal_mass_flux_left[current_node] = inout_nodal_mass_flux_left[right_node];
259 inout_nodal_mass_flux_right[current_node] = inout_nodal_mass_flux_right[right_node];
260 }
261 else if (right_node.isNull()) {
262 // Frontière droite.
263
264 inout_nodal_mass_flux_left[current_node] = inout_nodal_mass_flux_left[left_node];
265 inout_nodal_mass_flux_right[current_node] = inout_nodal_mass_flux_right[left_node];
266 }
267 };
268}
269
270/*---------------------------------------------------------------------------*/
271/*---------------------------------------------------------------------------*/
272
273// Calcul des quantités primales : densité, énergie interne.
274void AdiProjectionModule::
275evolvePrimalUpwindedVariables(Integer direction)
276{
277 if (0) {
278 _evolvePrimalUpwindedVariablesV2(direction);
279 return;
280 }
281 // En dur pour l'instant.
282 const Real time_step = m_global_deltat();
283 const Real dx = 0.005;
284
285 CellDirectionMng cdm(m_cartesian_mesh->cellDirection(direction));
286
287 // Boucle sur les mailles intérieures.
288
289 ENUMERATE_CELL (current_cell, cdm.innerCells()) {
290
291 // Pour maille gauche/maille droite.
292 DirCell cc(cdm.cell(*current_cell));
293
294 Cell::Index right_cell = cc.next();
295 Cell::Index left_cell = cc.previous();
296 //Cell::Index right_cell = right_cell_c;
297 //Cell::Index left_cell = left_cell_c;
298
299 // Pour maille/noeud directionnel.
300 DirCellNode cn(cdm.cellNode(*current_cell));
301
302 // Temporaire pour le 1d. En attendant la connectivite Maille/face directionnelle.
303
304 const Real3 left_face_velocity = m_lagrangian_velocity[cn.previousLeft()];
305 const Real left_face_velocity_dir = left_face_velocity.x;
306
307 const Real3 right_face_velocity = m_lagrangian_velocity[cn.nextLeft()];
308 const Real right_face_velocity_dir = right_face_velocity.x;
309
310 // Calcul des signes pour le décentrement.
311 const Real sign_left = (left_face_velocity_dir > 0.0 ? 1.0 : -1.0);
312 const Real sign_right = (right_face_velocity_dir > 0.0 ? 1.0 : -1.0);
313
314 Real m_nrj_left_cell = m_nrj[left_cell];
315 Real m_nrj_right_cell = m_nrj[right_cell];
316 Real m_nrj_current_cell = m_nrj[current_cell];
317
318 const Real dmass_left = 0.5 * left_face_velocity_dir *
319 ((m_density[current_cell] + m_density[left_cell]) -
320 sign_left * (m_density[current_cell] - m_density[left_cell]));
321
322 const Real dmass_right = 0.5 * right_face_velocity_dir *
323 ((m_density[right_cell] + m_density[current_cell]) -
324 sign_right * (m_density[right_cell] - m_density[current_cell]));
325
326 m_mass_flux_left[current_cell] = dmass_left;
327 m_mass_flux_right[current_cell] = dmass_right;
328
329 m_density[current_cell] =
330 m_density[current_cell] - time_step * (dmass_right - dmass_left) / dx;
331
332 // Décentrement énergie interne.
333 const Real nrj_left = 0.5 *
334 ((m_nrj_current_cell + m_nrj_left_cell) -
335 sign_left * (m_nrj_current_cell - m_nrj_left_cell));
336
337 const Real nrj_right = 0.5 *
338 ((m_nrj_right_cell + m_nrj_current_cell) -
339 sign_right * (m_nrj_right_cell - m_nrj_current_cell));
340
341 Real nrj_current_cell = m_old_density[current_cell] * m_nrj_current_cell -
342 time_step * (nrj_right * dmass_right - nrj_left * dmass_left) / dx;
343
344 // Terme source PdV.
345 nrj_current_cell = nrj_current_cell -
346 time_step * m_pressure[current_cell] * (right_face_velocity_dir - left_face_velocity_dir) / dx;
347
348 if (m_density[current_cell] != 0.0) {
349
350 nrj_current_cell /= m_density[current_cell];
351 }
352 else {
353
354 info() << "Erreur, densite nulle.\n";
355 std::abort();
356 }
357 m_nrj[current_cell] = nrj_current_cell;
358 }
359
360 computePrimalMassFluxBoundary(direction);
361}
362
363/*---------------------------------------------------------------------------*/
364/*---------------------------------------------------------------------------*/
365
366// Calcul des quantités primales : densité, énergie interne.
367void AdiProjectionModule::
368_evolvePrimalUpwindedVariablesV2(Integer direction)
369{
370 // En dur pour l'instant.
371 const Real time_step = m_global_deltat();
372 const Real dx = 0.005;
373
374 CellDirectionMng cdm(m_cartesian_mesh->cellDirection(direction));
375
376 // Boucle sur les mailles intérieures.
377
378 VariableCellReal& nrj = m_nrj;
379 VariableCellReal& old_density = m_old_density;
380 VariableCellReal& density = m_density;
381 VariableCellReal& pressure = m_pressure;
382
383 ENUMERATE_CELL (i_current_cell, cdm.innerCells()) {
384
385 // Pour maille gauche/maille droite.
386 DirCell cc(cdm.cell(*i_current_cell));
387
388 Cell right_cell_c = cc.next();
389 Cell left_cell_c = cc.previous();
390
391 Cell::Index current_cell = *i_current_cell;
392 Cell right_cell = right_cell_c;
393 Cell left_cell = left_cell_c;
394
395 // Pour maille/noeud directionnel.
396 DirCellNode cn(cdm.cellNode(*i_current_cell));
397
398 Real nrj_left_cell = nrj[left_cell];
399 Real nrj_right_cell = nrj[right_cell];
400 Real nrj_current_cell = nrj[current_cell];
401
402 // Temporaire pour le 1d. En attendant la connectivite Maille/face directionnelle.
403
404 const Real3 left_face_velocity = m_lagrangian_velocity[cn.previousLeft()];
405 const Real left_face_velocity_dir = left_face_velocity.x;
406
407 const Real3 right_face_velocity = m_lagrangian_velocity[cn.nextLeft()];
408 const Real right_face_velocity_dir = right_face_velocity.x;
409
410 // Calcul des signes pour le décentrement.
411 const Real sign_left = (left_face_velocity_dir > 0.0 ? 1.0 : -1.0);
412 const Real sign_right = (right_face_velocity_dir > 0.0 ? 1.0 : -1.0);
413
414 const Real dmass_left = 0.5 * left_face_velocity_dir *
415 ((density[current_cell] + density[left_cell]) -
416 sign_left * (density[current_cell] - density[left_cell]));
417
418 const Real dmass_right = 0.5 * right_face_velocity_dir *
419 ((density[right_cell] + density[current_cell]) -
420 sign_right * (density[right_cell] - density[current_cell]));
421
422 m_mass_flux_left[i_current_cell] = dmass_left;
423 m_mass_flux_right[i_current_cell] = dmass_right;
424
425 density[current_cell] = density[current_cell] - time_step * (dmass_right - dmass_left) / dx;
426
427 // Décentrement énergie interne.
428 const Real nrj_left = 0.5 * ((nrj_current_cell + nrj_left_cell) - sign_left * (nrj_current_cell - nrj_left_cell));
429
430 const Real nrj_right = 0.5 * ((nrj_right_cell + nrj_current_cell) - sign_right * (nrj_right_cell - nrj_current_cell));
431
432 nrj_current_cell = old_density[current_cell] * nrj_current_cell - time_step * (nrj_right * dmass_right - nrj_left * dmass_left) / dx;
433
434 // Terme source PdV.
435 nrj_current_cell = nrj_current_cell - time_step * pressure[current_cell] * (right_face_velocity_dir - left_face_velocity_dir) / dx;
436
437 nrj[current_cell] = nrj_current_cell;
438
439 if (density[current_cell] != 0.0) {
440
441 nrj[current_cell] /= density[current_cell];
442 }
443 else {
444
445 info() << "Erreur, densite nulle.\n";
446 std::abort();
447 }
448 }
449
450 computePrimalMassFluxBoundary(direction);
451}
452
453/*---------------------------------------------------------------------------*/
454/*---------------------------------------------------------------------------*/
455
456void AdiProjectionModule::
457computePressureGradient(Integer direction)
458{
459 ENUMERATE_NODE (current_node, allNodes()) {
460
461 // Le gradient de pression est une variable temporaire qui peut a
462 // priori être cumulée. Il vaut mieux la mettre à 0.
463 m_pressure_gradient[current_node] = 0.0;
464 }
465
466 CellDirectionMng cdm(m_cartesian_mesh->cellDirection(direction));
467
468 ENUMERATE_CELL (current_cell, cdm.innerCells()) {
469
470 // Pour maille gauche/maille droite.
471 DirCell cc(cdm.cell(*current_cell));
472
473 //Cell right_cell = cc.next();
474 Cell left_cell = cc.previous();
475
476 // Pour maille/noeud directionnel.
477 DirCellNode cn(cdm.cellNode(*current_cell));
478
479 //GG: est-ce current_cell ou right_cell ?
480 const Real current_pressure_gradient = m_pressure[current_cell] - m_pressure[left_cell];
481
482 // Chaque point du maillage (sauf aux bords) aura son gradient de
483 // pression calculé 2 fois, mais ca n'est pas grave...
484 m_pressure_gradient[cn.previousLeft()] = current_pressure_gradient;
485 m_pressure_gradient[cn.previousRight()] = current_pressure_gradient;
486 }
487}
488
489/*---------------------------------------------------------------------------*/
490/*---------------------------------------------------------------------------*/
491// Calcul des quantités duales : vitesse (quantité de mouvement).
492void AdiProjectionModule::
493evolveDualUpwindedVariables(Integer direction)
494{
495 NodeDirectionMng ndm(m_cartesian_mesh->nodeDirection(direction));
496
497 // En dur pour l'instant.
498 const Real time_step = m_global_deltat();
499 const Real dx = 0.005;
500
501 _evolveDualUpwindedVariables1();
502
503 computeDualMassFluxBoundary(direction);
504
505 computePressureGradient(direction);
506
507 ENUMERATE_NODE (current_node, ndm.innerNodes()) {
508
509 DirNode dir_node(ndm[current_node]);
510 Node left_node = dir_node.previous();
511 Node right_node = dir_node.next();
512
513 const Real sign_left = (m_nodal_mass_flux_left[current_node] > 0.0 ? 1.0 : -1.0);
514 const Real sign_right = (m_nodal_mass_flux_right[current_node] > 0.0 ? 1.0 : -1.0);
515
516 const Real3 nodal_velocity_right =
517 0.5 * ((m_old_velocity[right_node] + m_old_velocity[current_node]) - sign_right * (m_old_velocity[right_node] - m_old_velocity[current_node]));
518
519 const Real3 nodal_velocity_left =
520 0.5 * ((m_old_velocity[current_node] + m_old_velocity[left_node]) - sign_left * (m_old_velocity[current_node] - m_old_velocity[left_node]));
521
522 m_lagrangian_velocity[current_node] =
523 m_old_nodal_density[current_node] * m_lagrangian_velocity[current_node] -
524 time_step * (m_nodal_mass_flux_right[current_node] * nodal_velocity_right - m_nodal_mass_flux_left[current_node] * nodal_velocity_left) / dx;
525
526 m_lagrangian_velocity[current_node].x -= time_step * m_pressure_gradient[current_node] / dx;
527
528 if (m_nodal_density[current_node] != 0.0) {
529
530 m_lagrangian_velocity[current_node] /= m_nodal_density[current_node];
531 }
532 else {
533
534 info() << "Probleme : densite nodale nulle.\n";
535
536 std::abort();
537 }
538
539 m_velocity[current_node] = m_lagrangian_velocity[current_node];
540 }
541}
542
543/*---------------------------------------------------------------------------*/
544/*---------------------------------------------------------------------------*/
545
546// Calcul des quantités duales : vitesse (quantité de mouvement).
547void AdiProjectionModule::
548_evolveDualUpwindedVariables1()
549{
550 ENUMERATE_NODE (current_node, ownNodes()) {
551
552 const Node& node = *current_node;
553
554 const Integer nb_cells = node.nbCell();
555 if (nb_cells == 0)
556 ARCANE_FATAL("No cell attached to the node");
557
558 // Densités nodales.
559
560 Real nodal_density_sum = 0.0;
561 Real old_nodal_density_sum = 0.0;
562 Real nodal_mass_flux_right_accumulation = 0.0;
563 Real nodal_mass_flux_left_accumulation = 0.0;
564
565 for (Cell node_cell : node.cells() ) {
566
567 nodal_density_sum += m_density[node_cell];
568 old_nodal_density_sum += m_old_density[node_cell];
569 nodal_mass_flux_right_accumulation += m_mass_flux_right[node_cell];
570 nodal_mass_flux_left_accumulation += m_mass_flux_left[node_cell];
571 }
572
573 m_nodal_density[current_node] = nodal_density_sum / nb_cells;
574 m_old_nodal_density[current_node] = old_nodal_density_sum / nb_cells;
575 m_nodal_mass_flux_right[current_node] = nodal_mass_flux_right_accumulation / nb_cells;
576 m_nodal_mass_flux_left[current_node] = nodal_mass_flux_left_accumulation / nb_cells;
577 }
578}
579
580/*---------------------------------------------------------------------------*/
581/*---------------------------------------------------------------------------*/
582
583// Application de l'équation d'état. En dur (gaz parfaits, gamma=1.4)
584// pour l'instant.
585void AdiProjectionModule::
586computePressure()
587{
588
589 ENUMERATE_CELL (current_cell, allCells()) {
590
591 const Real gamma = 1.4;
592
593 m_pressure[current_cell] =
594 (gamma - 1.0) * m_density[current_cell] * m_nrj[current_cell];
595 }
596}
597
598/*---------------------------------------------------------------------------*/
599/*---------------------------------------------------------------------------*/
600
601// On doit avoir conservation de la masse nodale (calculée au moment
602// du décentrement de la quantité de mouvement, à partir de la masse
603// aux mailles). C'est un diagnostic utile.
604void AdiProjectionModule::
605checkNodalMassConservation()
606{
607
608 // En dur pour l'instant.
609 const Real time_step = m_global_deltat();
610 const Real dx = 0.005;
611
612 ENUMERATE_NODE (current_node, ownNodes()) {
613
614 m_delta_mass[current_node] =
615 m_nodal_density[current_node] - m_old_nodal_density[current_node] +
616 time_step * (m_nodal_mass_flux_right[current_node] - m_nodal_mass_flux_left[current_node]) / dx;
617 }
618}
619
620/*---------------------------------------------------------------------------*/
621/*---------------------------------------------------------------------------*/
622
623// ATTENTION : à appeler AVANT la phase Lagrange...
624void AdiProjectionModule::
625copyEulerianCoordinates()
626{
627 VariableNodeReal3& nodes_coord = defaultMesh()->nodesCoordinates();
628 m_eulerian_coordinates.copy(nodes_coord);
629}
630
631/*---------------------------------------------------------------------------*/
632/*---------------------------------------------------------------------------*/
633
634void AdiProjectionModule::
635cartesianHydroStartInit()
636{
637 m_global_deltat = 1.0;
638 m_lagrangian_velocity.fill(Real3::zero());
639 m_old_velocity.fill(Real3::zero());
640 m_velocity.fill(Real3::zero());
641
642 // Création des infos de connectivités directionnelles (= cartésiennes).
643 IMesh* mesh = defaultMesh();
644
645 m_cartesian_mesh = arcaneCreateCartesianMesh(mesh);
646 m_cartesian_mesh->computeDirections();
647
648 // Initialise l'énergie interne en supposant qu'on a un gaz parfait.
649 ENUMERATE_CELL (icell, allCells()) {
650 Real pressure = m_pressure[icell];
651 Real adiabatic_cst = 1.4;
652 Real density = m_density[icell];
653 m_nrj[icell] = pressure / ((adiabatic_cst - 1.) * density);
654 }
655}
656
657/*---------------------------------------------------------------------------*/
658/*---------------------------------------------------------------------------*/
659
660void AdiProjectionModule::
661cartesianHydroMain()
662{
663
664 copyEulerianCoordinates();
665
666 copyCurrentVariablesToOldVariables();
667
668 //prepareLagrangianVariables();
669
670 //checkLagrangianVariablesConsistency();
671
672 const Integer direction_x = 0;
673
674 evolvePrimalUpwindedVariables(direction_x);
675
676 evolveDualUpwindedVariables(direction_x);
677
678 computePressure();
679
680 checkNodalMassConservation();
681}
682
683/*---------------------------------------------------------------------------*/
684/*---------------------------------------------------------------------------*/
685
686void AdiProjectionModule::
687staticInitialize(ISubDomain* sd)
688{
689 String time_loop_name("AdiProjectionTestLoop");
690
691 ITimeLoopMng* tlm = sd->timeLoopMng();
692 ITimeLoop* time_loop = tlm->createTimeLoop(time_loop_name);
693
694 {
695 List<TimeLoopEntryPointInfo> clist;
696 clist.add(TimeLoopEntryPointInfo("AdiProjection.CartesianHydroStartInit"));
697 time_loop->setEntryPoints(ITimeLoop::WInit, clist);
698 }
699
700 /*{
701 List<TimeLoopEntryPointInfo> clist;
702 clist.add(TimeLoopEntryPointInfo("AdiProjection.init"));
703 time_loop->setEntryPoints(ITimeLoop::WInit,clist);
704 }*/
705
706 {
707 List<TimeLoopEntryPointInfo> clist;
708 clist.add(TimeLoopEntryPointInfo("AdiProjection.CartesianHydroMain"));
709 time_loop->setEntryPoints(ITimeLoop::WComputeLoop, clist);
710 }
711
712 {
713 StringList clist;
714 clist.add("AdiProjection");
715 time_loop->setRequiredModulesName(clist);
716 clist.clear();
717 clist.add("ArcanePostProcessing");
718 clist.add("ArcaneCheckpoint");
719 time_loop->setOptionalModulesName(clist);
720 }
721
722 tlm->registerTimeLoop(time_loop);
723}
724
725/*---------------------------------------------------------------------------*/
726/*---------------------------------------------------------------------------*/
727
728} // namespace Arcane
729
730/*---------------------------------------------------------------------------*/
731/*---------------------------------------------------------------------------*/
#define ARCANE_FATAL(...)
Macro envoyant une exception FatalErrorException.
#define ENUMERATE_(type, name, group)
Enumérateur générique d'un groupe d'entité
#define ENUMERATE_CELL(name, group)
Enumérateur générique d'un groupe de mailles.
#define ENUMERATE_NODE(name, group)
Enumérateur générique d'un groupe de noeuds.
Types et macros pour gérer les énumérations des entités sur les accélérateurs.
#define RUNCOMMAND_ENUMERATE(ItemTypeName, iter_name, item_group,...)
Macro pour itérer sur accélérateur sur un groupe d'entités.
Interface d'un maillage cartésien.
virtual CellDirectionMng cellDirection(eMeshDirection dir)=0
Liste des mailles dans la direction dir.
virtual NodeDirectionMng nodeDirection(eMeshDirection dir)=0
Liste des noeuds dans la direction dir.
virtual void computeDirections()=0
Calcule les infos pour les accès par direction.
Interface du gestionnaire d'un sous-domaine.
Definition ISubDomain.h:74
static const char * WComputeLoop
appelé pendant la boucle de calcul
Definition ITimeLoop.h:48
static const char * WInit
appelé pendant l'initialisation, l'initialisation d'une reprise ou d'un nouveau cas
Definition ITimeLoop.h:52
Lecteur des fichiers de maillage via la bibliothèque LIMA.
Definition Lima.cc:120
Informations pour construire un module.
Informations sur une version.
Definition VersionInfo.h:46
MeshVariableScalarRefT< Cell, Real > VariableCellReal
Grandeur au centre des mailles de type réel.
MeshVariableScalarRefT< Node, Real3 > VariableNodeReal3
Grandeur au noeud de type coordonnées.
Espace de nom pour l'utilisation des accélérateurs.
auto viewInOut(RunCommand &cmd, CellMaterialVariableScalarRef< DataType > &var)
Vue en lecture/écriture pour les variables materiaux scalaire.
RunCommand makeCommand(const RunQueue &run_queue)
Créé une commande associée à la file run_queue.
RunQueue makeQueue(const Runner &runner)
Créé une file associée à runner.
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
List< String > StringList
Tableau de chaînes de caractères unicode.
Definition UtilsTypes.h:667
Int32 Integer
Type représentant un entier.