introduction de la version 7.00: utilisation de MPI au niveau du calcul de raideur élémentaire

Sur la branche master
 Votre branche est à jour avec 'origin/master'.

 Modifications qui seront validées :
	nouveau fichier : Elements/Mecanique/SFE/Met_Sfe1_struc_donnees.h
	nouveau fichier : Elements/Thermique/PtIntegThermiInterne.cc
	nouveau fichier : Elements/Thermique/PtIntegThermiInterne.h
	nouveau fichier : General/Distribution_CPU.cc
	nouveau fichier : General/Distribution_CPU.h
	nouveau fichier : Lecture/LectBloc_T.cc
	nouveau fichier : Maillage/maillage4.cc
	nouveau fichier : Parametres/Banniere.h
	nouveau fichier : Parametres/banniere.cc
	nouveau fichier : Util/Courbes/Courbe_1-cos.cc
This commit is contained in:
Gérard Rio 2022-09-26 14:16:07 +02:00
parent de09819d7d
commit 49c9e51239
10 changed files with 4361 additions and 0 deletions

View file

@ -0,0 +1,145 @@
// This file is part of the Herezh++ application.
//
// The finite element software Herezh++ is dedicated to the field
// of mechanics for large transformations of solid structures.
// It is developed by Gérard Rio (APP: IDDN.FR.010.0106078.000.R.P.2006.035.20600)
// INSTITUT DE RECHERCHE DUPUY DE LÔME (IRDL) <https://www.irdl.fr/>.
//
// Herezh++ is distributed under GPL 3 license ou ultérieure.
//
// Copyright (C) 1997-2022 Université Bretagne Sud (France)
// AUTHOR : Gérard Rio
// E-MAIL : gerardrio56@free.fr
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License,
// or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//
// For more information, please consult: <https://herezh.irdl.fr/>.
/************************************************************************
* *
* DATE: 15/01/97 *
* $ *
* AUTEUR: G RIO (mailto:gerardrio56@free.fr) *
* $ *
* PROJET: Herezh++ *
* $ *
************************************************************************
* deuxième partie du fichier Met_Sfe1.h
* contient en fait toutes les structures de données de passage d'informations
* $ *
* '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' * *
* VERIFICATION: *
* *
* ! date ! auteur ! but ! *
* ------------------------------------------------------------ *
* ! ! ! ! *
* *
* $ *
* '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' *
* MODIFICATIONS:
* *
* ! date ! auteur ! but ! *
* ------------------------------------------------------------ *
* *
* $ *
* *
************************************************************************/
#include "Tenseur.h"
#include "Base.h"
// deuxième partie du fichier Met_Sfe1.h
// contient en fait toutes les structures de données de passage d'informations
/// @addtogroup groupe_des_metrique
/// @{
///
/// CLASSE CONTENEUR : cas des grandeurs relatives à la courbure, grandeurs à 0, t et tdt
/// les données sont publiques
class Courbure_t_tdt
{ public : Courbure_t_tdt () : // constructeur par défaut
aiB_0(NULL),aiH_0(NULL),aiB_t(NULL),aiH_t(NULL),aiB_tdt(NULL),aiH_tdt(NULL)
,aijBB_0(NULL),aijHH_0(NULL),aijBB_t(NULL),aijHH_t(NULL),aijBB_tdt(NULL),aijHH_tdt(NULL)
,curbBB_t(NULL),curbBB_tdt(NULL),curbBB_0(NULL)
,ajacobien_tdt(NULL),ajacobien_t(NULL),ajacobien_0(NULL)
{};
Courbure_t_tdt // constructeur normal
(BaseB * aaiB_0,BaseH * aaiH_0,BaseB * aaiB_t,BaseH * aaiH_t, BaseB * aaiB_tdt
,BaseH *aaiH_tdt
,TenseurBB* aaijBB_0,TenseurHH* aaijHH_0,TenseurBB* aaijBB_t
,TenseurHH* aaijHH_t,TenseurBB* aaijBB_tdt,TenseurHH* aaijHH_tdt
,TenseurBB * gcurbBB_t,TenseurBB * gcurbBB_tdt,TenseurBB * gcurbBB_0
,double* gjacobien,double* gajacobien_t,double* gajacobien_0) :
aiB_0(aaiB_0),aiH_0(aaiH_0),aiB_t(aaiB_t),aiH_t(aaiH_t),aiB_tdt(aaiB_tdt),
aiH_tdt(aaiH_tdt),
aijBB_0(aaijBB_0),aijHH_0(aaijHH_0)
,aijBB_t(aaijBB_t),aijHH_t(aaijHH_t),aijBB_tdt(aaijBB_tdt),aijHH_tdt(aaijHH_tdt)
,curbBB_t(gcurbBB_t),curbBB_tdt(gcurbBB_tdt),curbBB_0(gcurbBB_0),
ajacobien_tdt(gjacobien),ajacobien_t(gajacobien_t),ajacobien_0(gajacobien_0)
{};
Courbure_t_tdt (const Courbure_t_tdt& ex) : // constructeur de copie
aiB_0(ex.aiB_0),aiH_0(ex.aiH_0),aiB_t(ex.aiB_t),aiH_t(ex.aiH_t),aiB_tdt(ex.aiB_tdt)
,aiH_tdt(ex.aiH_tdt),
aijBB_0(ex.aijBB_0),aijHH_0(ex.aijHH_0),aijBB_t(ex.aijBB_t),aijHH_t(ex.aijHH_t)
,aijBB_tdt(ex.aijBB_tdt),aijHH_tdt(ex.aijHH_tdt)
,curbBB_t(ex.curbBB_t),curbBB_tdt(ex.curbBB_tdt),curbBB_0(ex.curbBB_0),
ajacobien_tdt(ex.ajacobien_tdt),ajacobien_t(ex.ajacobien_t),ajacobien_0(ex.ajacobien_0)
{};
Courbure_t_tdt& operator= (const Courbure_t_tdt& ex) // surcharge d'affectation
{aiB_0=ex.aiB_0;aiH_0=ex.aiH_0;aiB_t=ex.aiB_t;aiH_t=ex.aiH_t;aiB_tdt=ex.aiB_tdt;
aiH_tdt=ex.aiH_tdt;
aijBB_0=ex.aijBB_0;aijHH_0=ex.aijHH_0; aijBB_t=ex.aijBB_t;aijHH_t=ex.aijHH_t;
aijBB_tdt=ex.aijBB_tdt;aijHH_tdt=ex.aijHH_tdt;
curbBB_t=ex.curbBB_t;curbBB_tdt=ex.curbBB_tdt;curbBB_0=ex.curbBB_0;
ajacobien_tdt=ex.ajacobien_tdt;ajacobien_t=ex.ajacobien_t;ajacobien_0=ex.ajacobien_0;
return *this;};
// mise à jour des grandeurs
void Mise_a_jour_grandeur(BaseB * aaiB_0,BaseH * aaiH_0,BaseB * aaiB_t,BaseH* aaiH_t
,BaseB * aaiB_tdt,BaseH *aaiH_tdt
,TenseurBB* aaijBB_0,TenseurHH* aaijHH_0,TenseurBB* aaijBB_t,TenseurHH* aaijHH_t
,TenseurBB* aaijBB_tdt,TenseurHH* aaijHH_tdt
,TenseurBB * gcurbBB_t,TenseurBB * gcurbBB_tdt,TenseurBB * gcurbBB_0
,double* gjacobien,double* gajacobien_t,double* gajacobien_0)
{aiB_0=aaiB_0;aiH_0=aaiH_0;aiB_t=aaiB_t;aiH_t=aaiH_t;aiB_tdt=aaiB_tdt;
aiH_tdt=aaiH_tdt;
aijBB_0=aaijBB_0;aijHH_0=aaijHH_0;aijBB_t=aaijBB_t;aijHH_t=aaijHH_t;
aijBB_tdt=aaijBB_tdt;aijHH_tdt=aaijHH_tdt;
curbBB_t=gcurbBB_t;curbBB_tdt=gcurbBB_tdt;curbBB_0=gcurbBB_0;
ajacobien_tdt=gjacobien;ajacobien_t=gajacobien_t;ajacobien_0=gajacobien_0;
};
// mise à jour des grandeurs à 0 et à t sauf les variations (pas de tableau et pas à tdt)
// à partir de grandeurs stockées par ailleurs (il s'aait ici donc d'affectation de contenu et
// non de pointeur !)
void Recup_grandeur_0_t(BaseB & aaiB_0,BaseH & aaiH_0,BaseB & aaiB_t,BaseH& aaiH_t
,TenseurBB& aaijBB_0,TenseurHH& aaijHH_0,TenseurBB& aaijBB_t,TenseurHH& aaijHH_t
,TenseurBB & ,double& gajacobien_0,double& gajacobien_t)
{*aiB_0=aaiB_0;*aiH_0=aaiH_0;*aiB_t=aaiB_t;*aiH_t=aaiH_t;
*aijBB_0=aaijBB_0;*aijHH_0=aaijHH_0;*aijBB_t=aaijBB_t;*aijHH_t=aaijHH_t;
*ajacobien_t=gajacobien_t;*ajacobien_0=gajacobien_0;
};
// variables :
BaseB * aiB_0; BaseH * aiH_0; BaseB * aiB_t; BaseH * aiH_t;BaseB * aiB_tdt;
BaseH * aiH_tdt;
TenseurBB * aijBB_0; TenseurHH * aijHH_0;
TenseurBB * aijBB_t ; TenseurHH * aijHH_t ;TenseurBB * aijBB_tdt;TenseurHH * aijHH_tdt;
TenseurBB * curbBB_t;TenseurBB * curbBB_tdt;TenseurBB * curbBB_0;
double* ajacobien_tdt;double* ajacobien_t;double* ajacobien_0;
};
/// @} // end of group

