Herezh_dev/Resolin/Resolution_Condi/Condilineaire_2.cc

92 lines
3.7 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-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/>.
#ifndef Condilineaire_deja_inclus
#include "Condilineaire.h"
#endif
// contient que les méthodes nécessitant les templates, qui doivent donc être
//incluses dans le .h
#ifndef Condilineaire_deja_inclus
#include "Condilineaire.h"
#ifdef UTILISATION_MPI // spécifique au calcul parallèle
// modification des infos à partir de l'indice rang inclus en fonction du vecteur passé en paramètre
// correspond à une désérialisation
// ramène le positionnement dans v pour un prochain enreg, sauf si > à la taille de v
// dans ce cas ramène 0
// on passe un pointeur de fonctions qui ramène un noeud en fonction d'un numéro de maillage et d'un
// numéro de noeud, ceci pour éviter de passer toute l'instance de la classe Les_maillages
template <class T> int Condilineaire::UnPack_vecteur(T& instance,const Vecteur& v,int rang,
Noeud & (T::*Ptfonc) (int num_mail,int num_noeud) const )
{ // le tableau de pointeurs
int taille_pt = (int) v(rang);rang++;
pt.Change_taille(taille_pt);
for (int i=1;i<=taille_pt;i++)
{pt(i) = (int) v(rang);rang++;};
// le vecteur val
int taille_val = (int) v(rang);rang++;
val.Change_taille(taille_val);
for (int i=1;i<=taille_val;i++)
{val(i) = v(rang);rang++;};
// beta
beta = v(rang); rang++;
// Uk_impose
Uk_impose = v(rang); rang++;
// le cas d'assemblage associé
rang = casAssemb.UnPack_vecteur(v,rang);
// le tableau t_enu
int taille_t_enu = (int) v(rang);rang++;
t_enu.Change_taille(taille_t_enu);
for (int i=1;i<=taille_t_enu;i++)
{t_enu(i) = (Enum_ddl) v(rang);rang++;};
// iddl
iddl = (int) v(rang); rang++;
// le taleau t_noeud
// on considère que la numérotation est la même pour tous les cpu
// du coup on sauvegarde le numéro de maillage et le numéro de noeud
int taille_t_noeud = (int) v(rang);rang++;
t_noeud.Change_taille(taille_t_noeud);
for (int i=1;i<=taille_t_noeud;i++)
{int num_mail = (int) v(rang);rang++;
int num_noeud = (int) v(rang);rang++;
t_noeud(i) = &((instance.*Ptfonc) (num_mail,num_noeud));
};
if (rang > v.Taille()) rang = 0;
return rang;
};
#endif
#endif