12#include "arcane/aleph/tests/AlephTest.h"
13#include "arcane/aleph/tests/AlephMultiTest_axl.h"
14#include "arcane/aleph/tests/AlephMultiTest.h"
35 , m_sub_domain(subDomain)
46 , m_get_solution_idx(0)
48 info() << Trace::Color::cyan() <<
"[AlephSolver] New solver "
50 <<
"underlying solver is '" << underlyingSolver <<
"', "
56 m_vector_zeroes.
add(0.0);
61 info() << Trace::Color::cyan() <<
"[AlephSolver] Delet solver";
62 delete m_aleph_kernel;
63 delete m_aleph_params;
77 indexs.resize(m_aleph_number_of_resolutions_per_solvers);
78 values.resize(m_aleph_number_of_resolutions_per_solvers);
81 i < m_aleph_number_of_resolutions_per_solvers;
85 i, m_delta_t, values[i],
indexs[i]);
88 for (
int i = m_aleph_number_of_resolutions_per_solvers - 1; i >= 0; i -= 1) {
89 debug() << Trace::Color::cyan() <<
"[AlephSolver::launchResolutions] Getting solution #" << i;
91 if (i != m_get_solution_idx)
93 info() << Trace::Color::cyan() <<
"Solved in \33[7m" <<
nb_iteration <<
"\33[m iterations,"
95 debug() << Trace::Color::cyan() <<
"[AlephSolver::launchResolutions] Applying solution #" << m_get_solution_idx;
96 solution->getLocalComponents(values[i]);
97 m_get_solution_idx += 1;
99 m_get_solution_idx %= m_aleph_number_of_resolutions_per_solvers;
101 debug() << Trace::Color::cyan() <<
"[AlephSolver::launchResolutions] Now get our results";
104 values[m_get_solution_idx][m_aleph_kernel->indexing()->get(
cell_temperature, *cell)];
105 debug() << Trace::Color::cyan() <<
"[AlephSolver::launchResolutions] done";
124 debug() << Trace::Color::cyan()
125 <<
"[AlephSolver::postSingleResolution] Resize (" << m_vector_zeroes.
size()
126 <<
") + remplissage du second membre";
127 values.resize(m_vector_zeroes.
size());
136 debug() << Trace::Color::cyan() <<
"[AlephSolver::postSingleResolution] ENUMERATE_FACE";
138 if (!
iFace->cell(0).isOwn())
145 m_aleph_mat.setAt(i, m_aleph_kernel->createSolverMatrix());
149 m_aleph_mat.at(i)->create();
150 m_aleph_rhs.at(i)->create();
151 m_aleph_sol.at(i)->create();
152 m_aleph_mat.at(i)->reset();
156 m_aleph_mat.at(i)->assemble();
158 debug() << Trace::Color::cyan() <<
"[AlephSolver::postSingleResolution] setLocalComponents";
160 m_aleph_rhs.at(i)->setLocalComponents(values.view());
161 m_aleph_rhs.at(i)->assemble();
164 m_aleph_sol.at(i)->setLocalComponents(m_vector_zeroes.
view());
165 m_aleph_sol.at(i)->assemble();
167 debug() << Trace::Color::cyan() <<
"\33[37m[AlephSolver::postSingleResolution] Now solve with Aleph";
168 m_aleph_mat.at(i)->solve(m_aleph_sol.at(i),
188 debug() << Trace::Color::cyan() <<
"[AlephSolver::setValues] inner-faces";
190 if (
iFace->backCell().isOwn()) {
197 if (
iFace->frontCell().isOwn()) {
205 debug() << Trace::Color::cyan() <<
"[AlephSolver::setValues] outer-faces";
207 if (!
iFace->cell(0).isOwn())
211 debug() << Trace::Color::cyan() <<
"[AlephSolver::setValues] diagonale";
215 1.0 + deltaT *
coefs[cell]);
217 debug() << Trace::Color::cyan() <<
"[AlephSolver::setValues] done";
242 Integer m_aleph_number_of_resolutions_per_solvers;
258: ArcaneAlephMultiTestObject(
mbi)
266 delete m_aleph_factory;
267 debug() << Trace::Color::cyan() <<
"[AlephMultiTest::AlephMultiTest] Delete";
268 for (Integer i = 0, n = m_global_aleph_solver.size(); i < n; ++i)
269 delete m_global_aleph_solver[i];
282 m_global_deltat = options()->deltaT;
284 m_cell_temperature.fill(options()->iniTemperature());
287 m_face_temperature[
iFace] = options()->hotTemperature();
289 mesh()->checkValidMeshFull();
292 for (Integer i = 0; i < options()->alephNumberOfSuccessiveSolvers(); ++i) {
297 <<
" because implementation is not available";
301 sbi.m_number_of_resolution_per_solvers = (options()->alephNumberOfResolutionsPerSolvers >> (4ul * i)) & 0xFul;
303 sbi.m_number_of_core = (options()->alephNumberOfCores >> (4ul * i)) & 0xFul;
304 m_solvers_build_info.add(
sbi);
308 for (Integer i = 0, n = m_solvers_build_info.size(); i < n; ++i) {
309 const SolverBuildInfo&
sbi = m_solvers_build_info[i];
310 m_global_aleph_solver.add(
new AlephSolver(traceMng(), subDomain(),
311 sbi.m_number_of_resolution_per_solvers,
312 sbi.m_underliying_solver,
313 sbi.m_number_of_core,
325 for (Integer i = 0, n = m_solvers_build_info.size(); i < n; ++i) {
326 const SolverBuildInfo&
sbi = m_solvers_build_info[i];
330 sbi.m_number_of_resolution_per_solvers,
331 sbi.m_underliying_solver,
332 sbi.m_number_of_core,
334 m_posted_solvers.add(s);
335 s->launchResolutions(m_cell_temperature, m_face_temperature);
337 m_global_aleph_solver.at(i)->launchResolutions(m_cell_temperature, m_face_temperature);
341 if (subDomain()->commonVariables().globalIteration() >= options()->iterations)
342 subDomain()->timeLoopMng()->stopComputeLoop(
true);
AlephVector * createSolverVector(void)
AlephVector * syncSolver(Integer, Integer &, Real *)
Matrice d'un système linéaire.
Paramètres d'un système linéraire.
Vecteur d'un système linéaire.
Interface du gestionnaire d'un sous-domaine.
virtual IMesh * defaultMesh()=0
Maillage par défaut.
Node node(Int32 i) const
i-ème noeud de l'entité
Int32 nbNode() const
Nombre de noeuds de l'entité
Lecteur des fichiers de maillage via la bibliothèque LIMA.
Accès aux informations d'un maillage.
CellGroup allCells() const
Retourne le groupe contenant toutes les mailles.
CellGroup ownCells() const
Retourne le groupe contenant toutes les mailles propres à ce domaine.
VariableNodeReal3 & nodesCoordinates() const
Retourne les coordonnées des noeuds du maillage.
Informations pour construire un module.
Classe gérant un vecteur de réel de dimension 3.
Paramètres nécessaires à la construction d'une variable.
Integer size() const
Nombre d'éléments du vecteur.
ArrayView< T > view() const
Vue mutable sur ce tableau.
void add(ConstReferenceType val)
Ajoute l'élément val à la fin du tableau.
Exception lorsqu'une erreur fatale est survenue.
Interface du gestionnaire de traces.
Classe d'accès aux traces.
ITraceMng * traceMng() const
Gestionnaire de trace.
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
Int32 Integer
Type représentant un entier.