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