16#include <LecFicDiffuse.h>
17#include <Champ_Don_lu.h>
38 int nb_elems = domaine.nb_elem();
42 domaine.creer_tableau_elements(
valeurs());
45 LecFicDiffuse fic(nom);
46 Cerr <<
"Open and read the file : " << nom << finl;
56 Cerr <<
"STAR-CCM csv file detected..." << finl;
57 Cerr <<
"Find component 1 of the field: " << chaine << finl;
58 for (
int i=0; i<dim; i++)
62 if (i<dim-1) Cerr <<
"Find component " << i+2 <<
" of the field: " << chaine << finl;
66 Cerr <<
"Error in the file. There must be one field with " << dim <<
" components." << finl;
72 LecFicDiffuse tmp(nom);
84 nb_val_lues=atoi(chaine);
85 Cerr <<
"The format of this file containing values of a field should be:" << finl;
88 for (
int line=1; line<=nb_lines; line++)
90 if (line==nb_lines-1) Cerr <<
"..." << finl;
94 if (line==nb_lines) l=
"N";
97 Cerr <<
"x["<<l<<
"] y["<<l<<
"] ";
99 for (
int k=0; k<dim; k++)
100 Cerr <<
"value["<<l<<
","<<k<<
"] ";
105 Cerr << finl <<
"Read number of values (N)=" << nb_val_lues << finl;
107 DoubleTab& mes_val =
valeurs();
108 IntTab compteur(nb_elems);
111 DoubleVect val_lu(dim);
115 for (
int i=0; i<nb_val_lues; i++)
117 tmp=(i+1)*10/nb_val_lues;
121 Cerr<<
"\rProcess "<<
Process::me()<<
" has read "<<pourcent*10<<
"% of values"<<flush;
127 for (
int k=0; k<dim; k++) fic >> val_lu[k];
128 for (
int k=0; k<dimension; k++) fic >> point[k];
132 for (
int k=0; k<dimension; k++) fic >> point[k];
133 for (
int k=0; k<dim; k++) fic >> val_lu[k];
140 elem2=domaine.chercher_elements(x,y,z);
141 if ((elem2!=-1) && (elem2<nb_elems))
143 for (
int k=0; k<dim; k++) mes_val(elem2,k) = val_lu[k];
144 compteur[elem2] += 1;
149 for (
int num_elem=0; num_elem<nb_elems; num_elem++)
150 if (compteur[num_elem] == 0)
152 Cerr <<
"Error when using Champ_Don_lu keyword:" << finl;
153 Cerr <<
"There is no value found for the cell number " << num_elem << finl;
154 Cerr <<
"Check your mesh and/or the file " << nom << finl;
void dimensionner(int, int)
Sets the number of components and the number of nodal values.
DoubleTab & valeurs() override
Overrides Champ_base::valeurs() Returns the array of values.
: class Champ_Don_lu This class represents a data field read from a file with the following conventio...
int lire_dimension(Entree &, const Nom &)
Verification of the field dimension Returns the dimension of the field.
Class defining operators and methods for all reading operation in an input flow (file,...
virtual int debute_par(const char *const n) 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 Sortie & printOn(Sortie &) const
Writes the object to an output stream. Virtual method to override.
static int me()
Returns the rank of the local processor in the current communication group. See Comm_Group::rank() an...
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
Base class for output streams.
Domaine & interprete_get_domaine(const Nom &nom)
Sortie & printOn(Sortie &os) const override
Writes the object to an output stream. Virtual method to override.
virtual void echange_espace_virtuel(IsExchangeBlocking exchange_type=IsExchangeBlocking::DefaultBlocking, const std::string kernel_name="noname")