Herezh_dev/herezh_pp/Util/Algo_Integ1D.h

115 lines
4.1 KiB
C++
Executable file

// 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.
//
// Copyright (C) 1997-2021 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/>.
/************************************************************************
* DATE: 14/03/2008 *
* $ *
* AUTEUR: G RIO (mailto:gerardrio56@free.fr) *
* $ *
* PROJET: Herezh++ *
************************************************************************
* BUT: Algorithme d'intégration 1D *
* $ *
* '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' *
* $ *
************************************************************************/
#ifndef ALGO_INTEG1D_H
#define ALGO_INTEG1D_H
#include "GeomSeg.h"
/// @addtogroup Les_classes_algo
/// @{
///
/**
*
* BUT: Algorithme d'intégration 1D
*
*
* \author Gérard Rio
* \version 1.0
* \date 14/03/2008
* \brief Algorithme d'intégration 1D
*
*/
class Algo_Integ1D
{
public :
// CONSTRUCTEURS :
/// constructeur par défaut
/// nbptGauss : nombre de point de Gauss, utilisé pour l'intégration
Algo_Integ1D(int nbptGauss=2);
/// constructeur de copie
Algo_Integ1D(const Algo_Integ1D& a);
/// DESTRUCTEUR :
~Algo_Integ1D() {};
// METHODES PUBLIQUES :
/// intégration d'une fonction à l'aide de la méthode de Gauss
///
/// en entrée:
/// *Pt_fonc : pointeur de la fonction,
/// tfin : temps finale
/// deltat : plage d'intégration
/// en sortie :
/// renvoie la valeur de l'intégrale de t0 à t0+deltat
template <class T> double IntegGauss(const double& tfin, T& instance
,double (T::*Pt_fonc) (const double & t)
,const double& deltat) ;
/// intégration d'une fonction à l'aide de la méthode de Gauss
/// mais ici avec un intervalle fixé de -1 à 1
/// en entrée:
/// *Pt_fonc : pointeur de la fonction, qui est fonction d'une valeur qui
/// doit varier de -1 à 1 (donc il faut faire les interpolations nécessaires)
/// deltat : plage d'intégration
/// en sortie :
/// renvoie la valeur de l'intégrale de t0 à t0+deltat
template <class T> double IntegGauss( T& instance
,double (T::*Pt_fonc) (const double & theta)
,const double& deltat) ;
private :
// VARIABLES PROTEGEES :
GeomSeg seg; // l'élément de référence 1D
// METHODES PROTEGEES :
};
// pour faire de l'inline: nécessaire avec les templates
// on n'inclut que les méthodes templates
#include "Algo_Integ1D_2.cc"
#define Algo_Integ1D_deja_inclus
/// @} // end of group
#endif