2021-09-28 17:59:27 +02:00
|
|
|
// FICHIER : Tableau_5D.h
|
|
|
|
// CLASSE : Tableau_5D
|
|
|
|
|
|
|
|
// 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-28 17:59:27 +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: 23/01/97 *
|
|
|
|
* $ *
|
|
|
|
* AUTEUR: G RIO (mailto:gerardrio56@free.fr) *
|
|
|
|
* $ *
|
|
|
|
* PROJET: Herezh++ *
|
|
|
|
* $ *
|
|
|
|
************************************************************************
|
|
|
|
* La classe Tableau_5D permet de declarer des tableaux a cinq dimensions dont
|
|
|
|
* les composantes sont de type double.
|
|
|
|
* Les composantes d'une instance de cette classe sont stockees en ligne et la memoire
|
|
|
|
* est allouee dynamiquement.
|
|
|
|
* $ *
|
|
|
|
* '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' *
|
|
|
|
* *
|
|
|
|
* VERIFICATION: *
|
|
|
|
* *
|
|
|
|
* ! date ! auteur ! but ! *
|
|
|
|
* ------------------------------------------------------------ *
|
|
|
|
* ! ! ! ! *
|
|
|
|
* $ *
|
|
|
|
* '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' *
|
|
|
|
* MODIFICATIONS: *
|
|
|
|
* ! date ! auteur ! but ! *
|
|
|
|
* ------------------------------------------------------------ *
|
|
|
|
* $ *
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
// La classe Tableau_5D permet de declarer des tableaux a cinq dimensions dont
|
|
|
|
// les composantes sont de type double.
|
|
|
|
// Les composantes d'une instance de cette classe sont stockees en ligne et la memoire
|
|
|
|
// est allouee dynamiquement.
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef TABLEAU_5D_H
|
|
|
|
#define TABLEAU_5D_H
|
|
|
|
|
|
|
|
|
|
|
|
#include <iostream>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include "Sortie.h"
|
|
|
|
|
|
|
|
|
|
|
|
/// @addtogroup Les_Tableaux_generiques
|
|
|
|
/// @{
|
|
|
|
///
|
|
|
|
|
|
|
|
|
|
|
|
class Tableau_5D
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
public :
|
|
|
|
|
|
|
|
|
|
|
|
// CONSTRUCTEURS :
|
|
|
|
|
|
|
|
// Constructeur par defaut
|
|
|
|
Tableau_5D ();
|
|
|
|
|
|
|
|
// Constructeur utile quand les cinq dimensions ainsi qu'une
|
|
|
|
// eventuelle valeur d'initialisation sont connues
|
|
|
|
Tableau_5D (int d1,int d2,int d3,int d4,int d5,double val=0.0);
|
|
|
|
|
|
|
|
// Constructeur de copie
|
|
|
|
Tableau_5D (const Tableau_5D& tab);
|
|
|
|
|
|
|
|
|
|
|
|
// DESTRUCTEUR :
|
|
|
|
|
|
|
|
~Tableau_5D ();
|
|
|
|
|
|
|
|
|
|
|
|
// METHODES :
|
|
|
|
|
|
|
|
inline void Affiche ()
|
|
|
|
// Affiche les donnees du tableau a cinq dimensions
|
|
|
|
{
|
|
|
|
|
|
|
|
cout << "Tableau 5D\n";
|
|
|
|
cout << "Dimension 1 : " << Taille1() << " .\n";
|
|
|
|
cout << "Dimension 2 : " << Taille2() << " .\n";
|
|
|
|
cout << "Dimension 3 : " << Taille3() << " .\n";
|
|
|
|
cout << "Dimension 4 : " << Taille4() << " .\n";
|
|
|
|
cout << "Dimension 5 : " << Taille5() << " .\n";
|
|
|
|
cout << "Composante(s) :\n{\n";
|
|
|
|
for (int i=0;i<dim1;i++)
|
|
|
|
{
|
|
|
|
cout << "( ";
|
|
|
|
for (int j=0;j<dim2;j++)
|
|
|
|
{
|
|
|
|
cout << "\t[ ";
|
|
|
|
for (int k=0;k<dim3;k++)
|
|
|
|
{
|
|
|
|
cout << "[ ";
|
|
|
|
for (int l=0;l<dim4;l++)
|
|
|
|
{
|
|
|
|
cout << "[ ";
|
|
|
|
for (int m=0;m<dim5;m++)
|
|
|
|
{
|
|
|
|
cout << *(t+dim5*dim4*dim3*dim2*i+dim5*dim4*dim3*j
|
|
|
|
+dim5*dim4*k+dim5*l+m) << " ";
|
|
|
|
};
|
|
|
|
cout << " ]";
|
|
|
|
};
|
|
|
|
cout << " ]";
|
|
|
|
};
|
|
|
|
cout << "] \n";
|
|
|
|
};
|
|
|
|
cout << ") \n";
|
|
|
|
};
|
|
|
|
cout << "}\n\n";
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
inline int Taille1 ()
|
|
|
|
// Retourne la taille de la premiere dimension
|
|
|
|
{
|
|
|
|
|
|
|
|
return dim1;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
inline int Taille2 ()
|
|
|
|
// Retourne la taille de la deuxieme dimension
|
|
|
|
{
|
|
|
|
|
|
|
|
return dim2;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
inline int Taille3 ()
|
|
|
|
// Retourne la taille de la troisieme dimension
|
|
|
|
{
|
|
|
|
|
|
|
|
return dim3;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
inline int Taille4 ()
|
|
|
|
// Retourne la taille de la quatrieme dimension
|
|
|
|
{
|
|
|
|
|
|
|
|
return dim4;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
inline int Taille5 ()
|
|
|
|
// Retourne la taille de la cinquieme dimension
|
|
|
|
{
|
|
|
|
|
|
|
|
return dim5;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
inline double& operator() (int i,int j,int k,int l,int m)
|
|
|
|
// Retourne la ieme jieme kieme lieme mieme composante
|
|
|
|
{
|
|
|
|
|
|
|
|
if ( (i<1) || (i>dim1) || (j<1) || (j>dim2)
|
|
|
|
|| (k<1) || (k>dim3) || (l<1) || (l>dim4) || (m<1) || (m>dim5) )
|
|
|
|
{
|
|
|
|
cout << "\nErreur : composante inexistante !\n";
|
|
|
|
cout << "TABLEAU_3D::OPERATOR[](int ,int ,int ) \n";
|
|
|
|
Sortie(1);
|
|
|
|
};
|
|
|
|
return *(t+dim5*dim4*dim3*dim2*(i-1)+dim5*dim4*dim3*(j-1)+dim5*dim4*(k-1)
|
|
|
|
+dim5*(l-1)+(m-1));
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
// Initialisation des composantes du tableau
|
|
|
|
void Initialise (double val=0.0);
|
|
|
|
|
|
|
|
// Desallocation des composantes du tableau
|
|
|
|
void Libere ();
|
|
|
|
|
|
|
|
// Surcharge de l'operateur = : egalite entre deux tableaux a cinq dimensions
|
|
|
|
Tableau_5D& operator= (const Tableau_5D& tab);
|
|
|
|
|
|
|
|
|
|
|
|
protected :
|
|
|
|
|
|
|
|
|
|
|
|
int dim1; // dimension dans la premiere direction
|
|
|
|
int dim2; // dimension dans la seconde direction
|
|
|
|
int dim3; // dimension dans la troisieme direction
|
|
|
|
int dim4; // dimension dans la quatrieme direction
|
|
|
|
int dim5; // dimension dans la cinquieme direction
|
|
|
|
double* t; // tableau des composantes
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
/// @} // end of group
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|