View file

@ -0,0 +1,310 @@
// This file is part of the Herezh++ application.
//
// The finite element software Herezh++ is dedicated to the field
// of mechanics for large transformations of solid structures.
// It is developed by Gérard Rio (APP: IDDN.FR.010.0106078.000.R.P.2006.035.20600)
// INSTITUT DE RECHERCHE DUPUY DE LÔME (IRDL) <https://www.irdl.fr/>.
//
// Herezh++ is distributed under GPL 3 license ou ultérieure.
//
// Copyright (C) 1997-2022 Université Bretagne Sud (France)
// AUTHOR : Gérard Rio
// E-MAIL : gerardrio56@free.fr
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License,
// or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//
// For more information, please consult: <https://herezh.irdl.fr/>.
#include "PtIntegThermiInterne.h"
#include "NevezTenseur.h"
#include "Tenseur3.h"
#include "Tenseur2.h"
// contructeur par défaut
PtIntegThermiInterne::PtIntegThermiInterne():
temperature(0.),temperature_t(0.)
,gradTB(),dgradTB(),deltaGradTB(),fluxH(),fluxH_t()
,norme_gradT(),norme_dGradT(),norme_flux()
,tpsMetrique(),tps_cpu_loi_comp()
{};
// contructeur fonction de la dimension
PtIntegThermiInterne::PtIntegThermiInterne(int dimcoor) :
temperature(0.),temperature_t(0.)
,gradTB(dimcoor),dgradTB(dimcoor),deltaGradTB(dimcoor)
,fluxH(dimcoor),fluxH_t(dimcoor)
,norme_gradT(0.),norme_dGradT(0.),norme_flux(0.)
,tpsMetrique(),tps_cpu_loi_comp()
{ };
// contructeur de copie
PtIntegThermiInterne::PtIntegThermiInterne(const PtIntegThermiInterne& pti):
temperature(pti.temperature),temperature_t(pti.temperature_t)
,gradTB(pti.gradTB),dgradTB(pti.dgradTB),deltaGradTB(pti.deltaGradTB)
,fluxH(pti.fluxH),fluxH_t(pti.fluxH_t)
,norme_gradT(pti.norme_gradT),norme_dGradT(pti.norme_dGradT)
,norme_flux(pti.norme_flux)
,tpsMetrique(pti.tpsMetrique),tps_cpu_loi_comp(pti.tps_cpu_loi_comp)
{ };
// DESTRUCTEUR :
PtIntegThermiInterne::~PtIntegThermiInterne()
{ };
// Surcharge de l'operateur =
PtIntegThermiInterne& PtIntegThermiInterne::operator= ( const PtIntegThermiInterne& pti)
{ temperature=pti.temperature;temperature_t=pti.temperature_t;
gradTB=pti.gradTB;dgradTB=pti.dgradTB;deltaGradTB=pti.deltaGradTB;
fluxH=pti.fluxH;fluxH_t=pti.fluxH_t;
norme_gradT=pti.norme_gradT;norme_dGradT=pti.norme_dGradT;
norme_flux=pti.norme_flux;
// --- les temps cpu
tpsMetrique=pti.tpsMetrique;tps_cpu_loi_comp=pti.tps_cpu_loi_comp;
// retour
return *this;
};
//============= lecture écriture dans base info ==========
// cas donne le niveau de la récupération
// = 1 : on récupère tout
// = 2 : on récupère uniquement les données variables (supposées comme telles)
void PtIntegThermiInterne::Lecture_base_info (ifstream& ent,const int )
{ // lecture des différents éléments que l'on trouve utiles (pour l'instant)
string nom;
ent >> nom >> temperature >> nom >> temperature_t;
ent >> nom >> gradTB
>> nom >> dgradTB
>> nom >> deltaGradTB;
ent >> nom >> fluxH_t;
ent >> nom >> norme_gradT
>> nom >> norme_dGradT
>> nom >> norme_flux ;
// temps cpu
ent >> nom >> tpsMetrique >> nom >> tps_cpu_loi_comp;
};
// cas donne le niveau de sauvegarde
// = 1 : on sauvegarde tout
// = 2 : on sauvegarde uniquement les données variables (supposées comme telles)
void PtIntegThermiInterne::Ecriture_base_info(ofstream& sort,const int )
{ // les différents éléments que l'on considère intéressant (pour l'instant)
sort << "\n temperature= " << temperature << " temperature_t= " << temperature_t;
sort << "\n gradTB= " << gradTB
<< " dgradTB= " << dgradTB
<< " deltaGradTB= " << deltaGradTB
<< "\n fluxDH= " << fluxH_t;
sort << "\n norme_gradT " << norme_gradT
<< " norme_dGradT= " << norme_dGradT
<< " norme_fluxD= " << norme_flux ;
sort << "\n tpsmetrique= " << tpsMetrique << " tpsLoiComp= " << tps_cpu_loi_comp;
};
// actualisation des grandeurs actives de t+dt vers t, pour celles qui existent
// sous ces deux formes
void PtIntegThermiInterne::TdtversT()
{ fluxH_t = fluxH;temperature_t=temperature;};
// actualisation des grandeurs actives de t vers tdt, pour celles qui existent
// sous ces deux formes
void PtIntegThermiInterne::TversTdt()
{ fluxH = fluxH_t;temperature=temperature_t;};
// plusZero: = true: indique qu'il faut complèter les grandeurs manquantes avec des 0
// = false: on ne complète pas
// il faut que ptintmec comporte des tenseurs d'ordre 2 et this des tenseurs 3D
void PtIntegThermiInterne::Affectation_2D_a_3D(const PtIntegThermiInterne& ptintmec,bool plusZero)
{ // vérif éventuelle des dimensions
#ifdef MISE_AU_POINT
{// - les dimensions
if (gradTB.Dimension() != 3)
{cout << "\n *** erreur la dimension de this->gradTB ("<<gradTB.Dimension() <<") est different de 3"
<< "\n PtIntegThermiInterne::Affectation_2D_a_3D(.."; Sortie(1);};
if (ptintmec.gradTB.Dimension() != 2)
{cout << "\n *** erreur la dimension de ptintmec.gradTB ("<< ptintmec.gradTB.Dimension() <<") est different de 2"
<< "\n PtIntegThermiInterne::Affectation_2D_a_3D(.."; Sortie(1);};
}
#endif
// pour tout ce qui est def
temperature_t=ptintmec.temperature_t;
temperature=ptintmec.temperature;
gradTB(1) = ptintmec.gradTB(1);gradTB(2) = ptintmec.gradTB(2);
dgradTB(1) = ptintmec.dgradTB(1);dgradTB(2) = ptintmec.dgradTB(2);
deltaGradTB(1) = ptintmec.deltaGradTB(1);deltaGradTB(2) = ptintmec.deltaGradTB(2);
fluxH(1) = ptintmec.fluxH(1);fluxH(2) = ptintmec.fluxH(2);
fluxH_t(1) = ptintmec.fluxH_t(1);fluxH_t(2) = ptintmec.fluxH_t(2);
if (plusZero)
{gradTB(3) = 0.;
dgradTB(3) = 0.;
deltaGradTB(3) = 0.;
fluxH(3) = 0.;
fluxH_t(3) = 0.;
};
norme_gradT = ptintmec.norme_gradT;
norme_dGradT = ptintmec.norme_dGradT;
norme_flux = ptintmec.norme_flux;
// --- les temps cpu
tpsMetrique=ptintmec.tpsMetrique;tps_cpu_loi_comp=ptintmec.tps_cpu_loi_comp;
};
// l'inverse: comme le conteneur d'arrivée est plus petit, il n'y a pas de complétion
// il faut que ptintmec comporte des tenseurs d'ordre 3 et this des tenseurs 2D
void PtIntegThermiInterne::Affectation_3D_a_2D(const PtIntegThermiInterne& ptintmec)
{ // vérif éventuelle des dimensions
#ifdef MISE_AU_POINT
{// - les dimensions
if (gradTB.Dimension() != 2)
{cout << "\n *** erreur la dimension de this.gradTB ("<<gradTB.Dimension() <<") est different de 2"
<< "\n PtIntegThermiInterne::Affectation_3D_a_2D(.."; Sortie(1);};
if (ptintmec.gradTB.Dimension() != 3)
{cout << "\n *** erreur la dimension de ptintmec.gradTB ("<< ptintmec.gradTB.Dimension() <<") est different de 3"
<< "\n PtIntegThermiInterne::Affectation_3D_a_2D(.."; Sortie(1);};
}
#endif
// pour tout ce qui est def
temperature_t=ptintmec.temperature_t;
temperature=ptintmec.temperature;
gradTB(1) = ptintmec.gradTB(1);gradTB(2) = ptintmec.gradTB(2);
dgradTB(1) = ptintmec.dgradTB(1);dgradTB(2) = ptintmec.dgradTB(2);
deltaGradTB(1) = ptintmec.deltaGradTB(1);deltaGradTB(2) = ptintmec.deltaGradTB(2);
fluxH(1) = ptintmec.fluxH(1);fluxH(2) = ptintmec.fluxH(2);
fluxH_t(1) = ptintmec.fluxH_t(1);fluxH_t(2) = ptintmec.fluxH_t(2);
norme_gradT = ptintmec.norme_gradT;
norme_dGradT = ptintmec.norme_dGradT;
norme_flux = ptintmec.norme_flux;
// --- les temps cpu
tpsMetrique=ptintmec.tpsMetrique;tps_cpu_loi_comp=ptintmec.tps_cpu_loi_comp;
};
// plusZero: = true: indique qu'il faut complèter les grandeurs manquantes avec des 0
// = false: on ne complète pas
// il faut que ptintmec comporte des tenseurs d'ordre 1 et this des tenseurs 3D
void PtIntegThermiInterne::Affectation_1D_a_3D(const PtIntegThermiInterne& ptintmec,bool plusZero)
{ // vérif éventuelle des dimensions
#ifdef MISE_AU_POINT
{// - les dimensions
if (gradTB.Dimension() != 3)
{cout << "\n *** erreur la dimension de this.gradTB ("<<gradTB.Dimension() <<") est different de 3"
<< "\n PtIntegThermiInterne::Affectation_1D_a_3D(.."; Sortie(1);};
if (ptintmec.gradTB.Dimension() != 1)
{cout << "\n *** erreur la dimension de ptintmec.gradTB ("<< ptintmec.gradTB.Dimension() <<") est different de 1"
<< "\n PtIntegThermiInterne::Affectation_1D_a_3D(.."; Sortie(1);};
}
#endif
// pour tout ce qui est def
temperature_t=ptintmec.temperature_t;
temperature=ptintmec.temperature;
gradTB(1) = ptintmec.gradTB(1);
dgradTB(1) = ptintmec.dgradTB(1);
deltaGradTB(1) = ptintmec.deltaGradTB(1);
fluxH(1) = ptintmec.fluxH(1);
fluxH_t(1) = ptintmec.fluxH_t(1);
if (plusZero)
{gradTB(3) = gradTB(2) = 0.;
dgradTB(3) = dgradTB(2) = 0.;
deltaGradTB(3) = deltaGradTB(2) = 0.;
fluxH(3) = fluxH(2) = 0.;
fluxH_t(3) = fluxH_t(2) = 0.;
};
norme_gradT = ptintmec.norme_gradT;
norme_dGradT = ptintmec.norme_dGradT;
norme_flux = ptintmec.norme_flux;
// --- les temps cpu
tpsMetrique=ptintmec.tpsMetrique;tps_cpu_loi_comp=ptintmec.tps_cpu_loi_comp;
};
// l'inverse: comme le conteneur d'arrivée est plus petit, il n'y a pas de complétion
// il faut que ptintmec comporte des tenseurs d'ordre 3 et this des tenseurs 1D
void PtIntegThermiInterne::Affectation_3D_a_1D(const PtIntegThermiInterne& ptintmec)
{ // vérif éventuelle des dimensions
#ifdef MISE_AU_POINT
{ // - les dimensions
if (gradTB.Dimension() != 1)
{cout << "\n *** erreur la dimension de this.gradTB ("<<gradTB.Dimension() <<") est different de 1"
<< "\n PtIntegThermiInterne::Affectation_3D_a_1D(.."; Sortie(1);};
if (ptintmec.gradTB.Dimension() != 3)
{cout << "\n *** erreur la dimension de ptintmec.gradTB ("<< ptintmec.gradTB.Dimension() <<") est different de 3"
<< "\n PtIntegThermiInterne::Affectation_3D_a_1D(.."; Sortie(1);};
}
#endif
// pour tout ce qui est def
temperature_t=ptintmec.temperature_t;
temperature=ptintmec.temperature;
gradTB(1) = ptintmec.gradTB(1);
dgradTB(1) = ptintmec.dgradTB(1);
deltaGradTB(1) = ptintmec.deltaGradTB(1);
fluxH(1) = ptintmec.fluxH(1);
fluxH_t(1) = ptintmec.fluxH_t(1);
norme_gradT = ptintmec.norme_gradT;
norme_dGradT = ptintmec.norme_dGradT;
norme_flux = ptintmec.norme_flux;
// --- les temps cpu
tpsMetrique=ptintmec.tpsMetrique;tps_cpu_loi_comp=ptintmec.tps_cpu_loi_comp;
};
// surcharge de l'operateur de lecture
istream & operator >> (istream & entree, PtIntegThermiInterne & pti)
{ // vérification du type
string nom;
entree >> nom;
#ifdef MISE_AU_POINT
if (nom != "PtIntegThermiInterne")
{ cout << "\nErreur, en lecture d'une instance PtIntegThermiInterne "
<< " on attendait PtIntegThermiInterne et on a lue: " << nom ;
cout << "istream & operator >> (istream & entree, PtIntegThermiInterne & pti)\n";
Sortie(1);
};
#endif
// puis lecture des différents éléments
entree >> nom >> pti.temperature >> nom >> pti.temperature_t;
entree >> nom >> pti.gradTB
>> nom >> pti.dgradTB
>> nom >> pti.deltaGradTB;
entree >> nom >> pti.fluxH_t;
entree >> nom >> pti.norme_gradT
>> nom >> pti.norme_dGradT
>> nom >> pti.norme_flux ;
// --- les temps cpu
entree >> nom >> pti.tpsMetrique >> nom >> pti.tps_cpu_loi_comp;
return entree;
};
// surcharge de l'operateur d'ecriture
ostream & operator << ( ostream & sort,const PtIntegThermiInterne & pti)
{ // tout d'abord un indicateur donnant le type
sort << "PtIntegThermiInterne " ;
// puis les différents éléments
sort << "\n temperature= " << pti.temperature << " temperature_t= " << pti.temperature_t;
sort << "\n gradTB= " << pti.gradTB
<< " dgradTB= " << pti.dgradTB
<< " deltaGradTB= " << pti.deltaGradTB
<< "\n fluxH= " << pti.fluxH_t;
sort << "\n norme_gradT " << pti.norme_gradT
<< " norme_dGradT= " << pti.norme_dGradT
<< " norme_flux= " << pti.norme_flux ;
sort << "\n tpsmetrique= " << pti.tpsMetrique << " tpsLoiComp= " << pti.tps_cpu_loi_comp;
return sort;
};

