// ************************************************************************ // --- Logiciel MEF++ // --- // --- Copyright 1996-2006 GIREF, Université Laval // --- TOUS DROITS RÉSERVÉS // --- ALL RIGHTS RESERVED // --- // --- Ce logiciel est couvert par la Loi sur le droit d'auteur. // --- L'utilisation, ou la modification de ce logiciel sous toutes ses // --- formes, que ce soit code source ou code compilé, à des fins // --- personnelles et non commerciales sont autorisées sans frais pour // --- autant que la présente notice de copyright ainsi que cette // --- permission apparaissent dans toutes les copies ainsi que dans la // --- documentation. // --- Le GIREF et l'Université Laval ne prétendent en aucune façon que // --- ce code convient à un emploi quelconque. Celui-ci est distribué // --- sans aucune garantie implicite ou explicite. // ************************************************************************ // ******************************************************************** // Nom du fichier: ChampTijklCelluleViscoMaxwellHPP // // Nom de la classe: ChampTijklCelluleViscoMaxwellHPP.cc // // ******************************************************************** #include "ChampTijklCelluleViscoMaxwellHPP.h" #include "ChampTensorielO4Sym.h" #include "fonctionsTenseurs.h" // ******************************************************************** // // Description: Constructeur par défaut. // // Entrée: Aucune // // Sortie: Aucune // // ******************************************************************** ChampTijklCelluleViscoMaxwellHPP::ChampTijklCelluleViscoMaxwellHPP(const std::string& pNom) :aChampElasticiteRef(0), aChampFonctionElasticiteViscositeRef(0), aChampMultiplicateur_b(0), aChampDeriveeMultiplicateur_b(0), aChampMultiplicateur_bPrecedent(0), aChampDeriveeMultiplicateur_bPrecedent(0), aChampFonctionVieillisementLambda(0), aChampFonctionVieillisementLambdaPrecedent(0), aChampIndicateurEtat(0), aPasDeTemps(0), aThetaSchema(0), aAppelRecursifComposante(false) { _GIREF_CONSTRUCTEUR_INVARIANTS; for (Entier i = 0; i < 21; ++i) { aComposantes[i].asgnParametres(*this, i); } asgnNom(pNom); _GIREF_TEST_INVARIANTS; } // ******************************************************************** // // Description: Constructeur par copie. // // Entrée: pChampTijklCelluleViscoMaxwellHPP: l'objet à copier // // Sortie: Aucune // // ******************************************************************** ChampTijklCelluleViscoMaxwellHPP::ChampTijklCelluleViscoMaxwellHPP(const ChampTijklCelluleViscoMaxwellHPP& pChampTijklCelluleViscoMaxwellHPP) : ChampAnalytiqueBaseDiscParElement(), aAppelRecursifComposante(false) { _GIREF_APPEL_TEST_INVARIANTS(pChampTijklCelluleViscoMaxwellHPP); _GIREF_CONSTRUCTEUR_INVARIANTS; for (Entier i = 0; i < 21;++i) { aComposantes[i].asgnParametres(*this, i); } asgnNom(pChampTijklCelluleViscoMaxwellHPP.reqNom()); *this = pChampTijklCelluleViscoMaxwellHPP; _GIREF_TEST_INVARIANTS; } // ******************************************************************** // // Description: Destructeur. // // Entrée: Aucune // // Sortie: Aucune // // ******************************************************************** ChampTijklCelluleViscoMaxwellHPP::~ChampTijklCelluleViscoMaxwellHPP() { _GIREF_TEST_INVARIANTS; _GIREF_DESTRUCTEUR_INVARIANTS; } // ******************************************************************** // // Description: Opérateur d'assignation. // // Entrée: pChampTijklCelluleViscoMaxwellHPP: l'objet à copier // // Sortie: Une référence sur l'objet courant // // ******************************************************************** ChampTijklCelluleViscoMaxwellHPP& ChampTijklCelluleViscoMaxwellHPP::operator= (const ChampTijklCelluleViscoMaxwellHPP& pChampTijklCelluleViscoMaxwellHPP) { _GIREF_TEST_INVARIANTS; _GIREF_APPEL_TEST_INVARIANTS(pChampTijklCelluleViscoMaxwellHPP); ChampAnalytiqueBaseDiscParElement::operator=(pChampTijklCelluleViscoMaxwellHPP); if (this != &pChampTijklCelluleViscoMaxwellHPP) { aChampElasticiteRef = pChampTijklCelluleViscoMaxwellHPP.aChampElasticiteRef; aChampFonctionElasticiteViscositeRef = pChampTijklCelluleViscoMaxwellHPP.aChampFonctionElasticiteViscositeRef; aChampMultiplicateur_b = pChampTijklCelluleViscoMaxwellHPP.aChampMultiplicateur_b; aChampDeriveeMultiplicateur_b = pChampTijklCelluleViscoMaxwellHPP.aChampDeriveeMultiplicateur_b; aChampMultiplicateur_bPrecedent = pChampTijklCelluleViscoMaxwellHPP.aChampMultiplicateur_bPrecedent; aChampDeriveeMultiplicateur_bPrecedent = pChampTijklCelluleViscoMaxwellHPP.aChampDeriveeMultiplicateur_bPrecedent; aChampFonctionVieillisementLambda =pChampTijklCelluleViscoMaxwellHPP.aChampFonctionVieillisementLambda; aChampFonctionVieillisementLambdaPrecedent =pChampTijklCelluleViscoMaxwellHPP.aChampFonctionVieillisementLambdaPrecedent; aChampIndicateurEtat = pChampTijklCelluleViscoMaxwellHPP.aChampIndicateurEtat; aPasDeTemps = pChampTijklCelluleViscoMaxwellHPP.aPasDeTemps; aThetaSchema = pChampTijklCelluleViscoMaxwellHPP.aThetaSchema; } _GIREF_TEST_INVARIANTS; return *this; } // ******************************************************************** // // Description: Méthode d'assignation des champs necessaire a la construction du // tenseur dans le cas ou on a dépendance en temps de l'élasticité. // // Entrée: pChampElasticiteRef le tenseur O4 d'élasticité de référence qui NE DEPEND PAS DU TEMPS // pChampFonctionElasticiteViscositeRe le tenseur O4 de viscosité de référence qui NE DEPEND PAS DU TEMPS // pPasDeTemps Longeur du pas de temps // pThetaSchema parametre du theta schema // Sortie: Rien // // ******************************************************************** void ChampTijklCelluleViscoMaxwellHPP::asgnChampsSansVieillissement(ChampTensorielO4Sym &pChampElasticiteRef, ChampTensorielO4Sym &pChampFonctionElasticiteViscositeRef, DReel &pPasDeTemps, const DReel &pThetaSchema) { _GIREF_TEST_INVARIANTS; _GIREF_PRECONDITION(0!= &pChampElasticiteRef, "Pointeur nul!"); _GIREF_PRECONDITION(0!= &pChampFonctionElasticiteViscositeRef, "Pointeur nul!"); _GIREF_PRECONDITION(0!= &pPasDeTemps, "Pointeur nul!"); _GIREF_PRECONDITION(0!= &pThetaSchema, "Pointeur nul!"); aChampElasticiteRef = &pChampElasticiteRef; aChampFonctionElasticiteViscositeRef = &pChampFonctionElasticiteViscositeRef; aPasDeTemps = &pPasDeTemps; aThetaSchema = pThetaSchema; aChampMultiplicateur_b =0; aChampMultiplicateur_bPrecedent=0; aChampDeriveeMultiplicateur_b=0; aChampDeriveeMultiplicateur_bPrecedent=0; aChampFonctionVieillisementLambda=0; aChampFonctionVieillisementLambdaPrecedent=0; _GIREF_TEST_INVARIANTS; } // ******************************************************************** // // Description: Méthode d'assignation des champs necessaire a la construction du // tenseur dans le cas ou on a dépendance en temps de l'élasticité. // // Entrée: pChampElasticiteRef le tenseur O4 d'élasticité de référence qui NE DEPEND PAS DU TEMPS // pChampViscositeRef le tenseur O4 de viscosité de référence qui NE DEPEND PAS DU TEMPS // pChampDeltaTempsReduit la variation du temps réduit (l'intégrale de b/a sur [t_n,t_n+1]) // pChampMultiplicateur_b le champs scalaire de la valeur courante de b // pChampChampFonctionVieillisementLambda le champs scalaire de la valeur courante de l // pChampIndicateurEtat indicateur de la loi de comportement Hooke <=0 ou Bazant >0 // // Sortie: Rien // // ******************************************************************** void ChampTijklCelluleViscoMaxwellHPP::asgnChampsAvecVieillissement(ChampTensorielO4Sym &pChampElasticiteRef, ChampTensorielO4Sym &pChampFonctionElasticiteViscositeRef, ChampScalaire &pChampMultiplicateur_b, ChampScalaire &pChampDeriveeMultiplicateur_b, ChampScalaire &pChampMultiplicateur_bPrecedent, ChampScalaire &pChampDeriveeMultiplicateur_bPrecedent, ChampScalaire &pChampFonctionVieillisementLambda, ChampScalaire &pChampFonctionVieillisementLambdaPrecedent, ChampScalaire &pChampIndicateurEtat, DReel &pPasDeTemps, const DReel &pThetaSchema) { _GIREF_TEST_INVARIANTS; _GIREF_PRECONDITION(0!= &pChampElasticiteRef, "Pointeur nul!"); _GIREF_PRECONDITION(0!= &pChampFonctionElasticiteViscositeRef, "Pointeur nul!"); _GIREF_PRECONDITION(0!= &pChampMultiplicateur_b, "Pointeur nul!"); _GIREF_PRECONDITION(0!= &pChampDeriveeMultiplicateur_b, "Pointeur nul!"); _GIREF_PRECONDITION(0!= &pChampMultiplicateur_bPrecedent, "Pointeur nul!"); _GIREF_PRECONDITION(0!= &pChampDeriveeMultiplicateur_bPrecedent,"Pointeur nul!"); _GIREF_PRECONDITION(0!= &pChampFonctionVieillisementLambda, "Pointeur nul!"); _GIREF_PRECONDITION(0!= &pChampFonctionVieillisementLambdaPrecedent, "Pointeur nul!"); _GIREF_PRECONDITION(0!= &pChampIndicateurEtat, "Pointeur nul!"); _GIREF_PRECONDITION(0!= &pPasDeTemps, "Pointeur nul!"); _GIREF_PRECONDITION(0!= &pThetaSchema, "Pointeur nul!"); aChampElasticiteRef = &pChampElasticiteRef; aChampFonctionElasticiteViscositeRef = &pChampFonctionElasticiteViscositeRef; aChampMultiplicateur_b = &pChampMultiplicateur_b; aChampDeriveeMultiplicateur_b = &pChampDeriveeMultiplicateur_b; aChampMultiplicateur_bPrecedent = &pChampMultiplicateur_bPrecedent; aChampDeriveeMultiplicateur_bPrecedent = &pChampDeriveeMultiplicateur_bPrecedent; aChampFonctionVieillisementLambda = &pChampFonctionVieillisementLambda; aChampFonctionVieillisementLambdaPrecedent = &pChampFonctionVieillisementLambdaPrecedent; aChampIndicateurEtat = &pChampIndicateurEtat; aPasDeTemps = &pPasDeTemps; aThetaSchema = pThetaSchema; _GIREF_TEST_INVARIANTS; } // ******************************************************************** // // Description: Méthode permettant d'assigner un nouveau temps // au Champ. Les évaluations subséquentes utiliseront // cette valeur, si elles en ont besoin. On appelle la méthode sur // chacune des composantes du champ // // Entrée: pTemps, le nouveau temps à utiliser. // // Sortie: Aucune // // ******************************************************************** void ChampTijklCelluleViscoMaxwellHPP::asgnTemps(const DReel& pTemps) { _GIREF_TEST_INVARIANTS; _GIREF_PRECONDITION(0 != aChampElasticiteRef, "Le champ d'elasticiteRef n'est pas assigné"); if (!aAppelRecursifComposante) { aAppelRecursifComposante = true; ChampAnalytiqueBaseDiscParElement::asgnTemps(pTemps); if(aChampIndicateurEtat){ aChampMultiplicateur_b -> asgnTemps(pTemps); aChampDeriveeMultiplicateur_b -> asgnTemps(pTemps); aChampFonctionVieillisementLambda -> asgnTemps(pTemps); aChampMultiplicateur_bPrecedent -> asgnTemps(pTemps); aChampDeriveeMultiplicateur_bPrecedent -> asgnTemps(pTemps); aChampFonctionVieillisementLambdaPrecedent-> asgnTemps(pTemps); aChampIndicateurEtat -> asgnTemps(pTemps); } aAppelRecursifComposante = false; } _GIREF_TEST_INVARIANTS; } // ******************************************************************** // // Description: evalue(X,Y,Z,T) = evaluation de l'ExpressionAlgebrique // // Entrée: pCoor, la coordonnee a laquelle evaluer la fonction // pTemps, le temps de l'evaluation de la fonction // // Sortie: L'evaluation de la fonction // // ******************************************************************** void ChampTijklCelluleViscoMaxwellHPP::evalue(const Vecteur3D& /*pCoor*/, const DReel& /*pTemps*/, TenseurO4Sym& /*pValeur*/) const { _GIREF_TEST_INVARIANTS; _GIREF_ASSERTION(false, "Pas implanté"); _GIREF_TEST_INVARIANTS; } // ******************************************************************** // // Description: Crée un champ du même type // // Entrée: Aucune // // Sortie: Un pointeur vers l'objet créé // // ******************************************************************** ChampTijklCelluleViscoMaxwellHPP* ChampTijklCelluleViscoMaxwellHPP::newChamp() const { _GIREF_TEST_INVARIANTS; return new ChampTijklCelluleViscoMaxwellHPP(); } // ******************************************************************** // // Description: Crée un champ du même type en se copiant soi-même // // Entrée: Aucune // // Sortie: Un pointeur vers l'objet créé // // ******************************************************************** ChampTijklCelluleViscoMaxwellHPP* ChampTijklCelluleViscoMaxwellHPP::newChampCopie() const { _GIREF_TEST_INVARIANTS; return new ChampTijklCelluleViscoMaxwellHPP(*this); } // ******************************************************************** // // Description: Retourne le ChampScalContinu representant la // composante X du Champ courant. // // Entrée: Aucune // // Sortie: Une reference sur la composante X // // ******************************************************************** ChampScalaire& ChampTijklCelluleViscoMaxwellHPP::reqComposante(const Entier pIndice) { _GIREF_TEST_INVARIANTS; _GIREF_PRECONDITION(21> pIndice && 0<= pIndice, "Indice trop grand ou trop petit"); return aComposantes[pIndice]; } // ******************************************************************** // // Description: Retourne le ChampScalContinu representant la // composante X du Champ courant. // // Entrée: Aucune // // Sortie: Une reference sur la composante X // // ******************************************************************** const ChampScalaire& ChampTijklCelluleViscoMaxwellHPP::reqComposante(const Entier pIndice) const { _GIREF_TEST_INVARIANTS; _GIREF_PRECONDITION(21 > pIndice && 0<= pIndice, "Indice trop grand ou trop petit"); return aComposantes[pIndice]; } // ******************************************************************** // // Description: Methode de lecture du Champ // // Entrée: pEntree, un "Input Stream". // // Sortie: Un message d'erreur s'il y a un probleme a la lecture. // // ******************************************************************** ERMsg ChampTijklCelluleViscoMaxwellHPP::importeVersion0(std::istream& /*pEntree*/) { _GIREF_TEST_INVARIANTS; ERMsg lMsg; lMsg = ERMsg(ERMsg::ERREUR,"ERR_FORMAT_FICHIER"); lMsg.ajoute("ChampTijklCelluleViscoMaxwellHPP"); _GIREF_TEST_INVARIANTS; return lMsg; } // ******************************************************************** // // Description: Methode d'ecriture du Champ // // Entrée: pSortie, un "Output Stream". // // Sortie: Un message d'erreur s'il y a un probleme a l'ecriture. // // ******************************************************************** ERMsg ChampTijklCelluleViscoMaxwellHPP::exporteVersion0(std::ostream& _GIREF_PARAM_DEBUG(pSortie)) const { _GIREF_TEST_INVARIANTS; _GIREF_PRECONDITION((pSortie), "Le ostream pSortie est en erreur"); ERMsg lMsg; _GIREF_ASSERTION(false,"Operation non supportee (nouveau format)"); _GIREF_TEST_INVARIANTS; return lMsg; } // ******************************************************************** // // Description: Assignation des évaluations à faire sur le champ. // // Entrée: Entier pChoixEvaluations: Les évaluations à faire. // // Sortie: Aucune // // ******************************************************************** void ChampTijklCelluleViscoMaxwellHPP::ajouteEvaluationsAFaire(Entier pChoixEvaluations, const SchemaIntg& pSchemaIntg) { _GIREF_TEST_INVARIANTS; _GIREF_PRECONDITION(!EvalsChampLocal::reqChoixPourChampComporteEvaluationsAutresQueChamp(pChoixEvaluations), "Pas supporté"); if (!aAppelRecursifComposante && pChoixEvaluations & EvalsChampLocal::EvalueChamp) { aAppelRecursifComposante = true; ChampAnalytiqueBaseDiscParElement::ajouteEvaluationsAFaire(pChoixEvaluations, pSchemaIntg); aAppelRecursifComposante = false; // on ajoute les evaluations a faire a chaque composante aChampElasticiteRef -> ajouteEvaluationsAFaire(EvalsChampLocal::EvalueChamp,pSchemaIntg); aChampFonctionElasticiteViscositeRef -> ajouteEvaluationsAFaire(EvalsChampLocal::EvalueChamp,pSchemaIntg); if(aChampIndicateurEtat){ aChampMultiplicateur_b -> ajouteEvaluationsAFaire(EvalsChampLocal::EvalueChamp,pSchemaIntg); aChampDeriveeMultiplicateur_b->ajouteEvaluationsAFaire(EvalsChampLocal::EvalueChamp,pSchemaIntg); aChampFonctionVieillisementLambda -> ajouteEvaluationsAFaire(EvalsChampLocal::EvalueChamp,pSchemaIntg); aChampMultiplicateur_bPrecedent -> ajouteEvaluationsAFaire(EvalsChampLocal::EvalueChamp,pSchemaIntg); aChampDeriveeMultiplicateur_bPrecedent->ajouteEvaluationsAFaire(EvalsChampLocal::EvalueChamp,pSchemaIntg); aChampFonctionVieillisementLambdaPrecedent -> ajouteEvaluationsAFaire(EvalsChampLocal::EvalueChamp,pSchemaIntg); aChampIndicateurEtat -> ajouteEvaluationsAFaire(EvalsChampLocal::EvalueChamp,pSchemaIntg); } } _GIREF_TEST_INVARIANTS; } // ******************************************************************** // // Description: On remet à zéro les évaluations à faire. // // Entrée: Aucune // // Sortie: Aucune // // ******************************************************************** void ChampTijklCelluleViscoMaxwellHPP::remetAZeroEvaluationsAFaire(const SchemaIntg& pSchemaIntg) { _GIREF_TEST_INVARIANTS; if (!aAppelRecursifComposante) { aAppelRecursifComposante = true; ChampAnalytiqueBaseDiscParElement::remetAZeroEvaluationsAFaire(pSchemaIntg); aAppelRecursifComposante = false; aChampElasticiteRef -> remetAZeroEvaluationsAFaire(pSchemaIntg); aChampFonctionElasticiteViscositeRef -> remetAZeroEvaluationsAFaire(pSchemaIntg); if(aChampIndicateurEtat){ aChampMultiplicateur_b -> remetAZeroEvaluationsAFaire(pSchemaIntg); aChampDeriveeMultiplicateur_b -> remetAZeroEvaluationsAFaire(pSchemaIntg); aChampFonctionVieillisementLambda -> remetAZeroEvaluationsAFaire(pSchemaIntg); aChampMultiplicateur_bPrecedent -> remetAZeroEvaluationsAFaire(pSchemaIntg); aChampDeriveeMultiplicateur_bPrecedent -> remetAZeroEvaluationsAFaire(pSchemaIntg); aChampFonctionVieillisementLambdaPrecedent -> remetAZeroEvaluationsAFaire(pSchemaIntg); aChampIndicateurEtat -> remetAZeroEvaluationsAFaire(pSchemaIntg); } } _GIREF_TEST_INVARIANTS; } // ******************************************************************** // // Description: Méthode qui ajoute un schéma d'intégration afin que les // fonctions de bases soient précalculées et les calculs // de "transfert" sur un éléments soient stockés. // // Entrée: const SchemaIntg& pSchemaIntg: Le schéma à assigner // // Sortie: Aucune // // ******************************************************************** void ChampTijklCelluleViscoMaxwellHPP::ajouteSchemaIntegration(const SchemaIntg& pSchemaIntg) { _GIREF_TEST_INVARIANTS; if (!aAppelRecursifComposante) { aAppelRecursifComposante = true; ChampAnalytiqueBaseDiscParElement::ajouteSchemaIntegration(pSchemaIntg); aAppelRecursifComposante = false; aChampElasticiteRef -> ajouteSchemaIntegration(pSchemaIntg); aChampFonctionElasticiteViscositeRef -> ajouteSchemaIntegration(pSchemaIntg); if(aChampIndicateurEtat){ aChampMultiplicateur_b -> ajouteSchemaIntegration(pSchemaIntg); aChampDeriveeMultiplicateur_b -> ajouteSchemaIntegration(pSchemaIntg); aChampFonctionVieillisementLambda -> ajouteSchemaIntegration(pSchemaIntg); aChampMultiplicateur_bPrecedent -> ajouteSchemaIntegration(pSchemaIntg); aChampDeriveeMultiplicateur_bPrecedent -> ajouteSchemaIntegration(pSchemaIntg); aChampFonctionVieillisementLambdaPrecedent -> ajouteSchemaIntegration(pSchemaIntg); aChampIndicateurEtat -> ajouteSchemaIntegration(pSchemaIntg); } } _GIREF_TEST_INVARIANTS; } // ******************************************************************** // // Description: Méthode qui efface toutes les mémoires de fonctions de bases // précalculées. // // Entrée: Aucune // // Sortie: Aucune // // ******************************************************************** void ChampTijklCelluleViscoMaxwellHPP::enleveToutSchemaIntegrations() { _GIREF_TEST_INVARIANTS; if (!aAppelRecursifComposante) { aAppelRecursifComposante = true; ChampAnalytiqueBaseDiscParElement::enleveToutSchemaIntegrations(); aAppelRecursifComposante = false; aChampElasticiteRef -> enleveToutSchemaIntegrations(); aChampFonctionElasticiteViscositeRef -> enleveToutSchemaIntegrations(); if(aChampIndicateurEtat){ aChampMultiplicateur_b -> enleveToutSchemaIntegrations(); aChampDeriveeMultiplicateur_b -> enleveToutSchemaIntegrations(); aChampFonctionVieillisementLambda -> enleveToutSchemaIntegrations(); aChampMultiplicateur_bPrecedent -> enleveToutSchemaIntegrations(); aChampDeriveeMultiplicateur_bPrecedent -> enleveToutSchemaIntegrations(); aChampFonctionVieillisementLambdaPrecedent -> enleveToutSchemaIntegrations(); aChampIndicateurEtat -> enleveToutSchemaIntegrations(); } } _GIREF_TEST_INVARIANTS; } // ******************************************************************** // // Description: Méthode qui transfert les informations d'interpolation // sur un élément. Si elles sont pré-calculées, on trasnfert simplement // le pointeur. // // Entrée: Aucune // // Sortie: Aucune // // ******************************************************************** template const VectDyn >& ChampTijklCelluleViscoMaxwellHPP::transfertChampSurGenerique(const PTTypeObjet& pObjet, const SchemaIntg& pSchemaIntg, const VectDyn& pVectInfoLocalesTransformation) const { _GIREF_TEST_INVARIANTS; _GIREF_PRECONDITION(aConteneurMemoireChamp[pSchemaIntg.reqIndiceSchemaAjoute()].reqSchemaIntg() == pSchemaIntg, "Mauvais Schéma d'intégration dans la mémoire"); _GIREF_PRECONDITION(!EvalsChampLocal::reqChoixPourChampComporteEvaluationsAutresQueChamp(aConteneurMemoireChamp[pSchemaIntg.reqIndiceSchemaAjoute()].reqEvaluationsAFaire()), "Pas supporté"); _GIREF_PRECONDITION((aChampIndicateurEtat && aChampMultiplicateur_b) || (!aChampIndicateurEtat && !aChampMultiplicateur_b), "Incompatibilité entre l'indicateur d'état et le multiplicateur de l'élasticité au pas courant"); const Entier lNoIndiceSchema = pSchemaIntg.reqIndiceSchemaAjoute(); // Ici on transfert l'information calculée sur l'élément par pointeur. VectDyn >& lVectInfoLocalesChamp = aConteneurMemoireChamp[lNoIndiceSchema].reqVectInfoLocalesChamp(); //Est-ce que la mémoire contient l'information sur le bon élément? if (Champ::reqMemoireChampDesactivee() || TraitMemoireChamp::reqDernierObjetEvalue(aConteneurMemoireChamp[lNoIndiceSchema]) != &pObjet) { const Entier lChoixEvaluations = aConteneurMemoireChamp[lNoIndiceSchema].reqEvaluationsAFaire(); const bool lFlagEvalueChamp = lChoixEvaluations & EvalsChampLocal::EvalueChamp; // Valeurs de l'evaluation const EntierN lNbPtIntg = pVectInfoLocalesTransformation.reqLongueur(); lVectInfoLocalesChamp.asgnLongueur(lNbPtIntg); if (lFlagEvalueChamp) { const VectDyn& lVectInfoElas = aChampElasticiteRef->transfertChampSur(pObjet, pSchemaIntg, pVectInfoLocalesTransformation); const VectDyn& lVectInfoFonctElasVisc = aChampFonctionElasticiteViscositeRef->transfertChampSur(pObjet, pSchemaIntg, pVectInfoLocalesTransformation); const VectDyn >* lVectInfoMultiplicateur_b = 0; const VectDyn >* lVectInfoDeriveeMultiplicateur_b = 0; const VectDyn >* lVectInfoFonctVielLambda = 0; const VectDyn >* lVectInfoMultiplicateur_bPrec = 0; const VectDyn >* lVectInfoDeriveeMultiplicateur_bPrec = 0; const VectDyn >* lVectInfoFonctVielLambdaPrec = 0; const VectDyn >* lVectInfoIndicateurEtat = 0; if(aChampIndicateurEtat){ lVectInfoMultiplicateur_b = &aChampMultiplicateur_b->transfertChampSur(pObjet, pSchemaIntg, pVectInfoLocalesTransformation); lVectInfoDeriveeMultiplicateur_b = &aChampDeriveeMultiplicateur_b->transfertChampSur(pObjet, pSchemaIntg, pVectInfoLocalesTransformation); lVectInfoMultiplicateur_bPrec = &aChampMultiplicateur_bPrecedent->transfertChampSur(pObjet, pSchemaIntg, pVectInfoLocalesTransformation); lVectInfoDeriveeMultiplicateur_bPrec = &aChampDeriveeMultiplicateur_bPrecedent->transfertChampSur(pObjet, pSchemaIntg, pVectInfoLocalesTransformation); lVectInfoIndicateurEtat = &aChampIndicateurEtat->transfertChampSur(pObjet, pSchemaIntg, pVectInfoLocalesTransformation); lVectInfoFonctVielLambda = &aChampFonctionVieillisementLambda->transfertChampSur(pObjet, pSchemaIntg, pVectInfoLocalesTransformation); lVectInfoFonctVielLambdaPrec = &aChampFonctionVieillisementLambdaPrecedent->transfertChampSur(pObjet, pSchemaIntg, pVectInfoLocalesTransformation); } { // On fait le calcul const Entier lNbPtIntg = lVectInfoElas.reqLongueur(); TenseurO4Sym lUniteO4(1.); DReel lCoef2 = (aThetaSchema)*(*aPasDeTemps); DReel lUnMoinsThetaDelta_t = (1.0-aThetaSchema)*(*aPasDeTemps); for (Entier lPt = 0; lPt < lNbPtIntg; ++lPt) { // Boucle sur les points d'integrations DReel lb_nPlus1(1.); DReel lDeriveeb_nPlus1(0); DReel lFonctVielLambda_nPlus1(1); DReel lb_n(1.); DReel lDeriveeb_n(0); DReel lFonctVielLambda_n(1); DReel lDivise = 0; DReel lDivisePrec = 0; if(aChampMultiplicateur_b) lb_nPlus1 = (*lVectInfoMultiplicateur_b)[lPt].reqValeurChamp(); if(aChampDeriveeMultiplicateur_b) lDeriveeb_nPlus1 = (*lVectInfoDeriveeMultiplicateur_b)[lPt].reqValeurChamp(); if(aChampFonctionVieillisementLambda) lFonctVielLambda_nPlus1 = (*lVectInfoFonctVielLambda)[lPt].reqValeurChamp(); if(aChampMultiplicateur_bPrecedent) lb_n = (*lVectInfoMultiplicateur_bPrec)[lPt].reqValeurChamp(); if(aChampDeriveeMultiplicateur_bPrecedent) lDeriveeb_n = (*lVectInfoDeriveeMultiplicateur_bPrec)[lPt].reqValeurChamp(); if(aChampFonctionVieillisementLambdaPrecedent) lFonctVielLambda_n = (*lVectInfoFonctVielLambdaPrec)[lPt].reqValeurChamp(); TenseurO4Sym lUniteO4(1.); TenseurO4Sym lMoinsUniteO4(-1.); TenseurO4Sym lMoinsUnitePrecO4(-1.); TenseurO4Sym lUnitePrecO4Int(1.); if (aChampIndicateurEtat) { lDivise = lDeriveeb_nPlus1/lb_nPlus1; lDivisePrec = lDeriveeb_n /lb_n; } TenseurO4Sym lAlpha = lVectInfoFonctElasVisc[lPt].reqValeurChamp(); lAlpha*=lFonctVielLambda_nPlus1; TenseurO4Sym lAlphaPrec = lVectInfoFonctElasVisc[lPt].reqValeurChamp(); lAlphaPrec*=lFonctVielLambda_n; bool lUtiliseHooke(true); TenseurO4Sym lGammaPrec(0.); lUnitePrecO4Int*= lDeriveeb_n; lGammaPrec+=lUnitePrecO4Int; if(aChampIndicateurEtat) { lUtiliseHooke = ((*lVectInfoIndicateurEtat)[lPt].reqValeurChamp() <= 0.); } if(lUtiliseHooke){ // On complete la construction de Alpha et AlphaPrecedent lMoinsUniteO4*=lDivise; lMoinsUnitePrecO4*=lDivisePrec; // std::cout<<"lUtiliseHooke ChampTijklCelluleViscoMaxwellHPP :lMoinsUniteO4 "<::reqDernierObjetEvalue(aConteneurMemoireChamp[lNoIndiceSchema]), "Aye dernier element pas stocke"); _GIREF_TEST_INVARIANTS; return lVectInfoLocalesChamp; } // ******************************************************************** // // Description: Méthode qui transfert les informations d'interpolation // sur un élément. Si elles sont pré-calculées, on trasnfert simplement // le pointeur. // // Entrée: Aucune // // Sortie: Aucune // // ******************************************************************** const VectDyn >& ChampTijklCelluleViscoMaxwellHPP::transfertChampSur(const Maillage::TypeElement& pElement, const SchemaIntg& pSchemaIntg, const VectDyn& pVectInfoLocalesTransformation) const { _GIREF_TEST_INVARIANTS; return transfertChampSurGenerique(pElement, pSchemaIntg, pVectInfoLocalesTransformation); } // ******************************************************************** // // Description: Methode de lecture du Champ // // Entrée: pEntree, un "Input Stream". // // Sortie: Un message d'erreur s'il y a un probleme a la lecture. // // ******************************************************************** void ChampTijklCelluleViscoMaxwellHPP::lisVirtuel (PRStreamLecture& pPRLecture) { _GIREF_TEST_INVARIANTS; _GIREF_PRECONDITION((pPRLecture), "Le PRStreamLecture pPRLecture est en erreur"); // std::string lNumeroVersion; lisDebutClasse(pPRLecture,"ChampTijklCelluleViscoMaxwellHPP"); lisNumeroVersion(pPRLecture,lNumeroVersion); if(pPRLecture && lNumeroVersion != "Version 1.0") { pPRLecture.asgMsg(ERMsg(ERMsg::ERREUR, "ERR_NUMERO_VERSION")); } // ChampAnalytiqueBaseDiscParElement::lisVirtuel(pPRLecture); // lisFinClasse(pPRLecture,"ChampTijklCelluleViscoMaxwellHPP"); // _GIREF_TEST_INVARIANTS; } // ******************************************************************** // // Description: Methode d'ecriture du Champ // // Entrée: pSortie, un "Output Stream". // // Sortie: Un message d'erreur s'il y a un probleme a l'ecriture. // // ******************************************************************** void ChampTijklCelluleViscoMaxwellHPP::ecrisVirtuel (PRStreamEcriture& pPREcriture) const { _GIREF_TEST_INVARIANTS; _GIREF_PRECONDITION((pPREcriture), "Le PRStreamEcriture pPREcriture est en erreur"); // ecrisDebutClasse(pPREcriture,"ChampTijklCelluleViscoMaxwellHPP"); ecrisNumeroVersion(pPREcriture,"Version 1.0"); // ChampAnalytiqueBaseDiscParElement::ecrisVirtuel(pPREcriture); ERMsg lMsg = ERMsg(ERMsg::OK); // ecrisFinClasse(pPREcriture,"ChampTijklCelluleViscoMaxwellHPP"); // _GIREF_TEST_INVARIANTS; } // ******************************************************************** // // Description: Méthode qui teste les invariants de la classe. // // Entrée: Aucune // // Sortie: Arrêt du programme en cas d'erreur // // ******************************************************************** #ifdef GIREF_MODE_DEBUG void ChampTijklCelluleViscoMaxwellHPP::testInvariants() const { ChampAnalytiqueBaseDiscParElement::testInvariants(); _GIREF_TEST_OBJET_INVARIANTS; } #endif // #ifdef GIREF_MODE_DEBUG