16#include <Create_domain_from_sub_domain.h>
19#include <DomaineCutter.h>
21#include <Sous_Domaine.h>
23#include <Synonyme_info.h>
25Implemente_instanciable(
Create_domain_from_sub_domain,
"Create_domain_from_sub_domain|Create_domain_from_sub_domains",Interprete_geometrique_base);
45 if (mot==
"domaines" || mot==
"zones")
47 noms_sous_domaines.reset(), noms_doms.reset();
50 if (ssz !=
"{")
Process::exit(
"Create_domain_from_sub_domain::domaines : { expected");
51 for (is >> ssz; ssz !=
"}"; is >> ssz)
52 is >> dom, noms_sous_domaines.add(ssz), noms_doms.add(dom);
61 noms_sous_domaines.dimensionner(1), noms_doms.dimensionner(1);
63 param.
ajouter(
"domaine_final",&noms_doms[0]);
65 param.
ajouter(
"par_sous_zone|par_sous_dom",&noms_sous_domaines[0]);
74 Cerr<<
"Options par_sous_zone and par_sous_zones of "<<
que_suis_je()<<
" are for sequential." <<finl;
78 const Domaine& domaine_org=ref_cast(Domaine,
objet(nom_dom_org));
82 IntTab index(domaine_org.
nb_elem());
83 int nb_dom = noms_doms.size();
85 for (
int i = 0; i < nb_dom; i++)
87 const Sous_Domaine& ssz=ref_cast(Sous_Domaine,
objet(noms_sous_domaines[i]));
91 Process::exit(
Nom(
"Create_domain_from_sub_domain : collision detected between ") + noms_sous_domaines[i] +
" and " + noms_sous_domaines[index(ssz(j)) - 1] +
" !");
92 index(ssz(j)) = i + 1;
97 for (
int i = 0; i < nb_dom; i++)
99 Domaine& dom = ref_cast(Domaine,
objet(noms_doms[i]));
109 for (
int j=joints.size()-1; j>=0; j--)
111 Cout <<
"The joint"<<j<<
" becomes a boundary"<<finl;
113 ref_cast(Frontiere,b)=ref_cast(Frontiere,joints(j));
117 joints.suppr(joints(j));
121 for (
int b=bords.size()-1; b>=0; b--)
122 if (bords(b).nb_faces()==0)
124 Cout << bords(b).le_nom()<<
" deleted"<<finl;
125 bords.suppr(bords(b));
129 for (
int b=bords.size()-1; b>=0; b--)
133 Cout << bords(b).le_nom() <<
" becomes a connection "<<finl;
135 racc_base.typer(
"Raccord_local_homogene");
136 Raccord_base& racc=racc_base.valeur();
138 ref_cast(Frontiere,racc)=ref_cast(Frontiere,bords(b));
139 listrac.add(racc_base);
141 bords.suppr(bords(b));
146 const LIST(OBS_PTR(Sous_Domaine)) & liste_sous_domaines = domaine_org.ss_domaines();
147 int nb_sous_domaines = liste_sous_domaines.size();
148 const Sous_Domaine& ssz=ref_cast(Sous_Domaine,
objet(noms_sous_domaines[i]));
149 ArrOfInt rev_ssz(domaine_org.
nb_elem());
154 Nom jdd(
" "), jdd_par(
" ");
156 for (
int j = 0; j < nb_sous_domaines; j++)
157 if (liste_sous_domaines[j]->
le_nom() != noms_sous_domaines[i])
162 for (
int k = 0, l; k < liste_sous_domaines[j]->nb_elem_tot(); k++)
163 if ((l = rev_ssz[liste_sous_domaines[j].valeur()[k]]) >= 0)
169 Nom nom_ssz(noms_doms[i] +
"_" + liste_sous_domaines[j]->
le_nom()), file_ssz(nom_ssz +
".file");
172 jdd +=
Nom(
"export Sous_Domaine ") + nom_ssz +
"\n";
173 jdd +=
Nom(
"Associer ") + nom_ssz +
" " + noms_doms[i] +
"\n";
174 jdd +=
Nom(
"Lire ") + nom_ssz +
" { fichier " + file_ssz +
" }" +
"\n";
175 jdd_par +=
Nom(
"export Sous_Domaine ") + nom_ssz +
"\n";
176 jdd_par +=
Nom(
"Associer ") + nom_ssz +
" " + noms_doms[i] +
"\n";
177 jdd_par +=
Nom(
"Lire ") + nom_ssz +
" { fichier " + nom_ssz +
".ssz }" +
"\n";
187 SFichier f_jdd(noms_doms[i] +
"_ssz.geo");
188 SFichier f_jdd_par(noms_doms[i] +
"_ssz_par.geo");
190 f_jdd_par << jdd_par;
Class Create_domain_from_sub_domain File reading.
Entree & interpreter_(Entree &) override
int lire_motcle_non_standard(const Motcle &, Entree &) override
Reads non-simple-type parameters of an Objet_U from an input stream.
const Noms & bords_internes() const
void initialiser(const Domaine_t &domaine_global, const BigIntVect_t &elem_part, const int nb_parts, const int epaisseur_joint, const bool permissif=false)
Prepares the data structures for building sub-domains based on a partitioning provided in elem_part.
void construire_sous_domaine(const int part, DomaineCutter_Correspondance_t &correspondance, Domaine32 &sous_domaine, const Static_Int_Lists_t *som_raccord=nullptr) const
Fills the "correspondance" structure and the "sous_domaine" for part "part".
Raccords_t & faces_raccord()
void nommer(const Nom &nom) override
Assigns a name to the Objet_U. Virtual method to override.
Class defining operators and methods for all reading operation in an input flow (file,...
void nommer(const Nom &) override
Gives a name to the boundary.
LIST(OBS_PTR(Domaine_t)) &domaines()
static Objet_U & objet(const Nom &)
See Interprete_bloc::objet_global(). BM: the Interprete class is not the best place for this.
A character string (Nom) in uppercase.
class Nom: a character string for naming TRUST objects.
int rang(const char *const ch) const
const Nom & que_suis_je() const
Returns the string identifying the class.
virtual Entree & readOn(Entree &)
Reads an Objet_U from an input stream. Virtual method to override.
virtual const Nom & le_nom() const
Returns the name of the Objet_U. Virtual method to override: returns "neant" in this implementation.
virtual Sortie & printOn(Sortie &) const
Writes the object to an output stream. Virtual method to override.
Helper class to factorize the readOn method of Objet_U classes.
void ajouter(const char *keyword, const int *value, Param::Nature nat=Param::OPTIONAL)
Register an integer parameter.
void ajouter_non_std(const char *keyword, const Objet_U *value, Param::Nature nat=Param::OPTIONAL)
Register a keyword handled by Objet_U::lire_motcle_non_standard.
int lire_avec_accolades_depuis(Entree &is)
Parse the parameter block { ... } from is.
static int nproc()
Returns the number of processors in the current group. See Comm_Group::nproc() and PE_Groups::current...
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
SFichier is to the C++ ofstream class what Sortie is to the C++ ostream class.
static void init_sequential_domain(Domaine_32_64< _SIZE_ > &dom)
Create parallel descriptors for the vertex and element arrays of the domain (necessary because Scatte...
Base class for output streams.
int_t nb_elem_tot() const
void append_array(_TYPE_ valeur)
_SIZE_ size_array() const