View file

@ -0,0 +1,201 @@
// This file is part of the Herezh++ application.
//
// The finite element software Herezh++ is dedicated to the field
// of mechanics for large transformations of solid structures.
// It is developed by Gérard Rio (APP: IDDN.FR.010.0106078.000.R.P.2006.035.20600)
// INSTITUT DE RECHERCHE DUPUY DE LÔME (IRDL) <https://www.irdl.fr/>.
//
// Herezh++ is distributed under GPL 3 license ou ultérieure.
//
// Copyright (C) 1997-2022 Université Bretagne Sud (France)
// AUTHOR : Gérard Rio
// E-MAIL : gerardrio56@free.fr
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License,
// or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//
// For more information, please consult: <https://herezh.irdl.fr/>.
/************************************************************************
* DATE: 06/03/2023 *
* $ *
* AUTEUR: G RIO (mailto:gerardrio56@free.fr) *
* $ *
* PROJET: Herezh++ *
* $ *
************************************************************************
* BUT: Classe pour stocker les informations aux points *
* d'intégration thermique *
* $ *
* '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' * *
* VERIFICATION: *
* *
* ! date ! auteur ! but ! *
* ------------------------------------------------------------ *
* ! ! ! ! *
* $ *
* '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' *
* MODIFICATIONS: *
* ! date ! auteur ! but ! *
* ------------------------------------------------------------ *
* $ *
************************************************************************/
#ifndef PTINTEGTHERMIINTERNE_H
#define PTINTEGTHERMIINTERNE_H
#include "Tenseur.h"
#include "Vecteur.h"
#include "Temps_CPU_HZpp.h"
/// @addtogroup Groupe_concernant_les_points_integration
/// @{
///
class PtIntegThermiInterne
{// surcharge de l'operator de lecture
friend istream & operator >> (istream &, PtIntegThermiInterne &);
// surcharge de l'operator d'ecriture
friend ostream & operator << (ostream &, const PtIntegThermiInterne &);
public :
// CONSTRUCTEURS :
// contructeur par défaut
PtIntegThermiInterne();
// contructeur fonction de la dimension de tenseurs
PtIntegThermiInterne(int dimtens);
// contructeur de copie
PtIntegThermiInterne(const PtIntegThermiInterne& pti);
// DESTRUCTEUR :
~PtIntegThermiInterne();
// METHODES PUBLIQUES :
// Surcharge de l'operateur =
PtIntegThermiInterne& operator= ( const PtIntegThermiInterne& pti);
// la température
double& Temperature() {return temperature;};
// la température à t
double& Temperature_t() {return temperature_t;};
// gradient thermique finale
CoordonneeB& GradTB() {return gradTB;};
// vitesse finale du gradient thermique
CoordonneeB& DgradTB() {return dgradTB;};
// variation du gradient thermique entre t et t + delta t
CoordonneeB& DeltaGradTB() {return deltaGradTB;};
// vecteur densité du flux thermique finale
CoordonneeH& FluxH() {return fluxH;};
// vecteur densité du flux thermique en début d'incrément
CoordonneeH& FluxH_t() {return fluxH_t;};
// --- temps cpu
// tps cpu relatif à la métrique uniquement
Temps_CPU_HZpp& TpsMetrique() {return tpsMetrique;};
// temps cumulé relatif à la loi de comportement
Temps_CPU_HZpp& Tps_cpu_loi_comp() {return tps_cpu_loi_comp;};
// ---- acces idem en constants
// la température
const double& Temperature_const() const {return temperature;};
// la température à t
const double& Temperature_t_const() const {return temperature_t;};
// gradient thermique finale
const CoordonneeB & GradTB_const() const {return gradTB;};
// vitesse finale du gradient thermique
const CoordonneeB & DgradTB_const() const {return dgradTB;};
// variation du gradient thermique entre t et t + delta t
const CoordonneeB & DeltaGradTB_const() const {return deltaGradTB;};
// densité de flux finale
const CoordonneeH & FluxH_const() const {return fluxH;};
// densité de flux en début d'incrément
const CoordonneeH & FluxH_t_const() const {return fluxH_t;};
// --- temps cpu
// tps cpu relatif à la métrique uniquement
const Temps_CPU_HZpp& TpsMetrique_const() const {return tpsMetrique;};
// temps cumulé relatif à la loi de comportement
const Temps_CPU_HZpp& Tps_cpu_loi_comp_const() const {return tps_cpu_loi_comp;};
// invariant du gradient thermique
double& Norme_gradT() {return norme_gradT;};
const double& Norme_gradT_const() const {return norme_gradT;};
// invariant de la vitesse du gradient thermique
double& Norme_DGradT() {return norme_dGradT;};
const double& Norme_DGradT_const() const {return norme_dGradT;};
// invariant de la densité de flux
double& Norme_flux() {return norme_flux;};
const double& Norme_flux_const() const {return norme_flux;};
// actualisation des grandeurs actives de t+dt vers t, pour celles qui existent
// sous ces deux formes
void TdtversT();
// actualisation des grandeurs actives de t vers tdt, pour celles qui existent
// sous ces deux formes
void TversTdt();
//========= méthode particulière pour un passage de l'ordre 2D à 3D des tenseurs et l'inverse ===========
// plusZero: = true: indique qu'il faut complèter les grandeurs manquantes avec des 0
// = false: on ne complète pas
// il faut que ptintmec comporte des tenseurs d'ordre 2 et this des tenseurs 3D
void Affectation_2D_a_3D(const PtIntegThermiInterne& ptinther,bool plusZero);
// l'inverse: comme le conteneur d'arrivée est plus petit, il n'y a pas de complétion
// il faut que ptintmec comporte des tenseurs d'ordre 3 et this des tenseurs 2D
void Affectation_3D_a_2D(const PtIntegThermiInterne& ptinther);
//========= méthode particulière pour un passage de l'ordre 1D à 3D des tenseurs et l'inverse ===========
// plusZero: = true: indique qu'il faut complèter les grandeurs manquantes avec des 0
// = false: on ne complète pas
// il faut que ptintmec comporte des tenseurs d'ordre 1 et this des tenseurs 3D
void Affectation_1D_a_3D(const PtIntegThermiInterne& ptinther,bool plusZero);
// l'inverse: comme le conteneur d'arrivée est plus petit, il n'y a pas de complétion
// il faut que ptintmec comporte des tenseurs d'ordre 3 et this des tenseurs 1D
void Affectation_3D_a_1D(const PtIntegThermiInterne& ptinther);
//============= lecture écriture dans base info ==========
// cas donne le niveau de la récupération
// = 1 : on récupère tout
// = 2 : on récupère uniquement les données variables (supposées comme telles)
void Lecture_base_info (ifstream& ent,const int cas);
// cas donne le niveau de sauvegarde
// = 1 : on sauvegarde tout
// = 2 : on sauvegarde uniquement les données variables (supposées comme telles)
void Ecriture_base_info(ofstream& sort,const int cas);
protected :
// VARIABLES PROTÉGÉES :
double temperature,temperature_t;
CoordonneeB gradTB; // gradient thermique finale
CoordonneeB dgradTB; // vitesse finale du gradient thermique
CoordonneeB deltaGradTB; // variation du gradient thermique entre t et t + delta t
CoordonneeH fluxH; // vecteur densité du flux thermique finale
CoordonneeH fluxH_t; // vecteur densité du flux thermique en début d'incrément
// ---- les invariants
double norme_gradT ; // norme du gradient thermique = invariant
double norme_dGradT ; // norme de la vitesse du gradient thermique = invariant
double norme_flux ; // norme du vecteur l densité de flux thermique
// --- temps cpu
Temps_CPU_HZpp tpsMetrique; // tps cpu relatif à la métrique uniquement
Temps_CPU_HZpp tps_cpu_loi_comp; // temps cumulé relatif à la loi de comportement
};
/// @} // end of group
#endif

