Herezh_dev/Elements/Geometrie/ElemGeom/Point/GeomPoint.cc

137 lines
5 KiB
C++
Raw 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 "Debug.h"
#include "GeomPoint.h"
#include <math.h>
#include "MathUtil.h"
#include "ConstMath.h"
// dimension 1, 1 pt d'integ, 1 noeuds, 0 face et 0 ligne
GeomPoint::GeomPoint() :
ElemGeomC0(1,1,1,0,0,POINT,RIEN_INTERPOL) , tabD2Phi(1)
,phi_M(1),dphi_M(1,1)
{ // def de la taille du tableau contenant la dérivée seconde
tabD2Phi(1).Initialise (dimension,NBNE,0.);
// ----------------------------------------------
// coordonnees et poids des points d'integrations
// ( -1 <= KSI <= +1 )
// ----------------------------------------------
// def de W et de ptInteg
// cas avec un pt d'integ
KSI(1)= 0.; // localement
WI(1)= 1.;
// fonction et derivees des fonctions d'interpolation
// ainsi que coordonnées des noeuds
id_interpol=CONSTANT;
tabPhi(1)(1) = 1.;
tabDPhi(1)(1,1) = 0.;
ptelem(1) = Coordonnee(0.);
// la numérotation d'un élément inverse
INVCONNEC(1)=1;
// le tableau des tranches
IND.Change_taille(1); IND(1)=1;
// les interpolations au point M
phi_M(1)=1.;dphi_M(1,1)=0.;
};
// constructeur de copie
GeomPoint::GeomPoint(const GeomPoint& a) :
ElemGeomC0(a),tabD2Phi(a.tabD2Phi)
,phi_M(a.phi_M),dphi_M(a.dphi_M)
{
};
// création d'élément identiques : cette fonction est analogue à la fonction new
// elle y fait d'ailleurs appel. l'implantation est spécifique dans chaque classe
// dérivée
// pt est le pointeur qui est affecté par la fonction
ElemGeomC0 * GeomPoint::newElemGeomC0(ElemGeomC0 * pt)
{ pt = new GeomPoint(*this);
return pt;
};
//--------- cas de coordonnees locales quelconques ----------------
// retourne les fonctions d'interpolation au point M (en coordonnees locales)
2023-05-03 17:23:49 +02:00
const Vecteur& GeomPoint::Phi_point(const Coordonnee& M)
{
#ifdef MISE_AU_POINT
// verification de la dimension des coordonnees locales
if (M.Dimension() != 1)
{ cout << "\n erreur la dimension des coordonnees locales :" << M.Dimension()
<<"n\'est pas egale a 1 "
<< "\nGeomPoint::Phi(Coordonnee& M)";
Sortie(1);
}
#endif
// Vecteur phi(1); // tableau des fonctions d'interpolation
// // fonction des fonctions d'interpolation
// phi(1) = 1.;
return phi_M;
};
// retourne les derivees des fonctions d'interpolation au point M (en coordonnees locales)
2023-05-03 17:23:49 +02:00
const Mat_pleine& GeomPoint::Dphi_point(const Coordonnee& M)
{
#ifdef MISE_AU_POINT
// verification de la dimension des coordonnees locales
if (M.Dimension() != 1)
{ cout << "\n erreur la dimension des coordonnees locales :" << M.Dimension()
<<"n\'est pas egale a 1 "
<< "\nGeomPoint::Dphi(Coordonnee& M)";
Sortie(1);
}
#endif
// Mat_pleine dphi(1,1); // le tableau des derivees
// // fonction et derivees des fonctions d'interpolation
// dphi(1,1) = 0.;
return dphi_M;
};
// en fonction de coordonnees locales, retourne true si le point est a l'interieur
// de l'element, false sinon
bool GeomPoint::Interieur(const Coordonnee& M)
{ if (Abs(M(1)) <= ConstMath::trespetit )
return true;
else
return false;
};
// en fonction de coordonnees locales, retourne le point local P, maximum intérieur à l'élément, donc sur la frontière
// dont les coordonnées sont sur la droite GM: c-a-d GP = alpha GM, avec apha maxi et P appartenant à la frontière
// de l'élément, G étant le centre de gravité, sauf si GM est nul, dans ce cas retour de M
Coordonnee GeomPoint::Maxi_Coor_dans_directionGM(const Coordonnee& ) //(const Coordonnee& M)
{ // on recherche du maxi de la composante en valeur absolu
// en fait ici il n'y a que 0. qui convient
return (Coordonnee(0.));
};