7#include "arcane/aleph/tests/AlephTest.h"
8#include "arcane/aleph/tests/AlephTestScheme.h"
9#include "arcane/aleph/tests/AlephTestSchemeFaces.h"
11#include "arcane/mesh/CellFamily.h"
12#include "arcane/mesh/FaceFamily.h"
34 debug() <<
"\33[37m\t[AlephTestSchemeFaces::AlephTestSchemeFaces] New"
38AlephTestSchemeFaces::~AlephTestSchemeFaces(
void)
40 debug() <<
"\33[37m\t[AlephTestSchemeFaces::AlephTestSchemeFaces] Delete"
47void AlephTestSchemeFaces::
52 for (
int i =
module_options->boundaryCondition.size() - 1; i >= 0; --i) {
65void AlephTestSchemeFaces::
70 debug() <<
"\33[37m\t[AlephTestSchemeFaces::preFetchNumElementsForEachRow]"
78 if (
iFace->backCell().isOwn())
80 if (
iFace->frontCell().isOwn())
88void AlephTestSchemeFaces::
93 m_cell_coefs[
iCell] = 0.;
98 if (
iFace->backCell().isOwn()) {
101 m_cell_matrix_idx[
iFace->frontCell()], -deltaT / surface);
102 m_cell_coefs[
iFace->backCell()] += 1.0 / surface;
104 if (
iFace->frontCell().isOwn()) {
107 m_cell_matrix_idx[
iFace->backCell()], -deltaT / surface);
108 m_cell_coefs[
iFace->frontCell()] += 1.0 / surface;
111 debug() <<
"\33[37m[AlephTestSchemeFaces::setValues] outer-faces"
114 if (!
iFace->cell(0).isOwn())
118 debug() <<
"\33[37m[AlephTestSchemeFaces::setValues] diagonale"
123 debug() <<
"\33[37m[AlephTestSchemeFaces::setValues] done"
130bool AlephTestSchemeFaces::
136 debug() <<
"\33[37m[AlephTestModule::_FaceAmrRefine]"
148 if ((*iCell).level() == 1)
158 iItem.mutableItemBase().addFlags(ItemInternal::II_Refine);
165 debug() <<
"\33[37m[AlephTestModule::_amrRefine] NOW refine"
167 MESH_MODIFIER_REFINE_ITEMS(mesh());
173 for (Integer i = 0, is =
cells_lid.size(); i < is; ++i) {
177 for (Integer
j = 0,
js = CELL_NB_H_CHILDREN(cell);
j <
js; ++
j) {
180 auto faces =
allCells().
view()[CELL_H_CHILD(cell,
j).localId()].toCell().faces();
182 for (
Face face : faces){
183 if (face.isSubDomainBoundary()) {
185 m_face_temperature[face] = m_face_temperature[cell.
face(index)];
189 m_face_temperature[face] = 0;
196 debug() <<
"\33[37m[AlephTestModule::_amrRefine] done"
204bool AlephTestSchemeFaces::
210 debug() <<
"\33[37m[AlephTestModule::_FaceAmrCoarsen]"
230 if (cell.
level() == 1)
233 if (!CELL_HAS_H_CHILDREN(cell))
237 for (Integer
j = 0,
js = CELL_NB_H_CHILDREN(cell);
j <
js; ++
j)
238 coarsit &= CELL_H_CHILD(cell,
j).isActive();
243 for (Integer
j = 0,
js = CELL_NB_H_CHILDREN(cell);
j <
js; ++
j) {
245 newTs[
j] = values[m_cell_matrix_idx[CELL_H_CHILD(cell,
j)]];
254 for (Integer
j = 0,
js = CELL_NB_H_CHILDREN(cell);
j <
js; ++
j)
259 debug() <<
"\n\t\t\t\t\t\t[FaceAmrCoarsen] parent cell to COARSE #" << cell.
localId();
265 (*iCell).mutableItemBase().removeFlags(ItemInternal::II_CoarsenInactive);
266 ARCANE_ASSERT(((*iCell).isActive()), (
"Parent not active!"));
272 for (Integer
j = 0,
js = CELL_NB_H_CHILDREN(cell);
j <
js; ++
j) {
274 CELL_H_CHILD(cell,
j).mutableItemBase().setFlags(CELL_H_CHILD(cell,
j).itemBase().flags() | ItemInternal::II_Inactive);
280 for(
Face face : parent.faces()) {
281 if ((!face.backCell().null()) && (!face.frontCell().null())) {
282 debug() <<
"\t\t\t[FaceAmrCoarsen] FOCUS face #" << face.localId() <<
", "
283 << face.backCell().localId() <<
"->"
284 << face.frontCell().localId();
286 const Cell&
neighbour = (face.backCell().localId() == parent.
localId()) ? face.frontCell() : face.backCell();
290 ARCANE_ASSERT((
neighbour.level() == 0), (
"Wrong neighbour level!"));
294 debug() <<
"\t\t\t[FaceAmrCoarsen] neighbour is ACTIVE";
295 debug() <<
"\t\t\t[FaceAmrCoarsen] hit: face_" << face.localId() <<
": " <<
neighbour.localId() <<
"->" << parent.
localId();
312 auto faces = CELL_H_CHILD(
neighbour,
j).faces();
313 for (
Face face : faces){
314 if (face.backCell().null())
316 if (face.frontCell().null())
319 Cell other = (face.frontCell().localId() == CELL_H_CHILD(
neighbour,
j).localId()) ? face.backCell() : face.frontCell();
323 if (other.
level() == 0)
327 if (CELL_H_PARENT(other).localId() != parent.
localId())
330 debug() <<
"\t\t\t\t[FaceAmrCoarsen] hit: face_" << face.localId() <<
": " << CELL_H_CHILD(
neighbour,
j).localId() <<
"->" << parent.
localId();
342 else if (face.backCell().null()) {
343 debug() <<
"\t\t\t[FaceAmrCoarsen] skip face #" << face.localId() <<
", ?->" << face.frontCell().localId() <<
" ";
346 debug() <<
"\t\t\t[FaceAmrCoarsen] skip face #" << face.localId() <<
", " << face.backCell().localId() <<
"->?"
375 if (face.
itemBase().
flags() & ItemInternal::II_HasBackCell) {
392 debug() <<
"\t\t[FaceAmrCoarsen] nbCell=" << MESH_ALL_ACTIVE_CELLS(mesh()).size();
416 debug() <<
"[AlephTestModule::FaceAmrCoarsen] done";
Generation de la classe de base du Service.
Arcane::VariableCellReal m_cell_temperature
Variables du service.
CaseOptionsAlephTestSchemeFaces * options() const
Options du jeu de données du service.
Matrice d'un système linéaire.
Tableau d'items de types quelconques.
Vue sur les informations des mailles.
Face face(Int32 i) const
i-ème face de la maille
Vue sur les informations des faces.
Cell frontCell() const
Maille devant la face (maille nulle si aucune)
Cell backCell() const
Maille derrière la face (maille nulle si aucune)
virtual IMeshModifier * modifier()=0
Interface de modification associée.
Int32 flags() const
Flags de l'entité
ItemVectorView view() const
Vue sur les entités du groupe.
constexpr Int32 localId() const
Identifiant local de l'entité dans le sous-domaine du processeur.
impl::ItemBase itemBase() const
Partie interne de l'entité.
Lecteur des fichiers de maillage via la bibliothèque LIMA.
CellGroup allCells() const
Retourne le groupe contenant toutes les mailles.
VariableNodeReal3 & nodesCoordinates() const
Retourne les coordonnées des noeuds du maillage.
Structure contenant les informations pour créer un service.
Implémentation d'un maillage.
TraceMessageDbg debug(Trace::eDebugLevel=Trace::Medium) const
Flot pour un message de debug.
Vecteur 1D de données avec sémantique par valeur (style STL).
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
Int32 Integer
Type représentant un entier.