253
General/Distribution_CPU.cc Executable file
View file

@ -0,0 +1,253 @@
// This file is part of the Herezh++ application.
//
// The finite element software Herezh++ is dedicated to the field
// of mechanics for large transformations of solid structures.
// It is developed by Gérard Rio (APP: IDDN.FR.010.0106078.000.R.P.2006.035.20600)
// INSTITUT DE RECHERCHE DUPUY DE LÔME (IRDL) <https://www.irdl.fr/>.
//
// Herezh++ is distributed under GPL 3 license ou ultérieure.
//
// Copyright (C) 1997-2022 Université Bretagne Sud (France)
// AUTHOR : Gérard Rio
// E-MAIL : gerardrio56@free.fr
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License,
// or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//
// For more information, please consult: <https://herezh.irdl.fr/>.
#include "Distribution_CPU.h"
#include <boost/mpi/environment.hpp>
#include <boost/mpi/communicator.hpp>
#include <boost/serialization/string.hpp>
#include <boost/mpi.hpp>
namespace mpi = boost::mpi;
// constructeur par défaut
Distribution_CPU::Distribution_CPU():
tab_list_maillage_element(),tab_indic()
,total_elem(0)
,tab_vide_list_maillage_element()
{};
// constructeur de copie
Distribution_CPU::Distribution_CPU (const Distribution_CPU& a):
tab_list_maillage_element(a.tab_list_maillage_element)
,tab_indic(a.tab_indic),total_elem(a.total_elem)
,tab_vide_list_maillage_element()
{};
// calcul de l'équilibrage initiale
void Distribution_CPU::Calcul_Equilibrage_initiale(const LesMaillages * lesMaillages)
{
if (ParaGlob::Monde()->rank() == 0)
{ // on équilibre sur tous les cpu excepté le maître, qui lui ne calcule pas
int nb_proc_calcul = ParaGlob::Monde()->size() - 1;
// si nb_proc_calcul == 0 on ne peut pas continuer, aucun cpu n'étant disponible
// pour le calcul, on arrête
if (nb_proc_calcul == 0)
{cout << "\n *** erreur en calcul d'equilibrage initial: le nombre de cpu "
<< " disponible pour le calcul est nul ! on ne peut pas continuer "
<< " (il faut utiliser la version mono-processeur d'Herezh++ ! ) "
<< endl;
Sortie(1);
};
tab_indic.Change_taille(nb_proc_calcul);
// dans une première étape on ne s'intéresse qu'aux éléments
// on suppose que les éléments sont identiques en temps de calcul
// on repère les éléments par le numéro de maillage + le numéro d'élément, en cours
// on récupère le nombre total d'éléments
int nb_mail = lesMaillages->NbMaillage();
total_elem = 0; // init
Tableau <Tableau <bool > > inter(nb_mail); // inter utilisé ensuite pour dimensionner tab_indic
for (int i=1;i<=nb_mail;i++)
{int nb_elem_mail = lesMaillages->Nombre_element(i);
total_elem += nb_elem_mail;
inter(i).Change_taille(nb_elem_mail,false);
};
// on dimensionne tab_indic, tout est à false
tab_indic.Change_taille(nb_proc_calcul,inter);
// il faut que le nombre d'élément soit au moins >= au nb de proc de calcul
// pour que l'on puisse distribuer au moin un elem par proc de calcul
if (total_elem < nb_proc_calcul)
{cout << "\n *** erreur en calcul d'equilibrage initial: le nombre de cpu "
<< " disponible pour le calcul \n est inferieur au nb d'element total ! on ne peut pas continuer "
<< "\n (il faut utiliser la version mono-processeur d'Herezh++ ! ) "
<< endl;
Sortie(1);
};
// le nombre théorique d'élément par cpu
int nb_elem_un_cpu = total_elem/nb_proc_calcul; // arrondi inférieur
// on adapte le tableau de liste
tab_list_maillage_element.Change_taille(nb_proc_calcul);
for (int iproc =1;iproc <= nb_proc_calcul; iproc++)
{tab_list_maillage_element(iproc).Change_taille(nb_mail);
for (int imail=1; imail<= nb_mail; imail++)
tab_list_maillage_element(iproc)(imail).clear();
};
// on parcours tous les éléments et on remplit les tableaux
int iproc = 1; // le num du proc en cours
int nb_ele_enreg_iproc = 1; // init le nombre d'élément enregistré pour le proc
for (int imail=1;imail<=nb_mail;imail++)
{
int nb_ele = lesMaillages->Nombre_element(imail);
{list <int > * li_maillage_element = & tab_list_maillage_element(iproc)(imail); // init
// de la liste courante
for (int ile = 1; ile<=nb_ele;ile++,nb_ele_enreg_iproc++)
{ li_maillage_element->push_back(ile);
tab_indic(iproc)(imail)(ile)=true; // on signale
// on regarde s'il faut changer de cpu
// si c'est le dernier cpu, on ne change pas -> pour éviter
// les pb d'arrondi
if ((nb_ele_enreg_iproc > nb_elem_un_cpu)
&& (iproc < nb_proc_calcul) )
{iproc++;
nb_ele_enreg_iproc=1; // reinit du compteur
li_maillage_element = & tab_list_maillage_element(iproc)(imail); // pointage liste associée
};
};
};
};
}
};
// passage de l'équilibrage à tous les cpu autres que 0
void Distribution_CPU::Passage_Equilibrage_aux_CPU()
{ //if (ParaGlob::Monde()->rank() == 0)
broadcast(*ParaGlob::Monde(), *this, 0);
// synchronisation ici de tous les process
// ParaGlob::Monde()->barrier();
// mise à jour de ParaGlob, qui peut transmettre à tous
// la liste des numéros d'éléments concernés
ParaGlob::param->Init_tableau(&tab_list_maillage_element);
};
// -- serialisation ---
// on spécialise la sauvegarde et la restitution
// version == 0 pour la première sauvegarde et ensuite > 0
// NB: c'est toujours la version en cours au moment de la sauvegarde
// ==> dans notre cas, on ne sent sert pas pour l'instant: supposé tjs == 0
template<class Archive>
void Distribution_CPU::save(Archive & ar, const unsigned int version) const
{ // comme on a des listes on sauvegarde explicitement
int nb_proc_calcul = tab_list_maillage_element.Taille();
ar << std::string("Distribution_CPU:taille= ") << nb_proc_calcul ;
for (int i_proc=1;i_proc<= nb_proc_calcul; i_proc++)
{int nb_mail = tab_list_maillage_element(i_proc).Taille();
ar << std::string(" nb_mail= ")<< nb_mail ;
// on sauvegarde également le nombre total d'élément par maillage
// pour cela on se sert de tab_indic pour le premier cpu
for (int num_mail = 1; num_mail <= nb_mail;num_mail++)
ar << (int) tab_indic(1)(num_mail).Taille();
for (int imail=1;imail<=nb_mail;imail++)
{ const list <int >& list_maillage_element = tab_list_maillage_element(i_proc)(imail);
ar << std::string(" list:i_taille= ")<< (int) list_maillage_element.size() ;
list <int >::const_iterator il, ilfin= list_maillage_element.end();
for (il = list_maillage_element.begin(); il != ilfin; il++)
{ int truc = (*il);
ar << truc ;
};
};
};
}
// en lecture, le num de version permet de ce positionner sur une version particulière
// ==> dans notre cas, on ne sent sert pas pour l'instant: supposé tjs == 0
template<class Archive>
void Distribution_CPU::load(Archive & ar, const unsigned int version)
{ // opération inverse de save
std::string toto; int taille;
ar >> toto >> taille;
// on vérifie que c'est cohérent avec le nombre de CPU en cours
int nb_proc_calcul = ParaGlob::Monde()->size() - 1;
if (taille != nb_proc_calcul)
{cout << "\n **** erreur en recuperation d'une distribution CPU, le nombre de cpu "
<< " en cours: "<<nb_proc_calcul << "est different de celui archive: "
<< taille << " on ne peut pas continuer l'execution !!!";
Sortie(1);
};
// redimentionnement éventuel, si même taille, aucune action
tab_list_maillage_element.Change_taille(nb_proc_calcul);
// idem tab_indic
tab_indic.Change_taille(nb_proc_calcul);
total_elem = 0; // init
for (int i_proc=1;i_proc<= nb_proc_calcul; i_proc++)
{ int nb_mail;
ar >> toto >> nb_mail;
tab_list_maillage_element(i_proc).Change_taille(nb_mail);
tab_indic(i_proc).Change_taille(nb_mail);
// on va lire le nombre total d'éléments pour chaque maillage
for (int num_mail = 1; num_mail <= nb_mail;num_mail++)
{ int nb_elem_mail;
ar >> nb_elem_mail;
tab_indic(i_proc)(num_mail).Change_taille(nb_elem_mail,false);
};
for (int imail=1;imail<=nb_mail;imail++)
{ Tableau <bool > & tab_indic_cpu_mail = tab_indic(i_proc)(imail); // pour simplifier
// tab_indic_cpu_mail.Inita(false); // par défaut init à false pour tous les éléments
list <int >& list_maillage_element = tab_list_maillage_element(i_proc)(imail);
int size_list;
ar >> toto >> size_list;
if (size_list == list_maillage_element.size())
{// si la liste existante a la bonne taille, on ne fait que lire
int inter;
list <int >::iterator il, ilfin= list_maillage_element.end();
for (il = list_maillage_element.begin(); il != ilfin; il++)
{ar >> inter; (*il)=inter;
tab_indic_cpu_mail(inter)=true; // on rempli tab_indic
}
}
else // cas où la taille n'est pas bonne
{list_maillage_element.clear();
int inter; // élément de travail
for (int j=1;j<= size_list;j++)
{ar >> inter;
list_maillage_element.push_back(inter);
tab_indic_cpu_mail(inter)=true; // on rempli tab_indic
};
};
// mise à jour du nombre total d'élément
total_elem += list_maillage_element.size();
};
}
};
// cas donne le niveau de la récupération
// = 1 : on récupère tout
// = 2 : on récupère uniquement les données variables (supposées comme telles)
void Distribution_CPU::Lecture_base_info(ifstream& ent,const int cas)
{ // on récupère le tableau de list : tab_list_maillage_element
// on suit exactement la même procédure que pour archive
load(ent,cas);
};
// cas donne le niveau de sauvegarde
// = 1 : on sauvegarde tout
// = 2 : on sauvegarde uniquement les données variables (supposées comme telles)
void Distribution_CPU::Ecriture_base_info(ofstream& sort,const int cas)
{ // on sauvegarde le tableau de list : tab_list_maillage_element
// on suit exactement la même procédure que pour archive
save(sort,cas);
};

