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