13#include "arcane/utils/ScopedPtr.h"
15#include "arcane/aleph/tests/AlephTest.h"
16#include "arcane/aleph/tests/AlephIndexTest.h"
17#include "arcane/aleph/tests/AlephIndexTest_axl.h"
33:
public ArcaneAlephIndexTestObject
64: ArcaneAlephIndexTestObject(
mbi)
69, m_get_solution_idx(0)
79 debug() <<
"[AlephIndexTest::AlephIndexTest] Delete & Free";
88 m_nb_solver = options()->alephNumberOfSolvers;
90 m_aleph_mat.resize(m_nb_solver);
91 m_aleph_rhs.resize(m_nb_solver);
92 m_aleph_sol.resize(m_nb_solver);
93 m_aleph_params.resize(m_nb_solver);
96 m_global_deltat = 1.0;
99 m_cell_temperature.fill(options()->initTemperature());
100 m_face_temperature.fill(options()->initTemperature());
103 for (
int i = options()->boundaryCondition.size() - 1; i >= 0; --i) {
104 Real
temperature = options()->boundaryCondition[i]->value();
110 mesh()->checkValidMeshFull();
116 m_aleph_kernel =
new AlephKernel(subDomain(), 2, 1);
120 m_vector_zeroes.
add(0.0);
135 if (m_nb_solver == 0) {
136 subDomain()->timeLoopMng()->stopComputeLoop(
true);
140 indexs.resize(m_nb_solver);
141 values.resize(m_nb_solver);
142 for (
int i = 0; i < m_nb_solver; ++i)
143 postSolver(i, options()->deltaT, values[i],
indexs[i]);
146 for (
int i = m_nb_solver - 1; i >= 0; --i) {
147 debug() <<
"[AlephIndexTest::compute] Getting solution #" << i;
149 if (i != m_get_solution_idx)
151 debug() <<
"Solved in \33[7m" <<
nb_iteration <<
"\33[m iterations,"
153 debug() <<
"[AlephIndexTest::compute] Applying solution #" << m_get_solution_idx;
154 solution->getLocalComponents(values[i]);
155 m_get_solution_idx += 1;
157 m_get_solution_idx %= m_nb_solver;
160 debug() <<
"[AlephIndexTest::compute] Now get our results";
162 m_cell_temperature[cell] = values[m_get_solution_idx][m_aleph_kernel->indexing()->get(m_cell_temperature, *cell)];
165 if (subDomain()->commonVariables().globalIteration() >= options()->iterations)
166 subDomain()->timeLoopMng()->stopComputeLoop(
true);
199 "SolveErrorAlephMatrix.dbg",
208 TypesSolver::SymHybGSJ_smoother,
209 TypesSolver::ParallelRugeStuben,
210 TypesSolver::CG_coarse_solver,
216 debug() <<
"[AlephIndexTest::compute] Resize (" << m_vector_zeroes.
size() <<
") + remplissage du second membre";
217 values.resize(m_vector_zeroes.
size());
220 Integer row = m_aleph_kernel->indexing()->get(m_cell_temperature, cell);
222 values[row] = m_cell_temperature[cell];
225 debug() <<
"[AlephIndexTest::compute] ENUMERATE_FACE";
227 if (!
iFace->cell(0).isOwn())
229 values[m_aleph_kernel->indexing()->get(m_cell_temperature,
iFace->cell(0))] +=
230 deltaT * (m_face_temperature[
iFace]) / geoFaceSurface(*
iFace, nodesCoordinates());
234 m_aleph_mat[i] = m_aleph_kernel->createSolverMatrix();
238 m_aleph_mat[i]->create();
239 m_aleph_rhs[i]->create();
240 m_aleph_sol[i]->create();
241 m_aleph_mat[i]->reset();
244 setValues(deltaT, m_aleph_mat[i]);
245 m_aleph_mat[i]->assemble();
247 debug() <<
"[AlephIndexTest::job] setLocalComponents";
249 m_aleph_rhs[i]->setLocalComponents(values.view());
250 m_aleph_rhs[i]->assemble();
253 m_aleph_sol[i]->setLocalComponents(m_vector_zeroes.
view());
254 m_aleph_sol[i]->assemble();
255 debug() <<
"[AlephIndexTest::job] done setLocalComponents";
259 debug() <<
"[AlephIndexTest::job] Now solve with Aleph";
260 m_aleph_mat[i]->solve(m_aleph_sol[i],
266 debug() <<
"[AlephIndexTest::job] done with Aleph solve";
277 m_cell_coefs[
iCell] = 0.;
281 if (
iFace->backCell().isOwn()) {
282 const Real surface = geoFaceSurface(*
iFace, nodesCoordinates());
284 m_cell_temperature,
iFace->frontCell(),
286 m_cell_coefs[
iFace->backCell()] += 1.0 / surface;
288 if (
iFace->frontCell().isOwn()) {
289 const Real surface = geoFaceSurface(*
iFace, nodesCoordinates());
291 m_cell_temperature,
iFace->backCell(),
293 m_cell_coefs[
iFace->frontCell()] += 1.0 / surface;
296 debug() <<
"[AlephIndexTest::setValues] outer-faces";
298 if (!
iFace->cell(0).isOwn())
300 m_cell_coefs[
iFace->cell(0)] += 1.0 / geoFaceSurface(*
iFace, nodesCoordinates());
302 debug() <<
"[AlephIndexTest::setValues] diagonale";
304 aleph_mat->setValue(m_cell_temperature, cell,
305 m_cell_temperature, cell,
306 1.0 + deltaT * m_cell_coefs[cell]);
308 debug() <<
"[AlephIndexTest::setValues] done";
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.
Tableau d'items de types quelconques.
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.
Informations pour construire un module.
Classe gérant un vecteur de réel de dimension 3.
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.
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
Int32 Integer
Type représentant un entier.