162
General/Distribution_CPU.h Executable file
View file

@ -0,0 +1,162 @@
// This file is part of the Herezh++ application.
//
// The finite element software Herezh++ is dedicated to the field
// of mechanics for large transformations of solid structures.
// It is developed by Gérard Rio (APP: IDDN.FR.010.0106078.000.R.P.2006.035.20600)
// INSTITUT DE RECHERCHE DUPUY DE LÔME (IRDL) <https://www.irdl.fr/>.
//
// Herezh++ is distributed under GPL 3 license ou ultérieure.
//
// Copyright (C) 1997-2022 Université Bretagne Sud (France)
// AUTHOR : Gérard Rio
// E-MAIL : gerardrio56@free.fr
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License,
// or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//
// For more information, please consult: <https://herezh.irdl.fr/>.
/************************************************************************
* DATE: 03/01/2022 *
* $ *
* AUTEUR: G RIO (mailto:gerardrio56@free.fr) *
* $ *
* PROJET: Herezh++ *
* $ *
************************************************************************
* BUT: une classe qui a pour objectif de gérer, calculer, *
* certaines particularités liées à la parallélisation: *
* - l'équilibrage de charge de calcul sur les processeurs *
* $ *
* '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' *
************************************************************************/
#ifndef DISTRIBUTION_CPU_H
#define DISTRIBUTION_CPU_H
#include <boost/serialization/split_member.hpp>
#include "LesMaillages.h"
#include "Basiques.h"
/**
*
* BUT: une classe qui a pour objectif de gérer, calculer,
* certaines particularités liées à la parallélisation:
* - l'équilibrage de charge de calcul sur les processeurs
*
*
* \author Gérard Rio
* \version 1.0
* \date 03/01/2022
* \brief classe pour gérer certaines particularités liées à la parallélisation, ex: l'équilibrage de charge de calcul sur les processeurs
*
*/
class Distribution_CPU
{
public :
// CONSTRUCTEURS :
// par défaut
Distribution_CPU();
// constructeur de copie
Distribution_CPU (const Distribution_CPU& a);
// DESTRUCTEUR :
~Distribution_CPU() {};
// METHODES PUBLIQUES :
// calcul de l'équilibrage initiale par le cpu 0
void Calcul_Equilibrage_initiale(const LesMaillages * lesMaillages);
// passage de l'équilibrage à tous les cpu autres que 0
void Passage_Equilibrage_aux_CPU();
// retour de tab_list_maillage_element(i)(j) contient la liste
// pour le maillage j des num <élément> associés au cpu i
// NB: si la taille du tableau == 0, cela signifie qu'il n'a pas encore été construit
// on peut dans ce cas déclancher un calcul d'équilibrage initial
const Tableau <Tableau < list <int > > > * Tableau_element_CPU_en_cours() const
{return &tab_list_maillage_element;};
// retour de la liste des éléments relatif au cpu en cours
// si c'est le cpu 0, retourne un tableau vide
const Tableau < list <int > > & List_element_CPU_en_cours() const
{if (ParaGlob::Monde()->rank() != 0)
return tab_list_maillage_element(ParaGlob::Monde()->rank());
else return tab_vide_list_maillage_element;
};
// indicateur permettant de dire si un élément est concerné par un CPU donné
// tab_indic(CPU)(mail)(ele) : = 1 si l'élément ele du maillage mail est concerné
// par le CPU
bool Element_concerner(int CPU,int mail,int ele) const
{return tab_indic(CPU)(mail)(ele);};
// récup du nombre total d'éléments, cumul sur tous les maillages
int NB_total_element() const {return total_elem ;};
//============= lecture écriture dans base info ==========
// cas donne le niveau de la récupération
// = 1 : on récupère tout
// = 2 : on récupère uniquement les données variables (supposées comme telles)
void Lecture_base_info(ifstream& ent,const int cas);
// cas donne le niveau de sauvegarde
// = 1 : on sauvegarde tout
// = 2 : on sauvegarde uniquement les données variables (supposées comme telles)
void Ecriture_base_info(ofstream& sort,const int cas);
private :
// VARIABLES PROTEGEES :
// tab_list_maillage_element(i)(j) contient la liste
// pour le maillage j des num <élément> associés au cpu i
Tableau <Tableau < list <int > > > tab_list_maillage_element;
// un tableau vide, qui correspond au cas du CPU 0
Tableau < list <int > > tab_vide_list_maillage_element;
// indicateur permettant de dire si un élément est concerné par un CPU donné
// tab_indic(CPU)(mail)(ele) : = 1 si l'élément ele du maillage mail est concerné
// par le CPU
Tableau <Tableau < Tableau <bool > > > tab_indic;
int total_elem ; // nombre total d'éléments cumulé sur tous les maillages
// METHODES PROTEGEES :
// -- serialisation ---
// déclaration en friend pour l'acces direct de boost
friend class boost::serialization::access;
// on spécialise la sauvegarde et la restitution
// version == 0 pour la première sauvegarde et ensuite > 0
// NB: c'est toujours la version en cours au moment de la sauvegarde
// ==> dans notre cas, on ne sent sert pas pour l'instant: supposé tjs == 0
template<class Archive>
void save(Archive & ar, const unsigned int version) const;
// en lecture, le num de version permet de ce positionner sur une version particulière
template<class Archive>
void load(Archive & ar, const unsigned int version);
// la macro suivante va définir automatiquement la méthode : "serialize"
BOOST_SERIALIZATION_SPLIT_MEMBER()
// pour mémoire on indique l'entête de la méthode "serialize"
// // la méthode serialize fonctionne dans les deux sens: lecture et écriture dans ar
// // << et >> est remplacé par &
// // le choix dépend du fait que ar est un flux entrant ou sortant
// template<class Archive>
// void serialize(Archive & ar, const unsigned int version);
};
#endif

