Herezh_dev/Maillage/DdlNoeudElement.cc

97 lines
3.1 KiB
C++
Raw Permalink Normal View History

// 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)
// 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 "DdlNoeudElement.h"
// CONSTRUCTEURS :
DdlNoeudElement::DdlNoeudElement () : // par defaut
tb()
{ /*pt = NULL;*/};
DdlNoeudElement::DdlNoeudElement (int n) :
tb(n)
{ /* pt = new int [n];*/};
// de copie
DdlNoeudElement::DdlNoeudElement (const DdlNoeudElement& a) :
tb(a.tb)
{ // int nbddl = a.tb.Taille();
/* pt = new int[nbddl];
for (int i=0;i<= nbddl-1; i++)
pt[i] = a.pt[i];*/
};
// DESTRUCTEUR :
DdlNoeudElement::~DdlNoeudElement ()
{/*if (pt != NULL) delete [] pt;*/};
// Methodes
// surcharge de l'affectation
DdlNoeudElement& DdlNoeudElement::operator = (const DdlNoeudElement & a)
{ this->tb = a.tb;
/*if (pt != NULL) delete [] pt;*/
//int nbddl = a.tb.Taille();
/* pt = new int[nbddl];
for (int i=0;i<= nbddl-1; i++)
this->pt[i] = a.pt[i];*/
return *this;
};
// surcharge des tests
bool DdlNoeudElement::operator == (const DdlNoeudElement & a) const
{ if (this->tb != a.tb) return false;
/*for (int i=1;i<=(this->tb).Taille();i++)
if (this->pt[i-1] != a.pt[i-1]) return false;*/
return true;
};
bool DdlNoeudElement::operator != ( const DdlNoeudElement & a) const
{ if (*this == a) return false;
else return true;
};
// surcharge de l'operator de lecture
istream & operator >> (istream & entree, DdlNoeudElement& a)
{ // vérification du type
string type;
entree >> type;
if (type != "DdlNoeudElement")
{Sortie (1);
return entree;
}
// entrée du tableau d'enum de ddl
entree >> a.tb;
return entree;
};
// surcharge de l'operator d'ecriture
ostream & operator << (ostream & sort, const DdlNoeudElement& a)
{ // tout d'abord un indicateur donnant le type
sort << "DdlNoeudElement " ;
// puis le tableau d'enum_ddl
sort << a.tb;
return sort;
};