// 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) . // // 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 . // // For more information, please consult: . #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 ("<> (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; };