2021-09-18 09:47:14 +02:00
|
|
|
|
|
|
|
// 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.
|
|
|
|
//
|
2023-05-03 17:23:49 +02:00
|
|
|
// Copyright (C) 1997-2022 Université Bretagne Sud (France)
|
2021-09-18 09:47:14 +02:00
|
|
|
// 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: 19/01/2006 *
|
|
|
|
* $ *
|
|
|
|
* AUTEUR: G RIO (mailto:gerardrio56@free.fr) *
|
|
|
|
* $ *
|
|
|
|
* PROJET: Herezh++ *
|
|
|
|
* $ *
|
|
|
|
************************************************************************
|
|
|
|
* BUT: class de stockage d'un ddl étendue, associé au type *
|
|
|
|
* Ddl_enum_etendu. En fait il s'agit du pendant des types *
|
|
|
|
* Ddl associé au type enum_ddl *
|
|
|
|
* Noter que la grandeur stockée est un scalaire !! *
|
|
|
|
* $ *
|
|
|
|
* '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' * *
|
|
|
|
* VERIFICATION: *
|
|
|
|
* *
|
|
|
|
* ! date ! auteur ! but ! *
|
|
|
|
* ------------------------------------------------------------ *
|
|
|
|
* ! ! ! ! *
|
|
|
|
* $ *
|
|
|
|
* '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' *
|
|
|
|
* MODIFICATIONS: *
|
|
|
|
* ! date ! auteur ! but ! *
|
|
|
|
* ------------------------------------------------------------ *
|
|
|
|
* $ *
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
#ifndef DDL_ETENDU_H
|
|
|
|
#define DDL_ETENDU_H
|
|
|
|
|
|
|
|
|
|
|
|
#include "Ddl_enum_etendu.h"
|
|
|
|
#include "Enum_boolddl.h"
|
|
|
|
|
|
|
|
|
|
|
|
#include <iostream>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include "Sortie.h"
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
/// @addtogroup Les_classes_Ddl_en_tout_genre
|
|
|
|
/// @{
|
|
|
|
///
|
|
|
|
|
|
|
|
|
|
|
|
/// BUT: class de stockage d'un ddl étendue, associé au type
|
|
|
|
/// Ddl_enum_etendu. En fait il s'agit du pendant des types
|
|
|
|
/// Ddl associé au type enum_ddl
|
|
|
|
/// Noter que la grandeur stockée est un scalaire !!
|
|
|
|
///
|
|
|
|
/// \author Gérard Rio
|
|
|
|
/// \version 1.0
|
|
|
|
/// \date 19/01/2006
|
|
|
|
///
|
|
|
|
///
|
|
|
|
|
|
|
|
class Ddl_etendu
|
|
|
|
{
|
|
|
|
// surcharge de l'operator de lecture
|
|
|
|
friend istream & operator >> (istream & entree, Ddl_etendu& a);
|
|
|
|
// surcharge de l'operator d'ecriture
|
|
|
|
friend ostream & operator << (ostream & sort, const Ddl_etendu& a);
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
|
|
// CONSTRUCTEURS :
|
|
|
|
|
|
|
|
// Constructeur par défaut
|
|
|
|
Ddl_etendu ();
|
|
|
|
|
|
|
|
// Constructeur fonction des variables, la seconde est facultative
|
|
|
|
Ddl_etendu (const Ddl_enum_etendu& ddl,double vale=0.0) ;
|
|
|
|
|
|
|
|
// Constructeur de copie
|
|
|
|
Ddl_etendu (const Ddl_etendu& d);
|
|
|
|
|
|
|
|
|
|
|
|
// DESTRUCTEUR :
|
|
|
|
|
|
|
|
~Ddl_etendu ();
|
|
|
|
|
|
|
|
|
|
|
|
// METHODES :
|
|
|
|
|
|
|
|
// Retourne la valeur associee au degre de liberte
|
|
|
|
// en lecture écriture
|
|
|
|
inline double& Valeur() { return val_ddl; };
|
|
|
|
// idem en lecture seulement
|
|
|
|
inline const double& ConstValeur() const { return val_ddl; };
|
|
|
|
|
|
|
|
// Retourne le Ddl_enum_etendu associé
|
|
|
|
// en lecture écriture
|
|
|
|
inline Ddl_enum_etendu& DdlEnumEtendu() { return ddl_enum_etendu; };
|
|
|
|
// idem mais en constant
|
|
|
|
inline const Ddl_enum_etendu& Const_DdlEnumEtendu() const { return ddl_enum_etendu; };
|
|
|
|
|
|
|
|
// Affiche les donnees liees au degre de liberte
|
|
|
|
void Affiche() const { cout << *this; };
|
|
|
|
void Affiche(ostream& sort) const { sort << *this; };
|
|
|
|
void Affiche(ostream& sort,int nb) const { sort << setprecision(nb) << *this; };
|
|
|
|
|
|
|
|
inline Ddl_etendu& operator= (const Ddl_etendu& d)
|
|
|
|
// Realise l'egalite entre deux degres de liberte étendus
|
|
|
|
{ ddl_enum_etendu=d.ddl_enum_etendu;
|
|
|
|
val_ddl=d.val_ddl;
|
|
|
|
return (*this);
|
|
|
|
};
|
|
|
|
// Surcharge de l'operateur +=
|
|
|
|
inline void operator+= (const Ddl_etendu& c)
|
|
|
|
{if (c.ddl_enum_etendu == ddl_enum_etendu)
|
|
|
|
{val_ddl += c.val_ddl;}
|
|
|
|
else
|
|
|
|
{cout << "\n *** erreur d'affectation void operator+= (const Ddl_enum_etendu& c)";
|
|
|
|
cout << "\n this: "; this->Affiche();
|
|
|
|
cout << "\n c: "; c.Affiche();
|
|
|
|
Sortie(1);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
// Surcharge de l'operateur -=
|
|
|
|
inline void operator-= (const Ddl_etendu& c)
|
|
|
|
{if (c.ddl_enum_etendu == ddl_enum_etendu)
|
|
|
|
{val_ddl -= c.val_ddl;}
|
|
|
|
else
|
|
|
|
{cout << "\n *** erreur d'affectation void operator-= (const Ddl_enum_etendu& c)";
|
|
|
|
cout << "\n this: "; this->Affiche();
|
|
|
|
cout << "\n c: "; c.Affiche();
|
|
|
|
Sortie(1);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
// Surcharge de l'operateur *=
|
|
|
|
inline void operator*= (double val) {val_ddl *= val;};
|
|
|
|
// Surcharge de l'operateur /= : division par un scalaire
|
|
|
|
inline void operator/= (double val) {val_ddl /= val;};
|
|
|
|
|
|
|
|
//Surcharge d'operateur logique
|
|
|
|
// ne concerne que le type et non la valeur
|
|
|
|
bool operator == ( Ddl_etendu& a) const
|
|
|
|
{return (ddl_enum_etendu == a.ddl_enum_etendu);};
|
|
|
|
|
|
|
|
bool operator != ( Ddl_etendu& a) const
|
|
|
|
{return (ddl_enum_etendu != a.ddl_enum_etendu);};
|
|
|
|
|
|
|
|
// test du type et de la valeur
|
|
|
|
bool Identique(Ddl_etendu& a)
|
|
|
|
{ return ((*this == a)&&(val_ddl == a.val_ddl));};
|
|
|
|
|
|
|
|
|
|
|
|
protected :
|
|
|
|
|
|
|
|
Ddl_enum_etendu ddl_enum_etendu; // identificateur du nom
|
|
|
|
double val_ddl; // valeur associee
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
/// @} // end of group
|
|
|
|
|
|
|
|
// pour faire de l'inline
|
|
|
|
#ifndef MISE_AU_POINT
|
|
|
|
#include "Ddl_etendu.cc"
|
|
|
|
#define Ddl_etendu_deja_inclus
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|