1
Lecture/LectBloc_T.cc Executable file
View file

@ -0,0 +1 @@
#include "LectBloc_T.h" // lecture d'un bloc void LectBloc::Lecture(UtilLecture & entreePrinc,LesReferences& lesRef, char * motcle,string message) { MotCle motCle; // ref aux mots cle if (strstr(entreePrinc.tablcar,motcle)!=NULL) { entreePrinc.NouvelleDonnee(); list <T> lili; T elem; // double t1; string s1; while ( !motCle.SimotCle(entreePrinc.tablcar)) { elem.Lecture(entreePrinc); // *(entreePrinc.entree) >> elem.Nomref() >> t1; // on regarde si cela correspond bien a une reference existante if (!lesRef.Existe(elem.nomRef())) { cout << "\n erreur, la ref "<< elem.nomRef() << " de " << motcle << "ne correspond a aucun element" << " de la liste de reference lue !! \n"; elem.Affiche(); cout << " LectBloc::Lecture( etc ..." << endl; entreePrinc.MessageBuffer(message); exit (1); } // on verifie que l'on n'utilise pas deux fois la meme reference // pour deux cibles differentes list <T>::iterator ii; for (ii=lili.begin() ; ii != lili.end(); ii++) if (((*ii).nomRef() == elem.nomRef()) && ((*ii)::Valeur != elem::valeur)) { cout << "\n erreur , un meme nom de reference est utilisee pour" << " deux cibles differentes \n" << " nom de la ref = " << elem.nomRef() << ", valeurs des deux cibles =" << (*ii)::Valeur <<", "<< elem::valeur ; cout << " LectBloc::Lecture( etc etc .." << endl; entreePrinc.MessageBuffer(message); exit (1); } // stockage lili.push_back(elem); entreePrinc.NouvelleDonnee(); } // enregistrement des infos tabElem.Change_taille(lili.size()); list <T>::iterator i; int j; for (i=lili.begin(),j=1 ; i != lili.end(); i++,j++) tabEpaiss(j) = *i; } };

3097
Maillage/maillage4.cc Normal file

File diff suppressed because it is too large Load diff

96
Parametres/Banniere.h Normal file
View file

@ -0,0 +1,96 @@
// This file is part of the Herezh++ application.
//
// The finite element software Herezh++ is dedicated to the field
// of mechanics for large transformations of solid structures.
// It is developed by Gérard Rio (APP: IDDN.FR.010.0106078.000.R.P.2006.035.20600)
// INSTITUT DE RECHERCHE DUPUY DE LÔME (IRDL) <https://www.irdl.fr/>.
//
// Herezh++ is distributed under GPL 3 license ou ultérieure.
//
// Copyright (C) 1997-2022 Université Bretagne Sud (France)
// AUTHOR : Gérard Rio
// E-MAIL : gerardrio56@free.fr
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License,
// or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//
// For more information, please consult: <https://herezh.irdl.fr/>.
/************************************************************************
* DATE: 07/01/2003 *
* $ *
* AUTEUR: G RIO (mailto:gerardrio56@free.fr) *
* $ *
* PROJET: Herezh++ *
* $ *
************************************************************************
* BUT: Bannière du programme *
* $ *
* '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' * *
* VERIFICATION: *
* *
* ! date ! auteur ! but ! *
* ------------------------------------------------------------ *
* ! ! ! ! *
* $ *
* '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' *
* MODIFICATIONS: *
* ! date ! auteur ! but ! *
* ------------------------------------------------------------ *
* $ *
************************************************************************/
#ifndef BANNIERE_H
#define BANNIERE_H
#include "ParaGlob.h"
#include "Tableau_T.h"
/// @addtogroup Les_parametres_generaux
/// @{
///
class Banniere
{
public :
// CONSTRUCTEURS :
// création de la banniére
Banniere() {};
// DESTRUCTEUR :
~Banniere();
// METHODES PUBLIQUES :
// affichage de la banniere sur la sortie passée en argument
static void Sortie_banniere(ofstream & sort);
// affichage de la banniere sur cout
static void Sortie_banniere();
// passage en lecture de la banniere
static void Passage_lecture_banniere(ifstream& entr);
// retour du copie pirate
static string CopiPirate(){return copipirate;};
private :
// VARIABLES PROTEGEES :
class Construc_banniere
{ public: Construc_banniere(); };
friend class Construc_banniere;
static Tableau <string> la_banniere;
static string copipirate;
static Construc_banniere construc_ban;
};
/// @} // end of group
#endif

96
Parametres/banniere.cc Normal file
View file

@ -0,0 +1,96 @@
// This file is part of the Herezh++ application.
//
// The finite element software Herezh++ is dedicated to the field
// of mechanics for large transformations of solid structures.
// It is developed by Gérard Rio (APP: IDDN.FR.010.0106078.000.R.P.2006.035.20600)
// INSTITUT DE RECHERCHE DUPUY DE LÔME (IRDL) <https://www.irdl.fr/>.
//
// Herezh++ is distributed under GPL 3 license ou ultérieure.
//
// Copyright (C) 1997-2022 Université Bretagne Sud (France)
// AUTHOR : Gérard Rio
// E-MAIL : gerardrio56@free.fr
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License,
// or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//
// For more information, please consult: <https://herezh.irdl.fr/>.
#include "Banniere.h"
// VARIABLES static :
Tableau <string> Banniere::la_banniere; // création du tableau par défaut
string Banniere::copipirate; // le copipirate
// création de la banniére par un artifice
// 1° préparation
Banniere::Construc_banniere::Construc_banniere()
{ la_banniere.Change_taille(16);
la_banniere(1) = "\n#######################################################################";
la_banniere(2) = "\n# #";
la_banniere(3) = "\n# | | ==== === ==== ==== | | | | #";
la_banniere(4) = "\n# | | | | | | / | | | | #";
la_banniere(5) = "\n# |====| |=== === |=== / |====| ------- ------- #";
la_banniere(6) = "\n# | | | | \\ | / | | | | #";
la_banniere(7) = "\n# | | ==== | \\ ==== ==== | | | | #";
la_banniere(8) = "\n# #";
la_banniere(9) = "\n#######################################################################";
la_banniere(10) = "\n# Herezh++ is distributed under GPL 3 license ou ultérieure. #";
la_banniere(11) = "\n# Copyright (C) 1997-2022 Université Bretagne Sud (France) #";
la_banniere(12) = "\n# AUTHOR : Gérard Rio #";
la_banniere(13) = "\n# E-MAIL : gerardrio56@free.fr #";
la_banniere(14) = "\n# Certification IDDN.FR.010.0106078.000.R.P.2006.035.20600 #";
la_banniere(15) = "\n# #";
la_banniere(16) = "\n#######################################################################";
copipirate="Copyright (C) 1997-2022 Université Bretagne Sud (France), AUTHOR : Gérard Rio (gerardrio56@free.fr)/";
};
// 2° création réelle
Banniere::Construc_banniere Banniere::construc_ban;
// affichage de la banniere sur la sortie passée en argument
void Banniere::Sortie_banniere(ofstream & sort)
{ int taille = la_banniere.Taille();
for (int i=1;i<= taille;i++)
sort << la_banniere(i);
#ifndef MISE_AU_POINT
sort << "\n# (version la plus rapide )";
#endif
#ifdef MISE_AU_POINT
sort << "\n# (version avec le plus de verifications pendant le calcul et les I/O ) ";
#endif
};
// affichage de la banniere sur cout
void Banniere::Sortie_banniere()
{ int taille = la_banniere.Taille();
for (int i=1;i<= taille;i++)
cout << la_banniere(i);
#ifndef MISE_AU_POINT
cout << "\n# (version la plus rapide )";
#endif
#ifdef MISE_AU_POINT
cout << "\n# (version avec le plus de verifications pendant le calcul et les I/O ) ";
#endif
};
// passage en lecture de la banniere
void Banniere::Passage_lecture_banniere(ifstream& entr)
{ int taille = la_banniere.Taille();
string toto;
for (int i=1;i<= taille;i++)
entr >> toto;
};

0
Util/Courbes/Courbe_1-cos.cc Executable file
View file