1 |
francois |
283 |
|
2 |
|
|
//------------------------------------------------------------ |
3 |
|
|
//------------------------------------------------------------ |
4 |
|
|
// MAGiC |
5 |
|
|
// Jean Christophe Cuilli�e et Vincent FRANCOIS |
6 |
|
|
// D�artement de G�ie M�anique - UQTR |
7 |
|
|
//------------------------------------------------------------ |
8 |
|
|
// Le projet MAGIC est un projet de recherche du d�artement |
9 |
|
|
// de g�ie m�anique de l'Universit�du Qu�ec � |
10 |
|
|
// Trois Rivi�es |
11 |
|
|
// Les librairies ne peuvent �re utilis�s sans l'accord |
12 |
|
|
// des auteurs (contact : francois@uqtr.ca) |
13 |
|
|
//------------------------------------------------------------ |
14 |
|
|
//------------------------------------------------------------ |
15 |
|
|
// |
16 |
|
|
// main.cpp |
17 |
|
|
// |
18 |
|
|
//------------------------------------------------------------ |
19 |
|
|
//------------------------------------------------------------ |
20 |
|
|
// COPYRIGHT 2000 |
21 |
|
|
// Version du 02/03/2006 �11H25 |
22 |
|
|
//------------------------------------------------------------ |
23 |
|
|
//------------------------------------------------------------ |
24 |
|
|
#include "gestionversion.h" |
25 |
|
|
#ifdef WINDOWS_VERSION |
26 |
|
|
#include "fenetre.h" |
27 |
|
|
#endif |
28 |
|
|
|
29 |
|
|
|
30 |
|
|
#include <string.h> |
31 |
|
|
#include "mg_file.h" |
32 |
|
|
#include "mg_export.h" |
33 |
francois |
492 |
#include "fct_export.h" |
34 |
francois |
283 |
#include "mg_import.h" |
35 |
|
|
#include "step_import.h" |
36 |
|
|
#include "acis_import.h" |
37 |
|
|
#include "step_import.h" |
38 |
francois |
428 |
#include "stl_import.h" |
39 |
francois |
283 |
#include "occ_import.h" |
40 |
francois |
296 |
#include "mc_gestionnaire.h" |
41 |
francois |
283 |
#include "vct_multi_modele.h" |
42 |
francois |
326 |
#include "mgaster.h" |
43 |
francois |
283 |
#include <ctype.h> |
44 |
|
|
#include <math.h> |
45 |
francois |
425 |
#include "mailleur_analyse.h" |
46 |
francois |
432 |
#include "magic_application.h" |
47 |
francois |
469 |
#include "fct_taille_fem_solution.h" |
48 |
francois |
612 |
#include "fem_maillage_quadratique_outils.h" |
49 |
francois |
628 |
#include "fem_maillage_outils.h" |
50 |
francois |
697 |
#include "mg_table.h" |
51 |
francois |
283 |
//--------------------------------------------------------------------------- |
52 |
|
|
|
53 |
|
|
|
54 |
|
|
void minuscule(char * mess) |
55 |
|
|
{ |
56 |
|
|
int nb=strlen(mess); |
57 |
|
|
for (int i=0;i<nb;i++) |
58 |
|
|
mess[i]=tolower(mess[i]); |
59 |
|
|
} |
60 |
|
|
|
61 |
francois |
432 |
|
62 |
francois |
283 |
int main(int argc,char **argv) |
63 |
|
|
{ |
64 |
francois |
432 |
std::vector<MAGIC_PARAMETRE_APPLICATION> lst; |
65 |
|
|
MAGIC_PARAMETRE_APPLICATION p1(2,(char*)"-gmsh",MAGIC_PARAMETRE_APPLICATION::ACTION,(char*)"Conversion du fichier MAGiC en gmsh"); |
66 |
|
|
MAGIC_PARAMETRE_APPLICATION p2(3,(char*)"-nodeforme",MAGIC_PARAMETRE_APPLICATION::BOOL,(char*)"Ne convertit pas les deformes des maillages FEM"); |
67 |
|
|
MAGIC_PARAMETRE_APPLICATION p3(4,(char*)"-copie",MAGIC_PARAMETRE_APPLICATION::ACTION,(char*)"Copie un fichier MAGiC en un autre"); |
68 |
|
|
MAGIC_PARAMETRE_APPLICATION p4(5,(char*)"-out",MAGIC_PARAMETRE_APPLICATION::STRING,(char*)"Fichier de sortie"); |
69 |
francois |
694 |
MAGIC_PARAMETRE_APPLICATION p5(6,(char*)"-aster",MAGIC_PARAMETRE_APPLICATION::ACTION,(char*)"Conversion MAGiC en format ASTER (uniquement calcul mecanique)"); |
70 |
francois |
514 |
MAGIC_PARAMETRE_APPLICATION p6(7,(char*)"-coderesu",MAGIC_PARAMETRE_APPLICATION::STRING,(char*)"Choix des valeurs à calculer par EF - Defaut 11111111 - |Surface moyenne|Surface inferieure|Surface superieur|Deplacement|Contraintes|Deformations|Contraintes equivalentes|Energie|"); |
71 |
francois |
505 |
MAGIC_PARAMETRE_APPLICATION p7(8,(char*)"-carte",MAGIC_PARAMETRE_APPLICATION::ACTION,(char*)"Conversion carte de taille ancien format en format gmsh"); |
72 |
francois |
432 |
MAGIC_PARAMETRE_APPLICATION p8(9,(char*)"-step",MAGIC_PARAMETRE_APPLICATION::ACTION,(char*)"Conversion de fichier step en format MAGiC"); |
73 |
|
|
MAGIC_PARAMETRE_APPLICATION p9(10,(char*)"-unite",MAGIC_PARAMETRE_APPLICATION::DOUBLE,(char*)"Facteur d'unité pour obtenir des métres - Defaut 1."); |
74 |
|
|
MAGIC_PARAMETRE_APPLICATION p10(11,(char*)"-stepocc",MAGIC_PARAMETRE_APPLICATION::ACTION,(char*)"Conversion de fichier step en format MAGiC via opencascade"); |
75 |
|
|
MAGIC_PARAMETRE_APPLICATION p11(12,(char*)"-sat",MAGIC_PARAMETRE_APPLICATION::ACTION,(char*)"Conversion de fichier sat en format MAGiC"); |
76 |
|
|
MAGIC_PARAMETRE_APPLICATION p12(13,(char*)"-eps",MAGIC_PARAMETRE_APPLICATION::DOUBLE,(char*)"Tolérance pour un double - Defaut 0.000001"); |
77 |
|
|
MAGIC_PARAMETRE_APPLICATION p13(14,(char*)"-epsgeo",MAGIC_PARAMETRE_APPLICATION::DOUBLE,(char*)"Distance max entre la triangulation et la géométrie - Defaut 1."); |
78 |
|
|
MAGIC_PARAMETRE_APPLICATION p14(15,(char*)"-importstl",MAGIC_PARAMETRE_APPLICATION::BOOL,(char*)"Importation de la triangulation STL"); |
79 |
|
|
MAGIC_PARAMETRE_APPLICATION p15(16,(char*)"-importtriangulation",MAGIC_PARAMETRE_APPLICATION::BOOL,(char*)"Importation de la triangulation STL avec noeuds fusionnés"); |
80 |
|
|
MAGIC_PARAMETRE_APPLICATION p16(17,(char*)"-occ",MAGIC_PARAMETRE_APPLICATION::ACTION,(char*)"Conversion de fichier opencascade en format MAGiC"); |
81 |
|
|
MAGIC_PARAMETRE_APPLICATION p17(18,(char*)"-fem",MAGIC_PARAMETRE_APPLICATION::ACTION,(char*)"Création d'un maillage fem"); |
82 |
|
|
MAGIC_PARAMETRE_APPLICATION p18(19,(char*)"-nummai",MAGIC_PARAMETRE_APPLICATION::INTEGER,(char*)"Numéro de maillage - Defaut le premier"); |
83 |
|
|
MAGIC_PARAMETRE_APPLICATION p19(20,(char*)"-degre",MAGIC_PARAMETRE_APPLICATION::INTEGER,(char*)"Degre du maillage à créer"); |
84 |
|
|
MAGIC_PARAMETRE_APPLICATION p20(21,(char*)"-astermagic",MAGIC_PARAMETRE_APPLICATION::ACTION,(char*)"Importation des resultats ASTER dans un maillage"); |
85 |
|
|
MAGIC_PARAMETRE_APPLICATION p21(22,(char*)"-fichieraster",MAGIC_PARAMETRE_APPLICATION::STRING,(char*)"Fichier aster"); |
86 |
francois |
706 |
MAGIC_PARAMETRE_APPLICATION p22(23,(char*)"-optis",MAGIC_PARAMETRE_APPLICATION::ACTION,(char*)"Conversion de fichier magic en format OPTIS - Fonction esactivée"); |
87 |
francois |
432 |
MAGIC_PARAMETRE_APPLICATION p23(24,(char*)"-optismagic",MAGIC_PARAMETRE_APPLICATION::ACTION,(char*)"Importation des résultats OPTIS"); |
88 |
|
|
MAGIC_PARAMETRE_APPLICATION p24(25,(char*)"-fichieroptis",MAGIC_PARAMETRE_APPLICATION::STRING,(char*)"Fichier optis"); |
89 |
|
|
MAGIC_PARAMETRE_APPLICATION p25(26,(char*)"-fichierflottant",MAGIC_PARAMETRE_APPLICATION::STRING,(char*)"Fichier flottant - Optionnel"); |
90 |
|
|
MAGIC_PARAMETRE_APPLICATION p26(27,(char*)"-seuil",MAGIC_PARAMETRE_APPLICATION::DOUBLE,(char*)"Seuil de densité pour conserver les éléments"); |
91 |
|
|
MAGIC_PARAMETRE_APPLICATION p27(28,(char*)"-niveau",MAGIC_PARAMETRE_APPLICATION::DOUBLE,(char*)"Facteur pour le seuil (parametre incertain)"); |
92 |
|
|
MAGIC_PARAMETRE_APPLICATION p28(29,(char*)"-selectgr",MAGIC_PARAMETRE_APPLICATION::ACTION,(char*)"Selection de groupe topologique"); |
93 |
|
|
MAGIC_PARAMETRE_APPLICATION p29(30,(char*)"-deselectgr",MAGIC_PARAMETRE_APPLICATION::ACTION,(char*)"Deselection de groupe topologique"); |
94 |
|
|
MAGIC_PARAMETRE_APPLICATION p30(31,(char*)"-numgeo",MAGIC_PARAMETRE_APPLICATION::INTEGER,(char*)"Numéro de geometrie - Defaut la première"); |
95 |
|
|
MAGIC_PARAMETRE_APPLICATION p31(32,(char*)"-numgt",MAGIC_PARAMETRE_APPLICATION::INTEGER,(char*)"Numéro de groupe topologique - Defaut le premier"); |
96 |
|
|
MAGIC_PARAMETRE_APPLICATION p32(33,(char*)"-numentite",MAGIC_PARAMETRE_APPLICATION::INTEGER,(char*)"Numéro d'entité à selectionner"); |
97 |
|
|
MAGIC_PARAMETRE_APPLICATION p33(34,(char*)"-expand",MAGIC_PARAMETRE_APPLICATION::BOOL,(char*)"Prend en compte la topologie sous-jacente dans la selection"); |
98 |
|
|
MAGIC_PARAMETRE_APPLICATION p34(35,(char*)"-examine",MAGIC_PARAMETRE_APPLICATION::ACTION,(char*)"Contenu d'un fichier MAGiC. Si un numero de maillage est présent l'action analyse ce maillage"); |
99 |
|
|
MAGIC_PARAMETRE_APPLICATION p35(36,(char*)"-angle",MAGIC_PARAMETRE_APPLICATION::DOUBLE,(char*)"Angle limite pour l'analyse de retournement de triangle - Defaut 0.03"); |
100 |
|
|
MAGIC_PARAMETRE_APPLICATION p36(37,(char*)"-fichierlog",MAGIC_PARAMETRE_APPLICATION::STRING,(char*)"Nom du fichier log"); |
101 |
francois |
516 |
MAGIC_PARAMETRE_APPLICATION p37(38,(char*)"-deforme",MAGIC_PARAMETRE_APPLICATION::ACTION,(char*)"Calcul un maillage déforme"); |
102 |
francois |
432 |
MAGIC_PARAMETRE_APPLICATION p38(39,(char*)"-fusiongeo",MAGIC_PARAMETRE_APPLICATION::ACTION,(char*)"Fusionne deux géométries"); |
103 |
|
|
MAGIC_PARAMETRE_APPLICATION p39(40,(char*)"-numsol1",MAGIC_PARAMETRE_APPLICATION::INTEGER,(char*)"Numéro de solution 1"); |
104 |
|
|
MAGIC_PARAMETRE_APPLICATION p40(41,(char*)"-numsol2",MAGIC_PARAMETRE_APPLICATION::INTEGER,(char*)"Numéro de solution 2"); |
105 |
|
|
MAGIC_PARAMETRE_APPLICATION p41(42,(char*)"-numsol3",MAGIC_PARAMETRE_APPLICATION::INTEGER,(char*)"Numéro de solution 3"); |
106 |
|
|
MAGIC_PARAMETRE_APPLICATION p42(43,(char*)"-numchamp1",MAGIC_PARAMETRE_APPLICATION::INTEGER,(char*)"Numéro de champs de la solution 1"); |
107 |
|
|
MAGIC_PARAMETRE_APPLICATION p43(44,(char*)"-numchamp2",MAGIC_PARAMETRE_APPLICATION::INTEGER,(char*)"Numéro de champs de la solution 2"); |
108 |
|
|
MAGIC_PARAMETRE_APPLICATION p44(45,(char*)"-numchamp3",MAGIC_PARAMETRE_APPLICATION::INTEGER,(char*)"Numéro de champs de la solution 3"); |
109 |
|
|
MAGIC_PARAMETRE_APPLICATION p45(46,(char*)"-ccf",MAGIC_PARAMETRE_APPLICATION::ACTION,(char*)"Application de conditions aux limites sur une topologie"); |
110 |
|
|
MAGIC_PARAMETRE_APPLICATION p46(47,(char*)"-ccft",MAGIC_PARAMETRE_APPLICATION::ACTION,(char*)"Application de conditions aux limites sur une topologie et sur les topologie sous jacente"); |
111 |
|
|
MAGIC_PARAMETRE_APPLICATION p47(48,(char*)"-ccfhelp",MAGIC_PARAMETRE_APPLICATION::ACTION,(char*)"Liste des conditions aux limites disponibles"); |
112 |
francois |
763 |
MAGIC_PARAMETRE_APPLICATION p48(49,(char*)"-valeur",MAGIC_PARAMETRE_APPLICATION::STRING,(char*)"Condition aux limites à appliquer sous la forme id:ccf:valeur ou id:ccf:formule:var1,var2"); |
113 |
francois |
432 |
MAGIC_PARAMETRE_APPLICATION p49(50,(char*)"-oricoque",MAGIC_PARAMETRE_APPLICATION::ACTION,(char*)"Orientation d'une coque"); |
114 |
|
|
MAGIC_PARAMETRE_APPLICATION p50(51,(char*)"-numcoque",MAGIC_PARAMETRE_APPLICATION::INTEGER,(char*)"Numéro de la coque - Defaut la premiere"); |
115 |
francois |
517 |
MAGIC_PARAMETRE_APPLICATION p51(52,(char*)"-stlmagic",MAGIC_PARAMETRE_APPLICATION::ACTION,(char*)"Importation de fichier STL"); |
116 |
francois |
432 |
MAGIC_PARAMETRE_APPLICATION p52(53,(char*)"-epsf",MAGIC_PARAMETRE_APPLICATION::DOUBLE,(char*)"Tolérance pour un float - Defaut 0.0001"); |
117 |
mejrim |
597 |
MAGIC_PARAMETRE_APPLICATION p53(54,(char*)"-calculaster",MAGIC_PARAMETRE_APPLICATION::ACTION,(char*)"Calcul ASTER"); |
118 |
francois |
454 |
MAGIC_PARAMETRE_APPLICATION p54(55,(char*)"-correspondance",MAGIC_PARAMETRE_APPLICATION::BOOL,(char*)"Ajout d'un fichier de correspondance entre GMSH et MAGIC"); |
119 |
francois |
505 |
MAGIC_PARAMETRE_APPLICATION p55(56,(char*)"-carte2",MAGIC_PARAMETRE_APPLICATION::ACTION,(char*)"Conversion carte de taille nouvelle version en format gmsh"); |
120 |
francois |
517 |
MAGIC_PARAMETRE_APPLICATION p56(57,(char*)"-stlout",MAGIC_PARAMETRE_APPLICATION::ACTION,(char*)"Conversion du fichier MAGiC en stl"); |
121 |
francois |
514 |
MAGIC_PARAMETRE_APPLICATION p57(58,(char*)"-comparetaille",MAGIC_PARAMETRE_APPLICATION::ACTION,(char*)"Compare la taille d'un maillage avec la taille d'une carte de taille isotrope ancienne version"); |
122 |
|
|
MAGIC_PARAMETRE_APPLICATION p58(59,(char*)"-cartetaille",MAGIC_PARAMETRE_APPLICATION::STRING,(char*)"Nom de la carte de taille a fournir"); |
123 |
|
|
MAGIC_PARAMETRE_APPLICATION p59(60,(char*)"-comparetaille2",MAGIC_PARAMETRE_APPLICATION::ACTION,(char*)"Compare la taille d'un maillage avec la taille d'une carte de taille isotrope nouvelle version"); |
124 |
francois |
516 |
MAGIC_PARAMETRE_APPLICATION p60(61,(char*)"-coefdef",MAGIC_PARAMETRE_APPLICATION::DOUBLE,(char*)"Coefficient de déformé - par defaut 0. = pas de creation de maillage"); |
125 |
francois |
517 |
MAGIC_PARAMETRE_APPLICATION p61(62,(char*)"-detachemaillage",MAGIC_PARAMETRE_APPLICATION::ACTION,(char*)"Détache un maillage des ses liens avec la géométrie"); |
126 |
francois |
706 |
MAGIC_PARAMETRE_APPLICATION p62(63,(char*)"-elastique",MAGIC_PARAMETRE_APPLICATION::BOOL,(char*)"Calcul aster en elasticité"); |
127 |
mejrim |
597 |
MAGIC_PARAMETRE_APPLICATION p63(64,(char*)"-thermique",MAGIC_PARAMETRE_APPLICATION::BOOL,(char*)"Calcul aster en thermique"); |
128 |
francois |
603 |
MAGIC_PARAMETRE_APPLICATION p64(65,(char*)"-contrainteplane",MAGIC_PARAMETRE_APPLICATION::BOOL,(char*)"Calcul aster en contrainte plane"); |
129 |
|
|
MAGIC_PARAMETRE_APPLICATION p65(66,(char*)"-deformationplane",MAGIC_PARAMETRE_APPLICATION::BOOL,(char*)"Calcul aster en deformation plane"); |
130 |
francois |
604 |
MAGIC_PARAMETRE_APPLICATION p66(67,(char*)"-sonde",MAGIC_PARAMETRE_APPLICATION::ACTION,(char*)"Obtenir un resultat sur une arete dans un fichier csv"); |
131 |
|
|
MAGIC_PARAMETRE_APPLICATION p67(68,(char*)"-numsol",MAGIC_PARAMETRE_APPLICATION::INTEGER,(char*)"Numero de la solution (la premiere par defaut)"); |
132 |
|
|
MAGIC_PARAMETRE_APPLICATION p68(69,(char*)"-numchamp",MAGIC_PARAMETRE_APPLICATION::INTEGER,(char*)"Numero du champs de la solution (le premier par defaut)"); |
133 |
|
|
MAGIC_PARAMETRE_APPLICATION p69(70,(char*)"-csvout",MAGIC_PARAMETRE_APPLICATION::STRING,(char*)"Nom du fichier csv"); |
134 |
|
|
MAGIC_PARAMETRE_APPLICATION p70(71,(char*)"-numare",MAGIC_PARAMETRE_APPLICATION::INTEGER,(char*)"Numero de l'arete à sonder (la premiere par default)"); |
135 |
francois |
628 |
MAGIC_PARAMETRE_APPLICATION p71(72,(char*)"-projsolution",MAGIC_PARAMETRE_APPLICATION::ACTION,(char*)"Projeter une solution sur un autre maillage"); |
136 |
|
|
MAGIC_PARAMETRE_APPLICATION p72(73,(char*)"-fichiersolution",MAGIC_PARAMETRE_APPLICATION::STRING,(char*)"Nom du fichier contenant la solution"); |
137 |
|
|
MAGIC_PARAMETRE_APPLICATION p73(74,(char*)"-comparesolution",MAGIC_PARAMETRE_APPLICATION::ACTION,(char*)"Comparer deux champs de solution. La reference est la deuxième solution."); |
138 |
francois |
656 |
MAGIC_PARAMETRE_APPLICATION p74(75,(char*)"-analysequadratique",MAGIC_PARAMETRE_APPLICATION::BOOL,(char*)"Analyse le maillage quadratique. Defaut non."); |
139 |
francois |
697 |
MAGIC_PARAMETRE_APPLICATION p75(76,(char*)"-table",MAGIC_PARAMETRE_APPLICATION::ACTION,(char*)"Extraire des tables de valeurs d'un maillage fem"); |
140 |
|
|
MAGIC_PARAMETRE_APPLICATION p76(77,(char*)"-noeud",MAGIC_PARAMETRE_APPLICATION::BOOL,(char*)"Action sur les noeuds"); |
141 |
|
|
MAGIC_PARAMETRE_APPLICATION p77(78,(char*)"-element1",MAGIC_PARAMETRE_APPLICATION::BOOL,(char*)"Action sur les element1D"); |
142 |
|
|
MAGIC_PARAMETRE_APPLICATION p78(79,(char*)"-element2",MAGIC_PARAMETRE_APPLICATION::BOOL,(char*)"Action sur les element2D"); |
143 |
|
|
MAGIC_PARAMETRE_APPLICATION p79(80,(char*)"-element3",MAGIC_PARAMETRE_APPLICATION::BOOL,(char*)"Action sur les element3D"); |
144 |
francois |
698 |
MAGIC_PARAMETRE_APPLICATION p80(81,(char*)"-numtopo",MAGIC_PARAMETRE_APPLICATION::INTEGER,(char*)"Action uniquement sur le numero de topologie mentionnée"); |
145 |
francois |
702 |
MAGIC_PARAMETRE_APPLICATION p81(82,(char*)"-maigmsh",MAGIC_PARAMETRE_APPLICATION::ACTION,(char*)"Importation d'un maillage de GMSH (-in peut être omis -out peut etre omis si -in n'est pas omis -numgeo le defaut correspond à un non attechement du maillage)"); |
146 |
|
|
MAGIC_PARAMETRE_APPLICATION p82(83,(char*)"-fichiergmsh",MAGIC_PARAMETRE_APPLICATION::STRING,(char*)"Nom du fichier gmsh"); |
147 |
francois |
706 |
MAGIC_PARAMETRE_APPLICATION p83(84,(char*)"-param",MAGIC_PARAMETRE_APPLICATION::STRING,(char*)"Nom du fichier parametre"); |
148 |
|
|
MAGIC_PARAMETRE_APPLICATION p84(85,(char*)"-creeparam",MAGIC_PARAMETRE_APPLICATION::BOOL,(char*)"Création d'un fichier parametre"); |
149 |
francois |
712 |
MAGIC_PARAMETRE_APPLICATION p85(86,(char*)"-importefonction",MAGIC_PARAMETRE_APPLICATION::ACTION,(char*)"Importation d'une fonction dans une géométrie"); |
150 |
|
|
MAGIC_PARAMETRE_APPLICATION p86(87,(char*)"-fichier",MAGIC_PARAMETRE_APPLICATION::STRING,(char*)"Nom du fichier à importer"); |
151 |
couturad |
719 |
MAGIC_PARAMETRE_APPLICATION p87(88,(char*)"-elastique_gd",MAGIC_PARAMETRE_APPLICATION::BOOL,(char*)"Calcul aster en elasticite grandes deformations"); |
152 |
|
|
MAGIC_PARAMETRE_APPLICATION p88(89,(char*)"-plastique",MAGIC_PARAMETRE_APPLICATION::BOOL,(char*)"Calcul aster en plasticite"); |
153 |
francois |
757 |
MAGIC_PARAMETRE_APPLICATION p89(90,(char*)"-base",MAGIC_PARAMETRE_APPLICATION::INTEGER,(char*)"Base de numerotation des entités code aster - Defaut 10"); |
154 |
|
|
MAGIC_PARAMETRE_APPLICATION p90(91,(char*)"-element_gauss1",MAGIC_PARAMETRE_APPLICATION::BOOL,(char*)"Action aux points de gauss sur les element1D"); |
155 |
|
|
MAGIC_PARAMETRE_APPLICATION p91(92,(char*)"-element_gauss2",MAGIC_PARAMETRE_APPLICATION::BOOL,(char*)"Action aux points de gauss sur les element2D"); |
156 |
|
|
MAGIC_PARAMETRE_APPLICATION p92(93,(char*)"-element_gauss3",MAGIC_PARAMETRE_APPLICATION::BOOL,(char*)"Action aux points de gauss sur les element3D"); |
157 |
francois |
763 |
MAGIC_PARAMETRE_APPLICATION p93(94,(char*)"-ccfi",MAGIC_PARAMETRE_APPLICATION::ACTION,(char*)"Application de conditions aux limites sur une topologie par identificateur d'une autre entité MAGiC"); |
158 |
|
|
MAGIC_PARAMETRE_APPLICATION p94(95,(char*)"-ccfit",MAGIC_PARAMETRE_APPLICATION::ACTION,(char*)"Application de conditions aux limites sur une topologie et sur les topologie sous jacente par identificateur d'une autre entité MAGiC"); |
159 |
|
|
MAGIC_PARAMETRE_APPLICATION p95(96,(char*)"-ccff",MAGIC_PARAMETRE_APPLICATION::ACTION,(char*)"Application de conditions aux limites sur une topologie sous forme de formule"); |
160 |
|
|
MAGIC_PARAMETRE_APPLICATION p96(97,(char*)"-ccfft",MAGIC_PARAMETRE_APPLICATION::ACTION,(char*)"Application de conditions aux limites sur une topologie et sur les topologie sous forme de formule"); |
161 |
sattarpa |
784 |
MAGIC_PARAMETRE_APPLICATION p97(98,(char*)"-opt",MAGIC_PARAMETRE_APPLICATION::BOOL,(char*)"Optimisation de la numerotation des noeuds"); |
162 |
couturad |
719 |
|
163 |
francois |
763 |
|
164 |
francois |
454 |
p1.ajouter_dependance(1);p1.ajouter_dependance(3);p1.ajouter_dependance(55); |
165 |
francois |
432 |
p3.ajouter_dependance(1);p3.ajouter_dependance(5); |
166 |
francois |
706 |
p5.ajouter_dependance(1);p5.ajouter_dependance(7);p5.ajouter_dependance(85); |
167 |
francois |
432 |
p7.ajouter_dependance(1); |
168 |
|
|
p8.ajouter_dependance(1);p8.ajouter_dependance(10); |
169 |
francois |
652 |
p10.ajouter_dependance(1);p10.ajouter_dependance(13);p10.ajouter_dependance(14);p10.ajouter_dependance(15);;p10.ajouter_dependance(16); |
170 |
francois |
432 |
p11.ajouter_dependance(1);p11.ajouter_dependance(10); |
171 |
francois |
652 |
p16.ajouter_dependance(1);p16.ajouter_dependance(13);p16.ajouter_dependance(14);p16.ajouter_dependance(15);;p16.ajouter_dependance(16); |
172 |
sattarpa |
784 |
p17.ajouter_dependance(1);p17.ajouter_dependance(19);p17.ajouter_dependance(20);p17.ajouter_dependance(75);p17.ajouter_dependance(98); |
173 |
francois |
757 |
p20.ajouter_dependance(1);p20.ajouter_dependance(19);p20.ajouter_dependance(22);p20.ajouter_dependance(90); |
174 |
francois |
706 |
//p22.ajouter_dependance(1);p22.ajouter_dependance(7); |
175 |
francois |
432 |
p23.ajouter_dependance(1);p23.ajouter_dependance(19);p23.ajouter_dependance(25);p23.ajouter_dependance(26);p23.ajouter_dependance(27);p23.ajouter_dependance(28); |
176 |
|
|
p28.ajouter_dependance(1);p28.ajouter_dependance(31);p28.ajouter_dependance(32);p28.ajouter_dependance(33);p28.ajouter_dependance(34); |
177 |
|
|
p29.ajouter_dependance(1);p29.ajouter_dependance(31);p29.ajouter_dependance(32);p29.ajouter_dependance(33);p29.ajouter_dependance(34); |
178 |
|
|
p34.ajouter_dependance(1);p34.ajouter_dependance(19);p34.ajouter_dependance(36);p34.ajouter_dependance(37); |
179 |
francois |
516 |
p37.ajouter_dependance(1);p37.ajouter_dependance(19);p37.ajouter_dependance(40);p37.ajouter_dependance(41);p37.ajouter_dependance(42);p37.ajouter_dependance(43);p37.ajouter_dependance(44);p37.ajouter_dependance(45);p37.ajouter_dependance(61); |
180 |
francois |
432 |
p38.ajouter_dependance(1);p38.ajouter_dependance(31); |
181 |
|
|
p45.ajouter_dependance(1);p45.ajouter_dependance(31);p45.ajouter_dependance(49); |
182 |
|
|
p46.ajouter_dependance(1);p46.ajouter_dependance(31);p46.ajouter_dependance(49); |
183 |
|
|
p49.ajouter_dependance(1);p49.ajouter_dependance(19);p49.ajouter_dependance(51);p49.ajouter_dependance(5); |
184 |
|
|
p51.ajouter_dependance(1);p51.ajouter_dependance(10);p51.ajouter_dependance(53); |
185 |
couturad |
719 |
p53.ajouter_dependance(1);p53.ajouter_dependance(7);p53.ajouter_dependance(19);p53.ajouter_dependance(63);p53.ajouter_dependance(64);p53.ajouter_dependance(65);p53.ajouter_dependance(66);p53.ajouter_dependance(84);p53.ajouter_dependance(85);p53.ajouter_dependance(88);p53.ajouter_dependance(89); |
186 |
francois |
469 |
p55.ajouter_dependance(1); |
187 |
francois |
475 |
p56.ajouter_dependance(1);p56.ajouter_dependance(19); |
188 |
francois |
514 |
p57.ajouter_dependance(1);p57.ajouter_dependance(19);p57.ajouter_dependance(59); |
189 |
|
|
p59.ajouter_dependance(1);p59.ajouter_dependance(19);p59.ajouter_dependance(59); |
190 |
francois |
517 |
p61.ajouter_dependance(1);p61.ajouter_dependance(5);p61.ajouter_dependance(19); |
191 |
francois |
628 |
p66.ajouter_dependance(1);p66.ajouter_dependance(31);p66.ajouter_dependance(68);p66.ajouter_dependance(69);p66.ajouter_dependance(70);p66.ajouter_dependance(71); |
192 |
|
|
p71.ajouter_dependance(1);p71.ajouter_dependance(73);p71.ajouter_dependance(68);p71.ajouter_dependance(69);p71.ajouter_dependance(19);p71.ajouter_dependance(5); |
193 |
|
|
p73.ajouter_dependance(1);p73.ajouter_dependance(5);p73.ajouter_dependance(40);p73.ajouter_dependance(41);p73.ajouter_dependance(43);p73.ajouter_dependance(44); |
194 |
francois |
757 |
p75.ajouter_dependance(1);p75.ajouter_dependance(5);p75.ajouter_dependance(19);p75.ajouter_dependance(77);p75.ajouter_dependance(78);p75.ajouter_dependance(79);p75.ajouter_dependance(80);p75.ajouter_dependance(81);p75.ajouter_dependance(91);p75.ajouter_dependance(92);p75.ajouter_dependance(93); |
195 |
francois |
702 |
p81.ajouter_dependance(1);p81.ajouter_dependance(5);p81.ajouter_dependance(31);p81.ajouter_dependance(83); |
196 |
francois |
712 |
p85.ajouter_dependance(1);p85.ajouter_dependance(31);p85.ajouter_dependance(87); |
197 |
francois |
763 |
p93.ajouter_dependance(1);p93.ajouter_dependance(31);p93.ajouter_dependance(49); |
198 |
|
|
p94.ajouter_dependance(1);p94.ajouter_dependance(31);p94.ajouter_dependance(49); |
199 |
|
|
p95.ajouter_dependance(1);p95.ajouter_dependance(31);p95.ajouter_dependance(49); |
200 |
|
|
p96.ajouter_dependance(1);p96.ajouter_dependance(31);p96.ajouter_dependance(49); |
201 |
francois |
432 |
lst.push_back(p1); |
202 |
|
|
lst.push_back(p2); |
203 |
|
|
lst.push_back(p3); |
204 |
|
|
lst.push_back(p4); |
205 |
|
|
lst.push_back(p5); |
206 |
|
|
lst.push_back(p6); |
207 |
|
|
lst.push_back(p7); |
208 |
|
|
lst.push_back(p8); |
209 |
|
|
lst.push_back(p9); |
210 |
|
|
lst.push_back(p10); |
211 |
|
|
lst.push_back(p11); |
212 |
|
|
lst.push_back(p12); |
213 |
|
|
lst.push_back(p13); |
214 |
|
|
lst.push_back(p14); |
215 |
|
|
lst.push_back(p15); |
216 |
|
|
lst.push_back(p16); |
217 |
|
|
lst.push_back(p17); |
218 |
|
|
lst.push_back(p18); |
219 |
|
|
lst.push_back(p19); |
220 |
|
|
lst.push_back(p20); |
221 |
|
|
lst.push_back(p21); |
222 |
|
|
lst.push_back(p22); |
223 |
|
|
lst.push_back(p23); |
224 |
|
|
lst.push_back(p24); |
225 |
|
|
lst.push_back(p25); |
226 |
|
|
lst.push_back(p26); |
227 |
|
|
lst.push_back(p27); |
228 |
|
|
lst.push_back(p28); |
229 |
|
|
lst.push_back(p29); |
230 |
|
|
lst.push_back(p30); |
231 |
|
|
lst.push_back(p31); |
232 |
|
|
lst.push_back(p32); |
233 |
|
|
lst.push_back(p33); |
234 |
|
|
lst.push_back(p34); |
235 |
|
|
lst.push_back(p35); |
236 |
|
|
lst.push_back(p36); |
237 |
|
|
lst.push_back(p37); |
238 |
|
|
lst.push_back(p38); |
239 |
|
|
lst.push_back(p39); |
240 |
|
|
lst.push_back(p40); |
241 |
|
|
lst.push_back(p41); |
242 |
|
|
lst.push_back(p42); |
243 |
|
|
lst.push_back(p43); |
244 |
|
|
lst.push_back(p44); |
245 |
|
|
lst.push_back(p45); |
246 |
|
|
lst.push_back(p46); |
247 |
|
|
lst.push_back(p47); |
248 |
|
|
lst.push_back(p48); |
249 |
|
|
lst.push_back(p49); |
250 |
|
|
lst.push_back(p50); |
251 |
|
|
lst.push_back(p51); |
252 |
|
|
lst.push_back(p52); |
253 |
|
|
lst.push_back(p53); |
254 |
francois |
454 |
lst.push_back(p54); |
255 |
francois |
469 |
lst.push_back(p55); |
256 |
francois |
475 |
lst.push_back(p56); |
257 |
francois |
514 |
lst.push_back(p57); |
258 |
|
|
lst.push_back(p58); |
259 |
|
|
lst.push_back(p59); |
260 |
francois |
516 |
lst.push_back(p60); |
261 |
francois |
517 |
lst.push_back(p61); |
262 |
mejrim |
597 |
lst.push_back(p62); |
263 |
|
|
lst.push_back(p63); |
264 |
francois |
603 |
lst.push_back(p64); |
265 |
|
|
lst.push_back(p65); |
266 |
francois |
604 |
lst.push_back(p66); |
267 |
|
|
lst.push_back(p67); |
268 |
|
|
lst.push_back(p68); |
269 |
|
|
lst.push_back(p69); |
270 |
|
|
lst.push_back(p70); |
271 |
francois |
628 |
lst.push_back(p71); |
272 |
|
|
lst.push_back(p72); |
273 |
|
|
lst.push_back(p73); |
274 |
francois |
697 |
lst.push_back(p74); |
275 |
|
|
lst.push_back(p75); |
276 |
|
|
lst.push_back(p76); |
277 |
|
|
lst.push_back(p77); |
278 |
|
|
lst.push_back(p78); |
279 |
|
|
lst.push_back(p79); |
280 |
francois |
698 |
lst.push_back(p80); |
281 |
francois |
702 |
lst.push_back(p81); |
282 |
|
|
lst.push_back(p82); |
283 |
francois |
706 |
lst.push_back(p83); |
284 |
|
|
lst.push_back(p84); |
285 |
francois |
712 |
lst.push_back(p85); |
286 |
|
|
lst.push_back(p86); |
287 |
couturad |
719 |
lst.push_back(p87); |
288 |
|
|
lst.push_back(p88); |
289 |
francois |
757 |
lst.push_back(p89); |
290 |
|
|
lst.push_back(p90); |
291 |
|
|
lst.push_back(p91); |
292 |
|
|
lst.push_back(p92); |
293 |
francois |
763 |
lst.push_back(p93); |
294 |
|
|
lst.push_back(p94); |
295 |
|
|
lst.push_back(p95); |
296 |
|
|
lst.push_back(p96); |
297 |
sattarpa |
784 |
lst.push_back(p97); |
298 |
francois |
432 |
MAGIC_APPLICATION app((char*)"Operation dans l'environnement MAGiC",argc,argv,lst,true,false); |
299 |
|
|
char nomfichier[3000]; |
300 |
|
|
char* p; |
301 |
|
|
if (app.get_action()!=48) |
302 |
|
|
{ |
303 |
|
|
if (app.get_erreur()==true) return 0; |
304 |
francois |
748 |
if ((app.get_action()!=82) && (app.get_action()!=54)&& (app.get_action()!=6)) |
305 |
francois |
702 |
{ |
306 |
|
|
app.recupere_parametre_string(1,nomfichier,(char*)"Fichier entrant manquant"); |
307 |
|
|
p=strrchr(nomfichier,'.'); |
308 |
|
|
} |
309 |
francois |
432 |
} |
310 |
|
|
char chaine[1000];for (int i=0;i<1000;i++) chaine[i]=0; |
311 |
|
|
if (app.get_action()==2) |
312 |
|
|
{ |
313 |
|
|
bool desactivedeforme; |
314 |
|
|
app.recupere_parametre_bool_avec_defaut(4,desactivedeforme,false); |
315 |
francois |
454 |
bool corres; |
316 |
|
|
app.recupere_parametre_bool_avec_defaut(55,corres,false); |
317 |
francois |
432 |
if (app.get_erreur()==true) return 0; |
318 |
|
|
char mess[2000]; |
319 |
|
|
sprintf(mess,"Conversion MAGiC vers GMSH"); |
320 |
|
|
app.affiche(mess); |
321 |
francois |
283 |
MG_FILE gest(nomfichier); |
322 |
|
|
int nb=gest.get_nb_mg_maillage(); |
323 |
|
|
for (int i=0;i<nb;i++) |
324 |
|
|
{ |
325 |
|
|
MG_MAILLAGE* mai=gest.get_mg_maillage(i); |
326 |
|
|
unsigned long id=mai->get_id(); |
327 |
|
|
strncpy(chaine,nomfichier,p-nomfichier); |
328 |
|
|
char chaine2[3000]; |
329 |
|
|
sprintf(chaine2,"%s%lu",chaine,id); |
330 |
|
|
std::string namefic=chaine2; |
331 |
|
|
MG_EXPORT exp; |
332 |
francois |
339 |
sprintf(mess," Maillage geometrique : creation de %s.msh",namefic.c_str()); |
333 |
francois |
432 |
app.affiche(mess); |
334 |
francois |
454 |
if (corres==false) exp.gmsh(mai,namefic); else exp.gmsh_avec_correspondance(mai,namefic); |
335 |
|
|
} |
336 |
francois |
283 |
nb=gest.get_nb_fem_maillage(); |
337 |
|
|
for (int i=0;i<nb;i++) |
338 |
|
|
{ |
339 |
|
|
FEM_MAILLAGE* mai=gest.get_fem_maillage(i); |
340 |
francois |
432 |
if (desactivedeforme) mai->desactive_deforme(); |
341 |
gervaislavoie |
304 |
unsigned long id=mai->get_id(); |
342 |
francois |
283 |
strncpy(chaine,nomfichier,p-nomfichier); |
343 |
|
|
char chaine2[3000]; |
344 |
|
|
sprintf(chaine2,"%s%lu",chaine,id); |
345 |
|
|
std::string namefic=chaine2; |
346 |
|
|
MG_EXPORT exp; |
347 |
francois |
331 |
sprintf(mess," Maillage EF : Creation de %s.msh",namefic.c_str()); |
348 |
francois |
432 |
app.affiche(mess); |
349 |
francois |
454 |
if (corres==false) exp.gmsh(mai,namefic); else exp.gmsh_avec_correspondance(mai,namefic); |
350 |
francois |
283 |
} |
351 |
|
|
} |
352 |
francois |
432 |
if (app.get_action()==4) |
353 |
francois |
331 |
{ |
354 |
francois |
432 |
char fichierout[2000]; |
355 |
|
|
app.recupere_parametre_string(5,fichierout,(char*)"Fichier sortant manquant"); |
356 |
|
|
if (app.get_erreur()==true) return 0; |
357 |
|
|
char mess[2000]; |
358 |
|
|
sprintf(mess,"Copie de fichier MAGiC"); |
359 |
|
|
app.affiche(mess); |
360 |
francois |
331 |
MG_FILE gest(nomfichier); |
361 |
|
|
gest.enregistrer(fichierout); |
362 |
francois |
432 |
} |
363 |
|
|
if (app.get_action()==6) |
364 |
francois |
283 |
{ |
365 |
francois |
432 |
char mess[500]; |
366 |
|
|
char coderesu[10]; |
367 |
francois |
706 |
char nomparam[500]; |
368 |
francois |
748 |
bool creeparam; |
369 |
francois |
706 |
app.recupere_parametre_string_avec_defaut(7,coderesu,(char*)"11111111"); |
370 |
francois |
748 |
app.recupere_parametre_bool_avec_defaut(85,creeparam,false); |
371 |
|
|
if (!creeparam) app.recupere_parametre_string(84,nomparam,(char*)"Fichier parametre manquant"); |
372 |
|
|
if (!creeparam) app.recupere_parametre_string(1,nomfichier,(char*)"Fichier entrant manquant"); |
373 |
francois |
706 |
app.recupere_parametre_string(84,nomparam,(char*)"Fichier parametre manquant"); |
374 |
francois |
748 |
if (app.get_erreur()==true) return 0; |
375 |
|
|
if (creeparam) |
376 |
|
|
{ |
377 |
|
|
char mess[500]; |
378 |
|
|
sprintf(mess," Calcul ASTER\n\nCréation d'un fichier parametre\n"); |
379 |
|
|
app.affiche(mess); |
380 |
|
|
MG_EXPORT exp; |
381 |
|
|
exp.ecrire_params_aster(nomparam); |
382 |
|
|
} |
383 |
|
|
else |
384 |
|
|
{ |
385 |
francois |
432 |
sprintf(mess,"Conversion MAGiC vers code ASTER"); |
386 |
|
|
app.affiche(mess); |
387 |
francois |
283 |
MG_FILE gest(nomfichier); |
388 |
|
|
int nb=gest.get_nb_fem_maillage(); |
389 |
|
|
for (int i=0;i<nb;i++) |
390 |
|
|
{ |
391 |
|
|
FEM_MAILLAGE* mai=gest.get_fem_maillage(i); |
392 |
francois |
748 |
MG_GEOMETRIE* geo=mai->get_mg_geometrie(); |
393 |
francois |
283 |
unsigned long id=mai->get_id(); |
394 |
francois |
748 |
p=strrchr(nomfichier,'.'); |
395 |
|
|
strncpy(chaine,nomfichier,p-nomfichier); |
396 |
francois |
283 |
char chaine2[3000]; |
397 |
|
|
sprintf(chaine2,"%s%lu",chaine,id); |
398 |
|
|
std::string namefic=chaine2; |
399 |
|
|
MG_EXPORT exp; |
400 |
francois |
706 |
exp.lire_params_aster(nomparam); |
401 |
francois |
748 |
exp.aster(geo,mai,namefic,MAGIC::CALCUL_ASTER::ELASTIQUE,coderesu); |
402 |
francois |
283 |
} |
403 |
francois |
748 |
|
404 |
|
|
} |
405 |
francois |
283 |
} |
406 |
francois |
432 |
if (app.get_action()==8) |
407 |
francois |
283 |
{ |
408 |
francois |
432 |
if (app.get_erreur()==true) return 0; |
409 |
|
|
char mess[500]; |
410 |
francois |
505 |
sprintf(mess," Conversion carte de taille ancienne version vers GMSH"); |
411 |
francois |
432 |
app.affiche(mess); |
412 |
|
|
FCT_GENERATEUR_3D<4> carte; |
413 |
francois |
283 |
carte.lire(nomfichier); |
414 |
|
|
strncpy(chaine,nomfichier,p-nomfichier); |
415 |
|
|
std::string namefic=chaine; |
416 |
francois |
492 |
FCT_EXPORT exp; |
417 |
francois |
283 |
exp.gmsh(&carte,namefic); |
418 |
francois |
432 |
} |
419 |
|
|
#ifdef BREP_STEP |
420 |
|
|
if (app.get_action()==9) |
421 |
francois |
283 |
{ |
422 |
francois |
432 |
double unite; |
423 |
|
|
app.recupere_parametre_double_avec_defaut(10,unite,1.); |
424 |
|
|
if (app.get_erreur()==true) return 0; |
425 |
|
|
char mess[500]; |
426 |
|
|
sprintf(mess," Conversion STEP vers MAGiC"); |
427 |
|
|
app.affiche(mess); |
428 |
francois |
283 |
STEP_IMPORT stepimport; |
429 |
|
|
MG_GESTIONNAIRE gest; |
430 |
|
|
stepimport.importer(gest,nomfichier) ; |
431 |
|
|
strncpy(chaine,nomfichier,p-nomfichier); |
432 |
|
|
std::string namefic=chaine; |
433 |
|
|
namefic=namefic + ".magic"; |
434 |
|
|
int nb=gest.get_nb_mg_geometrie(); |
435 |
|
|
for (int i=0;i<nb;i++) |
436 |
|
|
gest.get_mg_geometrie(i)->change_valeur_unite(unite); |
437 |
|
|
gest.enregistrer(namefic.c_str()); |
438 |
|
|
} |
439 |
francois |
432 |
#endif |
440 |
|
|
#ifdef BREP_OCC |
441 |
|
|
if (app.get_action()==11) |
442 |
francois |
283 |
{ |
443 |
francois |
652 |
double eps,eps2; |
444 |
francois |
432 |
bool importstl,importtriangulation; |
445 |
|
|
app.recupere_parametre_double_avec_defaut(13,eps,0.000001); |
446 |
|
|
app.recupere_parametre_double_avec_defaut(14,eps2,1.); |
447 |
|
|
app.recupere_parametre_bool_avec_defaut(15,importstl,false); |
448 |
|
|
app.recupere_parametre_bool_avec_defaut(16,importtriangulation,false); |
449 |
|
|
if (app.get_erreur()==true) return 0; |
450 |
|
|
int importtri=0; |
451 |
|
|
if (importstl) importtri=1; |
452 |
|
|
if (importtriangulation) importtri=2; |
453 |
|
|
char mess[500]; |
454 |
|
|
sprintf(mess," Conversion STEP via OpenCascade vers MAGiC avec epsilon=%lf",eps); |
455 |
|
|
app.affiche(mess); |
456 |
francois |
283 |
MG_GESTIONNAIRE gest; |
457 |
francois |
432 |
OCC_IMPORT occimport; |
458 |
francois |
652 |
MG_GEOMETRIE* mggeo=occimport.importer(gest,nomfichier,FICHIERSTEP,eps) ; |
459 |
francois |
432 |
if (importtri>0) occimport.importer(gest,mggeo,eps2,importtri); |
460 |
francois |
283 |
strncpy(chaine,nomfichier,p-nomfichier); |
461 |
|
|
std::string namefic=chaine; |
462 |
|
|
namefic=namefic + ".magic"; |
463 |
|
|
gest.enregistrer(namefic.c_str()); |
464 |
|
|
} |
465 |
francois |
432 |
#endif |
466 |
|
|
#ifdef BREP_SAT |
467 |
|
|
if (app.get_action()==12) |
468 |
francois |
283 |
{ |
469 |
francois |
432 |
double unite; |
470 |
|
|
app.recupere_parametre_double_avec_defaut(10,unite,1.); |
471 |
|
|
if (app.get_erreur()==true) return 0; |
472 |
|
|
char mess[500]; |
473 |
|
|
sprintf(mess," Conversion SAT vers MAGiC"); |
474 |
|
|
app.affiche(mess); |
475 |
francois |
283 |
MG_GESTIONNAIRE gest; |
476 |
francois |
432 |
ACIS_IMPORT acisimport; |
477 |
|
|
acisimport.importer(gest,nomfichier) ; |
478 |
francois |
283 |
strncpy(chaine,nomfichier,p-nomfichier); |
479 |
|
|
std::string namefic=chaine; |
480 |
|
|
namefic=namefic + ".magic"; |
481 |
|
|
int nb=gest.get_nb_mg_geometrie(); |
482 |
|
|
for (int i=0;i<nb;i++) |
483 |
|
|
gest.get_mg_geometrie(i)->change_valeur_unite(unite); |
484 |
|
|
gest.enregistrer(namefic.c_str()); |
485 |
|
|
} |
486 |
francois |
432 |
#endif |
487 |
|
|
#ifdef BREP_OCC |
488 |
|
|
if (app.get_action()==17) |
489 |
francois |
283 |
{ |
490 |
francois |
652 |
double eps,eps2; |
491 |
francois |
432 |
bool importstl,importtriangulation; |
492 |
|
|
app.recupere_parametre_double_avec_defaut(13,eps,0.000001); |
493 |
|
|
app.recupere_parametre_double_avec_defaut(14,eps2,1.); |
494 |
|
|
app.recupere_parametre_bool_avec_defaut(15,importstl,false); |
495 |
|
|
app.recupere_parametre_bool_avec_defaut(16,importtriangulation,false); |
496 |
|
|
if (app.get_erreur()==true) return 0; |
497 |
|
|
int importtri=0; |
498 |
|
|
if (importstl) importtri=1; |
499 |
|
|
if (importtriangulation) importtri=2; |
500 |
|
|
char mess[500]; |
501 |
|
|
sprintf(mess," Conversion OpenCascade vers MAGiC"); |
502 |
|
|
app.affiche(mess); |
503 |
francois |
283 |
MG_GESTIONNAIRE gest; |
504 |
|
|
OCC_IMPORT occimport; |
505 |
francois |
652 |
MG_GEOMETRIE* mggeo=occimport.importer(gest,nomfichier,FICHIEROCC,eps) ; |
506 |
francois |
283 |
if (importtri>0) occimport.importer(gest,mggeo,eps2,importtri); |
507 |
|
|
strncpy(chaine,nomfichier,p-nomfichier); |
508 |
|
|
std::string namefic=chaine; |
509 |
|
|
namefic=namefic + ".magic"; |
510 |
|
|
gest.enregistrer(namefic.c_str()); |
511 |
francois |
432 |
} |
512 |
francois |
283 |
#endif |
513 |
francois |
432 |
if (app.get_action()==18) |
514 |
francois |
283 |
{ |
515 |
francois |
432 |
int degre,nummai; |
516 |
francois |
656 |
bool analyse; |
517 |
sattarpa |
784 |
bool optno; |
518 |
francois |
432 |
app.recupere_parametre_int_avec_defaut(19,nummai,0); |
519 |
|
|
app.recupere_parametre_int(20,degre,(char*)"Degré du maillage manquant"); |
520 |
francois |
656 |
app.recupere_parametre_bool_avec_defaut(75,analyse,false); |
521 |
sattarpa |
784 |
app.recupere_parametre_bool_avec_defaut(98,optno,false); |
522 |
francois |
432 |
if (app.get_erreur()==true) return 0; |
523 |
|
|
char mess[500]; |
524 |
francois |
283 |
sprintf(mess," Creation d'un maillage FEM"); |
525 |
francois |
432 |
app.affiche(mess); |
526 |
francois |
283 |
MG_FILE gest(nomfichier); |
527 |
francois |
432 |
MG_MAILLAGE* mai; |
528 |
|
|
if (nummai==0) mai=gest.get_mg_maillage(nummai); else mai=gest.get_mg_maillageid(nummai); |
529 |
francois |
283 |
FEM_MAILLAGE* fem=new FEM_MAILLAGE(mai->get_mg_geometrie(),mai,degre); |
530 |
|
|
gest.ajouter_fem_maillage(fem); |
531 |
sattarpa |
784 |
if (!optno) fem->construire(0); else fem->construire(2); |
532 |
francois |
283 |
gest.enregistrer(nomfichier); |
533 |
francois |
656 |
if (analyse==true) |
534 |
|
|
if (degre==2) |
535 |
francois |
612 |
{ |
536 |
|
|
//char message [5000]; |
537 |
|
|
FEM_MAILLAGE_QUADRATIQUE_OUTILS ou ; |
538 |
|
|
double moy=ou.get_distortion_moy(fem); |
539 |
|
|
double min=ou.get_distortion_min (fem); |
540 |
|
|
int nb=ou.get_nombre_elements_invalides(fem); |
541 |
|
|
sprintf(mess," maillage quadratique :"); |
542 |
|
|
app.affiche(mess); |
543 |
|
|
sprintf(mess," "); |
544 |
|
|
app.affiche(mess); |
545 |
|
|
sprintf(mess," distorsion moy %f ",moy); |
546 |
|
|
app.affiche(mess); |
547 |
|
|
sprintf(mess," distorsion min %f ",min); |
548 |
|
|
app.affiche(mess); |
549 |
|
|
sprintf(mess," nombre elements invalides %d ",nb); |
550 |
|
|
app.affiche(mess); |
551 |
|
|
} |
552 |
|
|
|
553 |
|
|
|
554 |
francois |
432 |
} |
555 |
|
|
if (app.get_action()==21) |
556 |
francois |
283 |
{ |
557 |
francois |
432 |
int nummai; |
558 |
|
|
char fichieraster[500]; |
559 |
francois |
757 |
int base; |
560 |
francois |
432 |
app.recupere_parametre_int_avec_defaut(19,nummai,0); |
561 |
francois |
535 |
app.recupere_parametre_string(22,fichieraster,(char*)"Fichier aster manquant"); |
562 |
francois |
757 |
app.recupere_parametre_int_avec_defaut(90,base,10); |
563 |
francois |
432 |
if (app.get_erreur()==true) return 0; |
564 |
|
|
char mess[500]; |
565 |
francois |
283 |
sprintf(mess," Importation des résultats ASTER vers MAGIC"); |
566 |
francois |
432 |
app.affiche(mess); |
567 |
francois |
283 |
MG_FILE gest(nomfichier); |
568 |
francois |
432 |
FEM_MAILLAGE* mai; |
569 |
|
|
if (nummai==0) mai=gest.get_fem_maillage(nummai); else mai=gest.get_fem_maillageid(nummai); |
570 |
francois |
283 |
MG_IMPORT imp; |
571 |
francois |
757 |
std::string res=imp.aster(base,mai,fichieraster,nomfichier); |
572 |
francois |
691 |
app.affiche((char*)("\033[1;31m"+res+"\033[1;32m").c_str()); |
573 |
francois |
283 |
gest.enregistrer(nomfichier); |
574 |
francois |
432 |
} |
575 |
|
|
|
576 |
|
|
if (app.get_action()==23) |
577 |
francois |
283 |
{ |
578 |
francois |
706 |
|
579 |
francois |
283 |
} |
580 |
francois |
432 |
if (app.get_action()==24) |
581 |
francois |
283 |
{ |
582 |
francois |
432 |
int nummai; |
583 |
|
|
char fichieroptis[500]; |
584 |
|
|
char fichierflottant[500]; |
585 |
|
|
double niveau,seuil; |
586 |
|
|
app.recupere_parametre_int_avec_defaut(19,nummai,0); |
587 |
|
|
app.recupere_parametre_string(25,fichieroptis,(char*)"Fichier OPTIS manquant"); |
588 |
|
|
app.recupere_parametre_string_avec_defaut(26,fichieroptis,(char*)""); |
589 |
|
|
app.recupere_parametre_double(27,seuil,(char*)"Seuil manquant"); |
590 |
|
|
app.recupere_parametre_double(28,niveau,(char*)"Niveau manquant"); |
591 |
|
|
if (app.get_erreur()==true) return 0; |
592 |
|
|
char mess[500]; |
593 |
|
|
sprintf(mess," Importation des résultats d'optimisation vers MAGIC"); |
594 |
|
|
app.affiche(mess); |
595 |
francois |
283 |
MG_FILE gest(nomfichier); |
596 |
francois |
432 |
FEM_MAILLAGE* mai; |
597 |
|
|
if (nummai==0) mai=gest.get_fem_maillage(nummai); else mai=gest.get_fem_maillageid(nummai); |
598 |
francois |
283 |
MG_IMPORT imp; |
599 |
francois |
432 |
int flottant=0; |
600 |
|
|
if (strlen(fichierflottant)>0) flottant=1; |
601 |
francois |
283 |
imp.optis(mai,fichieroptis,fichierflottant,seuil,niveau,flottant); |
602 |
|
|
gest.enregistrer(nomfichier); |
603 |
francois |
432 |
} |
604 |
|
|
|
605 |
|
|
if (app.get_action()==29) |
606 |
francois |
283 |
{ |
607 |
francois |
432 |
int numgeo,numgt,numentite; |
608 |
|
|
bool expand; |
609 |
|
|
app.recupere_parametre_int_avec_defaut(31,numgeo,0); |
610 |
|
|
app.recupere_parametre_int_avec_defaut(32,numgt,0); |
611 |
|
|
app.recupere_parametre_int(33,numentite,(char*)"Numéro d'entité manquant"); |
612 |
|
|
app.recupere_parametre_bool_avec_defaut(34,expand,false); |
613 |
|
|
if (app.get_erreur()==true) return 0; |
614 |
|
|
char mess[500]; |
615 |
|
|
sprintf(mess," Selection de groupe topologique"); |
616 |
|
|
app.affiche(mess); |
617 |
francois |
283 |
MG_FILE gest(nomfichier); |
618 |
francois |
432 |
MG_GEOMETRIE* mggeo; |
619 |
|
|
if (numgeo==0) mggeo=gest.get_mg_geometrie(numgeo); else mggeo=gest.get_mg_geometrieid(numgeo); |
620 |
francois |
283 |
MG_GROUPE_TOPOLOGIQUE* mggt; |
621 |
|
|
if (numgt==0) |
622 |
|
|
{ |
623 |
|
|
mggt=new MG_GROUPE_TOPOLOGIQUE; |
624 |
|
|
mggeo->ajouter_mg_groupe_topologique(mggt); |
625 |
|
|
} |
626 |
|
|
else mggt=mggeo->get_mg_groupe_topologiqueid(numgt); |
627 |
|
|
MG_ELEMENT_TOPOLOGIQUE* ele; |
628 |
|
|
ele=mggeo->get_mg_sommetid(numentite); |
629 |
|
|
if (ele==NULL) ele=mggeo->get_mg_areteid(numentite); |
630 |
|
|
if (ele==NULL) ele=mggeo->get_mg_faceid(numentite); |
631 |
|
|
if (ele==NULL) ele=mggeo->get_mg_volumeid(numentite); |
632 |
|
|
if (ele!=NULL) |
633 |
|
|
{ |
634 |
|
|
mggt->ajouter(ele); |
635 |
|
|
if (expand) |
636 |
|
|
{ |
637 |
|
|
TPL_MAP_ENTITE<MG_ELEMENT_TOPOLOGIQUE*> lst; |
638 |
|
|
ele->get_topologie_sousjacente(&lst); |
639 |
|
|
TPL_MAP_ENTITE<MG_ELEMENT_TOPOLOGIQUE*>::ITERATEUR it; |
640 |
|
|
for (MG_ELEMENT_TOPOLOGIQUE *ele2=lst.get_premier(it);ele2!=NULL;ele2=lst.get_suivant(it)) |
641 |
|
|
mggt->ajouter(ele2); |
642 |
|
|
} |
643 |
|
|
} |
644 |
|
|
gest.enregistrer(nomfichier); |
645 |
|
|
} |
646 |
francois |
432 |
if (app.get_action()==30) |
647 |
francois |
283 |
{ |
648 |
francois |
432 |
int numgeo,numgt,numentite; |
649 |
|
|
bool expand; |
650 |
|
|
app.recupere_parametre_int_avec_defaut(31,numgeo,0); |
651 |
|
|
app.recupere_parametre_int_avec_defaut(32,numgt,0); |
652 |
|
|
app.recupere_parametre_int(33,numentite,(char*)"Numéro d'entité manquant"); |
653 |
|
|
app.recupere_parametre_bool_avec_defaut(34,expand,false); |
654 |
|
|
if (app.get_erreur()==true) return 0; |
655 |
|
|
char mess[500]; |
656 |
|
|
sprintf(mess," Deselection de groupe topologique"); |
657 |
|
|
app.affiche(mess); |
658 |
francois |
283 |
MG_FILE gest(nomfichier); |
659 |
|
|
MG_GEOMETRIE* mggeo=gest.get_mg_geometrieid(numgeo); |
660 |
|
|
MG_GROUPE_TOPOLOGIQUE* mggt=mggeo->get_mg_groupe_topologiqueid(numgt); |
661 |
|
|
MG_ELEMENT_TOPOLOGIQUE* ele; |
662 |
|
|
ele=mggeo->get_mg_sommetid(numentite); |
663 |
|
|
if (ele==NULL) ele=mggeo->get_mg_areteid(numentite); |
664 |
|
|
if (ele==NULL) ele=mggeo->get_mg_faceid(numentite); |
665 |
|
|
if (ele==NULL) ele=mggeo->get_mg_volumeid(numentite); |
666 |
|
|
if (ele!=NULL) |
667 |
|
|
{ |
668 |
|
|
mggt->supprimer(ele); |
669 |
|
|
if (expand) |
670 |
|
|
{ |
671 |
|
|
TPL_MAP_ENTITE<MG_ELEMENT_TOPOLOGIQUE*> lst; |
672 |
|
|
ele->get_topologie_sousjacente(&lst); |
673 |
|
|
TPL_MAP_ENTITE<MG_ELEMENT_TOPOLOGIQUE*>::ITERATEUR it; |
674 |
|
|
for (MG_ELEMENT_TOPOLOGIQUE *ele2=lst.get_premier(it);ele2!=NULL;ele2=lst.get_suivant(it)) |
675 |
|
|
mggt->supprimer(ele2); |
676 |
|
|
} |
677 |
|
|
} |
678 |
|
|
gest.enregistrer(nomfichier); |
679 |
francois |
432 |
} |
680 |
|
|
|
681 |
|
|
if (app.get_action()==35) |
682 |
francois |
283 |
{ |
683 |
francois |
432 |
int nummai; |
684 |
|
|
double angle; |
685 |
|
|
char fichierlog[500]; |
686 |
francois |
477 |
strcpy(fichierlog,""); |
687 |
francois |
432 |
app.recupere_parametre_int_avec_defaut(19,nummai,-1); |
688 |
|
|
app.recupere_parametre_double_avec_defaut(36,angle,0.03); |
689 |
|
|
app.recupere_parametre_string_avec_defaut(37,fichierlog,(char*)fichierlog); |
690 |
|
|
if (app.get_erreur()==true) return 0; |
691 |
|
|
char mess[500]; |
692 |
|
|
sprintf(mess," Contenu d'un fichier MAGIC"); |
693 |
|
|
app.affiche(mess); |
694 |
francois |
283 |
MG_FILE gest(nomfichier); |
695 |
francois |
425 |
if (nummai!=-1) |
696 |
|
|
{ |
697 |
|
|
MG_MAILLAGE* mai=gest.get_mg_maillageid(nummai); |
698 |
|
|
MAILLEUR_ANALYSE m3d(mai); |
699 |
francois |
432 |
m3d.active_affichage(app.affiche); |
700 |
francois |
426 |
m3d.change_eps_angle_retourne(angle); |
701 |
francois |
432 |
if (strlen(fichierlog)==0) |
702 |
francois |
425 |
m3d.analyse(); |
703 |
|
|
else |
704 |
|
|
m3d.analyse(fichierlog); |
705 |
|
|
} |
706 |
|
|
else |
707 |
|
|
{ |
708 |
|
|
char message [5000]; |
709 |
francois |
691 |
int nbarbre=gest.get_nb_mg_arbre(); |
710 |
|
|
sprintf(message," \033[1;32m%d\033[1;33m arbres :",nbarbre); |
711 |
|
|
for (int i=0;i<nbarbre;i++) |
712 |
|
|
{ |
713 |
|
|
MG_ARBRE* arb=gest.get_mg_arbre(i); |
714 |
|
|
sprintf(message,"%s \033[1;31m%lu\033[1;33m ",message,arb->get_id()); |
715 |
|
|
} |
716 |
|
|
app.affiche(message); |
717 |
|
|
for (int i=0;i<nbarbre;i++) |
718 |
|
|
{ |
719 |
|
|
MG_ARBRE* arb=gest.get_mg_arbre(i); |
720 |
|
|
sprintf(message," arbre \033[1;31m%lu\033[1;33m",arb->get_id()); |
721 |
|
|
app.affiche(message); |
722 |
francois |
742 |
int nbass=arb->get_nb_mg_assemblage(); |
723 |
|
|
sprintf(message," \033[1;32m%d\033[1;33m assemblages",nbass); |
724 |
|
|
app.affiche(message); |
725 |
francois |
691 |
int nbprim=arb->get_nb_mg_primitive(); |
726 |
|
|
sprintf(message," \033[1;32m%d\033[1;33m primitives",nbprim); |
727 |
|
|
//for (int i=0;i<nbprim;i++) sprintf(message,"%s \033[1;31m%lu\033[1;33m",message,arb->get_mg_primitive(i)->get_id()); |
728 |
|
|
app.affiche(message); |
729 |
|
|
int nbope=arb->get_nb_mg_operateur_boolean(); |
730 |
|
|
sprintf(message," \033[1;32m%d\033[1;33m operateurs booleans",nbope); |
731 |
|
|
app.affiche(message); |
732 |
|
|
} |
733 |
|
|
int nbgeo=gest.get_nb_mg_geometrie(); |
734 |
|
|
sprintf(message," \033[1;32m%d\033[1;33m geometries :",nbgeo); |
735 |
francois |
283 |
for (int i=0;i<nbgeo;i++) |
736 |
|
|
{ |
737 |
|
|
MG_GEOMETRIE* geo=gest.get_mg_geometrie(i); |
738 |
francois |
691 |
sprintf(message,"%s \033[1;31m%lu\033[1;33m ",message,geo->get_id()); |
739 |
francois |
283 |
} |
740 |
francois |
432 |
app.affiche(message); |
741 |
francois |
283 |
for (int i=0;i<nbgeo;i++) |
742 |
|
|
{ |
743 |
|
|
MG_GEOMETRIE* geo=gest.get_mg_geometrie(i); |
744 |
francois |
691 |
sprintf(message," geometrie \033[1;31m%lu\033[1;33m",geo->get_id()); |
745 |
francois |
432 |
app.affiche(message); |
746 |
francois |
283 |
int nbmg=geo->get_nb_mg_groupe_topologique(); |
747 |
francois |
691 |
sprintf(message," \033[1;32m%d\033[1;33m groupe topologique",nbmg); |
748 |
francois |
283 |
for (int j=0;j<nbmg;j++) |
749 |
|
|
{ |
750 |
|
|
MG_GROUPE_TOPOLOGIQUE* mggp=geo->get_mg_groupe_topologique(j); |
751 |
francois |
691 |
sprintf(message,"%s \033[1;31m%lu\033[1;33m ",message,mggp->get_id()); |
752 |
francois |
283 |
} |
753 |
francois |
432 |
app.affiche(message); |
754 |
francois |
299 |
int nbvolume=geo->get_nb_mg_volume(); |
755 |
francois |
691 |
if (nbvolume==0) sprintf(message," \033[1;32m%d\033[1;33m volumes",geo->get_nb_mg_volume()); |
756 |
|
|
else sprintf(message," \033[1;32m%d\033[1;33m volumes : ",geo->get_nb_mg_volume()); |
757 |
|
|
for (int i=0;i<nbvolume;i++) sprintf(message,"%s \033[1;31m%lu\033[1;33m",message,geo->get_mg_volume(i)->get_id()); |
758 |
francois |
432 |
app.affiche(message); |
759 |
francois |
299 |
int nbcoque=geo->get_nb_mg_coque(); |
760 |
francois |
691 |
if (nbcoque==0) sprintf(message," \033[1;32m%d\033[1;33m coques",geo->get_nb_mg_coque()); |
761 |
|
|
else sprintf(message," \033[1;32m%d\033[1;33m coques : ",geo->get_nb_mg_coque()); |
762 |
|
|
for (int i=0;i<nbcoque;i++) sprintf(message,"%s \033[1;31m%lu\033[1;33m",message,geo->get_mg_coque(i)->get_id()); |
763 |
francois |
432 |
app.affiche(message); |
764 |
francois |
299 |
int nbpoutre=geo->get_nb_mg_poutre(); |
765 |
francois |
691 |
if (nbpoutre==0) sprintf(message," \033[1;32m%d\033[1;33m poutres",geo->get_nb_mg_poutre()); |
766 |
|
|
else sprintf(message," \033[1;32m%d\033[1;33m poutres : ",geo->get_nb_mg_poutre()); |
767 |
|
|
for (int i=0;i<nbpoutre;i++) sprintf(message,"%s \033[1;31m%lu\033[1;33m",message,geo->get_mg_poutre(i)->get_id()); |
768 |
francois |
432 |
app.affiche(message); |
769 |
francois |
691 |
sprintf(message," \033[1;32m%d\033[1;33m coquilles",geo->get_nb_mg_coquille()); |
770 |
francois |
432 |
app.affiche(message); |
771 |
francois |
691 |
sprintf(message," \033[1;32m%d\033[1;33m faces",geo->get_nb_mg_face()); |
772 |
francois |
432 |
app.affiche(message); |
773 |
francois |
691 |
sprintf(message," \033[1;32m%d\033[1;33m aretes",geo->get_nb_mg_arete()); |
774 |
francois |
432 |
app.affiche(message); |
775 |
francois |
691 |
sprintf(message," \033[1;32m%d\033[1;33m sommets",geo->get_nb_mg_sommet()); |
776 |
francois |
432 |
app.affiche(message); |
777 |
francois |
716 |
int nbgef=geo->get_nb_mg_geom_fonction(); |
778 |
|
|
if (nbgef==0) sprintf(message," \033[1;32m%d\033[1;33m fonctions geometriques",nbgef); |
779 |
|
|
else sprintf(message," \033[1;32m%d\033[1;33m fonctions geometriques : ",nbgef); |
780 |
|
|
for (int i=0;i<nbgef;i++) sprintf(message,"%s \033[1;31m%lu\033[1;33m",message,geo->get_mg_geom_fonction(i)->get_id()); |
781 |
|
|
app.affiche(message); |
782 |
francois |
283 |
|
783 |
|
|
} |
784 |
|
|
int nbmai=gest.get_nb_mg_maillage(); |
785 |
francois |
691 |
sprintf(message," \033[1;32m%d\033[1;33m maillage geometrique :",nbmai); |
786 |
francois |
432 |
app.affiche(message); |
787 |
francois |
283 |
for (int i=0;i<nbmai;i++) |
788 |
|
|
{ |
789 |
|
|
MG_MAILLAGE* mai=gest.get_mg_maillage(i); |
790 |
francois |
691 |
sprintf(message," maillage geometrique \033[1;31m%lu\033[1;33m ",mai->get_id()); |
791 |
francois |
432 |
app.affiche(message); |
792 |
francois |
691 |
sprintf(message," \033[1;32m%d\033[1;33m noeuds",mai->get_nb_mg_noeud()); |
793 |
francois |
432 |
app.affiche(message); |
794 |
francois |
691 |
sprintf(message," \033[1;32m%d\033[1;33m segments",mai->get_nb_mg_segment()); |
795 |
francois |
432 |
app.affiche(message); |
796 |
francois |
691 |
sprintf(message," \033[1;32m%d\033[1;33m triangles",mai->get_nb_mg_triangle()); |
797 |
francois |
432 |
app.affiche(message); |
798 |
francois |
691 |
sprintf(message," \033[1;32m%d\033[1;33m quadrangles",mai->get_nb_mg_quadrangle()); |
799 |
francois |
674 |
app.affiche(message); |
800 |
francois |
691 |
sprintf(message," \033[1;32m%d\033[1;33m tetras",mai->get_nb_mg_tetra()); |
801 |
francois |
432 |
app.affiche(message); |
802 |
francois |
691 |
sprintf(message," \033[1;32m%d\033[1;33m hexas",mai->get_nb_mg_hexa()); |
803 |
francois |
674 |
app.affiche(message); |
804 |
francois |
283 |
} |
805 |
|
|
int nbmaif=gest.get_nb_fem_maillage(); |
806 |
francois |
691 |
sprintf(message," \033[1;32m%d\033[1;33m maillage FEM :",nbmaif); |
807 |
francois |
432 |
app.affiche(message); |
808 |
francois |
283 |
for (int i=0;i<nbmaif;i++) |
809 |
|
|
{ |
810 |
|
|
FEM_MAILLAGE* maif=gest.get_fem_maillage(i); |
811 |
francois |
748 |
sprintf(message," maillage FEM \033[1;31m%lu\033[1;33m ",maif->get_id()); |
812 |
francois |
432 |
app.affiche(message); |
813 |
francois |
691 |
sprintf(message," \033[1;32m%d\033[1;33m noeuds",maif->get_nb_fem_noeud()); |
814 |
francois |
432 |
app.affiche(message); |
815 |
francois |
691 |
sprintf(message," \033[1;32m%d\033[1;33m elements 1D",maif->get_nb_fem_element1()); |
816 |
francois |
432 |
app.affiche(message); |
817 |
francois |
691 |
sprintf(message," \033[1;32m%d\033[1;33m elements 2D",maif->get_nb_fem_element2()); |
818 |
francois |
432 |
app.affiche(message); |
819 |
francois |
691 |
sprintf(message," \033[1;32m%d\033[1;33m elements 3D",maif->get_nb_fem_element3()); |
820 |
francois |
432 |
app.affiche(message); |
821 |
francois |
325 |
double rx,ry,rz; |
822 |
|
|
maif->calcul_somme_reaction(rx,ry,rz); |
823 |
francois |
691 |
sprintf(message," Reactions : \n Rx=\033[1;31m%lf\033[1;33m\n Ry=\033[1;31m%lf\033[1;33m\n Rz=\033[1;31m%lf\033[1;33m",rx,ry,rz); |
824 |
francois |
432 |
app.affiche(message); |
825 |
francois |
325 |
|
826 |
francois |
283 |
} |
827 |
|
|
int nbsol=gest.get_nb_mg_solution(); |
828 |
francois |
691 |
sprintf(message," \033[1;32m%d\033[1;33m solution maillage geometrique :",nbsol); |
829 |
|
|
app.affiche(message); |
830 |
|
|
message[0]=0; |
831 |
|
|
for (int i=0;i<nbsol;i++) |
832 |
francois |
283 |
{ |
833 |
|
|
MG_SOLUTION* sol=gest.get_mg_solution(i); |
834 |
francois |
628 |
char legende[500]; |
835 |
francois |
691 |
legende[0]=0; |
836 |
|
|
message[0]=0; |
837 |
francois |
628 |
for (int j=0;j<sol->get_nb_champ();j++) |
838 |
|
|
sprintf(legende,"%s%s_%s ",legende,(char*)sol->get_nom().c_str(),(char*)sol->get_legende(j).c_str()); |
839 |
francois |
691 |
sprintf(message," \033[1;31m%lu(%s)\033[1;33m ",sol->get_id(),legende); |
840 |
francois |
628 |
app.affiche(message); |
841 |
francois |
283 |
} |
842 |
|
|
int nbsolf=gest.get_nb_fem_solution(); |
843 |
francois |
691 |
sprintf(message," \033[1;32m%d\033[1;33m solution maillage FEM :",nbsolf); |
844 |
francois |
628 |
app.affiche(message); |
845 |
francois |
660 |
message[0]=0; |
846 |
|
|
for (int i=0;i<nbsolf;i++) |
847 |
francois |
283 |
{ |
848 |
francois |
628 |
FEM_SOLUTION* sol=gest.get_fem_solution(i); |
849 |
|
|
char legende[500]; |
850 |
francois |
670 |
legende[0]=0; |
851 |
francois |
660 |
message[0]=0; |
852 |
francois |
628 |
for (int j=0;j<sol->get_nb_champ();j++) |
853 |
|
|
sprintf(legende,"%s%s_%s ",legende,(char*)sol->get_nom().c_str(),(char*)sol->get_legende(j).c_str()); |
854 |
francois |
691 |
sprintf(message," \033[1;31m%lu(%s)\033[1;33m ",sol->get_id(),legende); |
855 |
francois |
628 |
app.affiche(message); |
856 |
|
|
} |
857 |
francois |
283 |
} |
858 |
|
|
} |
859 |
francois |
432 |
if (app.get_action()==38) |
860 |
francois |
283 |
{ |
861 |
francois |
432 |
int nummai; |
862 |
|
|
int numsol1,numsol2,numsol3; |
863 |
|
|
int numchamp1,numchamp2,numchamp3; |
864 |
francois |
516 |
double coef; |
865 |
francois |
432 |
app.recupere_parametre_int_avec_defaut(19,nummai,0); |
866 |
|
|
app.recupere_parametre_int(40,numsol1,(char*)"Numéro solution 1 manquant"); |
867 |
|
|
app.recupere_parametre_int(41,numsol2,(char*)"Numéro solution 2 manquant"); |
868 |
|
|
app.recupere_parametre_int(42,numsol3,(char*)"Numéro solution 3 manquant"); |
869 |
|
|
app.recupere_parametre_int(43,numchamp1,(char*)"Numéro champs 1 manquant"); |
870 |
|
|
app.recupere_parametre_int(44,numchamp2,(char*)"Numéro champs 2 manquant"); |
871 |
|
|
app.recupere_parametre_int(45,numchamp3,(char*)"Numéro champs 3 manquant"); |
872 |
francois |
516 |
app.recupere_parametre_double_avec_defaut(61,coef,0.); |
873 |
francois |
432 |
if (app.get_erreur()==true) return 0; |
874 |
|
|
char mess[500]; |
875 |
|
|
sprintf(mess," Calcul de deforme"); |
876 |
|
|
app.affiche(mess); |
877 |
francois |
283 |
MG_FILE gest(nomfichier); |
878 |
francois |
432 |
FEM_MAILLAGE* mai; |
879 |
|
|
if (nummai==0) mai=gest.get_fem_maillage(nummai); else mai=gest.get_fem_maillageid(nummai); |
880 |
francois |
283 |
FEM_SOLUTION* sol1=gest.get_fem_solutionid(numsol1); |
881 |
|
|
FEM_SOLUTION* sol2=gest.get_fem_solutionid(numsol2); |
882 |
|
|
FEM_SOLUTION* sol3=gest.get_fem_solutionid(numsol3); |
883 |
|
|
mai->calcul_deforme(sol1,numchamp1,sol2,numchamp2,sol3,numchamp3); |
884 |
francois |
516 |
if (coef>1e-16) |
885 |
|
|
{ |
886 |
|
|
sprintf(mess," Création du maillage deforme"); |
887 |
|
|
app.affiche(mess); |
888 |
|
|
MG_MAILLAGE* mgmai=new MG_MAILLAGE(mai,coef); |
889 |
|
|
} |
890 |
|
|
sprintf(mess," Enregistrement"); |
891 |
|
|
app.affiche(mess); |
892 |
|
|
gest.enregistrer(nomfichier); |
893 |
francois |
283 |
} |
894 |
francois |
432 |
if (app.get_action()==39) |
895 |
francois |
283 |
{ |
896 |
francois |
432 |
int numgeo; |
897 |
|
|
app.recupere_parametre_int_avec_defaut (31,numgeo,0); |
898 |
|
|
if (app.get_erreur()==true) return 0; |
899 |
|
|
char mess[500]; |
900 |
|
|
sprintf(mess," Fusion de géométrie"); |
901 |
|
|
app.affiche(mess); |
902 |
francois |
283 |
MG_FILE gest(nomfichier); |
903 |
francois |
432 |
MG_GEOMETRIE* mggeo; |
904 |
|
|
if (numgeo==0) mggeo=gest.get_mg_geometrie(numgeo); else mggeo=gest.get_mg_geometrieid(numgeo); |
905 |
francois |
283 |
VCT_MULTI_MODELE fusion(mggeo); |
906 |
|
|
fusion.recherche_identite(); |
907 |
|
|
gest.enregistrer(nomfichier); |
908 |
francois |
432 |
} |
909 |
|
|
if ((app.get_action()==46) || (app.get_action()==47)) |
910 |
francois |
283 |
{ |
911 |
francois |
432 |
int numgeo; |
912 |
|
|
char ccf[500]; |
913 |
|
|
app.recupere_parametre_int_avec_defaut (31,numgeo,0); |
914 |
|
|
app.recupere_parametre_string(49,ccf,(char*)"Valeur de la condition aux limites manquant"); |
915 |
|
|
if (app.get_erreur()==true) return 0; |
916 |
|
|
char mess[500]; |
917 |
|
|
sprintf(mess," Selection de condition aux limites"); |
918 |
francois |
296 |
unsigned long identity; |
919 |
|
|
char typeccf[3]; |
920 |
gervaislavoie |
318 |
typeccf[2]=0; |
921 |
gervaislavoie |
302 |
double valccf=0.5; // Valeur par défaut |
922 |
francois |
296 |
sscanf(ccf,"%lu:%c%c:%le\n",&identity,&typeccf[0],&typeccf[1],&valccf); |
923 |
|
|
MC_GESTIONNAIRE mcgest; |
924 |
|
|
int res=mcgest.existe(typeccf); |
925 |
|
|
if (res==0) |
926 |
|
|
{ |
927 |
|
|
sprintf(mess," ERREUR!!!! Code conditions aux limites inconnu"); |
928 |
francois |
432 |
app.affiche(mess); |
929 |
francois |
296 |
return 0; |
930 |
|
|
} |
931 |
|
|
sprintf(mess," Ajout d'une condition aux limites : %s",mcgest.get_description(typeccf).c_str()); |
932 |
francois |
432 |
app.affiche(mess); |
933 |
francois |
292 |
MG_FILE gest(nomfichier); |
934 |
francois |
432 |
MG_GEOMETRIE* geo; |
935 |
|
|
if (numgeo==0) geo=gest.get_mg_geometrie(numgeo); else geo=gest.get_mg_geometrieid(numgeo); |
936 |
francois |
292 |
TPL_MAP_ENTITE<MG_ELEMENT_TOPOLOGIQUE*> liste; |
937 |
francois |
296 |
MG_VOLUME* ele; |
938 |
|
|
ele=geo->get_mg_volumeid(identity); |
939 |
francois |
292 |
if (ele!=NULL) liste.ajouter(ele); |
940 |
francois |
296 |
else |
941 |
|
|
{ |
942 |
|
|
MG_COQUE* ele; |
943 |
|
|
ele=geo->get_mg_coqueid(identity); |
944 |
|
|
if (ele!=NULL) liste.ajouter(ele); |
945 |
|
|
else |
946 |
francois |
292 |
{ |
947 |
francois |
296 |
MG_POUTRE* ele; |
948 |
|
|
ele=geo->get_mg_poutreid(identity); |
949 |
francois |
292 |
if (ele!=NULL) liste.ajouter(ele); |
950 |
|
|
else |
951 |
francois |
296 |
{ |
952 |
|
|
MG_FACE* ele; |
953 |
|
|
ele=geo->get_mg_faceid(identity); |
954 |
|
|
if (ele!=NULL) liste.ajouter(ele); |
955 |
|
|
else |
956 |
|
|
{ |
957 |
|
|
MG_ARETE* ele; |
958 |
|
|
ele=geo->get_mg_areteid(identity); |
959 |
|
|
if (ele!=NULL) liste.ajouter(ele); |
960 |
|
|
else |
961 |
|
|
{ |
962 |
|
|
MG_SOMMET* ele; |
963 |
|
|
ele=geo->get_mg_sommetid(identity); |
964 |
|
|
if (ele!=NULL) liste.ajouter(ele); |
965 |
|
|
} |
966 |
|
|
} |
967 |
|
|
} |
968 |
francois |
292 |
} |
969 |
francois |
296 |
} |
970 |
francois |
432 |
if (app.get_action()==47) |
971 |
francois |
292 |
{ |
972 |
|
|
int nb=liste.get_nb(); |
973 |
|
|
for (int i=0;i<nb;i++) liste.get(i)->get_topologie_sousjacente(&liste); |
974 |
|
|
} |
975 |
|
|
int nb=liste.get_nb(); |
976 |
|
|
for (int i=0;i<nb;i++) liste.get(i)->ajouter_ccf(typeccf,valccf);; |
977 |
|
|
gest.enregistrer(nomfichier); |
978 |
francois |
432 |
} |
979 |
francois |
763 |
if ((app.get_action()==94) || (app.get_action()==95)) |
980 |
|
|
{ |
981 |
|
|
int numgeo; |
982 |
|
|
char ccf[500]; |
983 |
|
|
app.recupere_parametre_int_avec_defaut (31,numgeo,0); |
984 |
|
|
app.recupere_parametre_string(49,ccf,(char*)"Valeur de la condition aux limites manquant"); |
985 |
|
|
if (app.get_erreur()==true) return 0; |
986 |
|
|
char mess[500]; |
987 |
|
|
sprintf(mess," Selection de condition aux limites"); |
988 |
|
|
unsigned long identity; |
989 |
|
|
char typeccf[3]; |
990 |
|
|
typeccf[2]=0; |
991 |
|
|
unsigned long valccf=0; // Valeur par défaut |
992 |
|
|
sscanf(ccf,"%lu:%c%c:%lu\n",&identity,&typeccf[0],&typeccf[1],&valccf); |
993 |
|
|
MC_GESTIONNAIRE mcgest; |
994 |
|
|
int res=mcgest.existe(typeccf); |
995 |
|
|
if (res==0) |
996 |
|
|
{ |
997 |
|
|
sprintf(mess," ERREUR!!!! Code conditions aux limites inconnu"); |
998 |
|
|
app.affiche(mess); |
999 |
|
|
return 0; |
1000 |
|
|
} |
1001 |
|
|
sprintf(mess," Ajout d'une condition aux limites : %s",mcgest.get_description(typeccf).c_str()); |
1002 |
|
|
app.affiche(mess); |
1003 |
|
|
MG_FILE gest(nomfichier); |
1004 |
|
|
MG_GEOMETRIE* geo; |
1005 |
|
|
if (numgeo==0) geo=gest.get_mg_geometrie(numgeo); else geo=gest.get_mg_geometrieid(numgeo); |
1006 |
|
|
TPL_MAP_ENTITE<MG_ELEMENT_TOPOLOGIQUE*> liste; |
1007 |
|
|
MG_VOLUME* ele; |
1008 |
|
|
ele=geo->get_mg_volumeid(identity); |
1009 |
|
|
if (ele!=NULL) liste.ajouter(ele); |
1010 |
|
|
else |
1011 |
|
|
{ |
1012 |
|
|
MG_COQUE* ele; |
1013 |
|
|
ele=geo->get_mg_coqueid(identity); |
1014 |
|
|
if (ele!=NULL) liste.ajouter(ele); |
1015 |
|
|
else |
1016 |
|
|
{ |
1017 |
|
|
MG_POUTRE* ele; |
1018 |
|
|
ele=geo->get_mg_poutreid(identity); |
1019 |
|
|
if (ele!=NULL) liste.ajouter(ele); |
1020 |
|
|
else |
1021 |
|
|
{ |
1022 |
|
|
MG_FACE* ele; |
1023 |
|
|
ele=geo->get_mg_faceid(identity); |
1024 |
|
|
if (ele!=NULL) liste.ajouter(ele); |
1025 |
|
|
else |
1026 |
|
|
{ |
1027 |
|
|
MG_ARETE* ele; |
1028 |
|
|
ele=geo->get_mg_areteid(identity); |
1029 |
|
|
if (ele!=NULL) liste.ajouter(ele); |
1030 |
|
|
else |
1031 |
|
|
{ |
1032 |
|
|
MG_SOMMET* ele; |
1033 |
|
|
ele=geo->get_mg_sommetid(identity); |
1034 |
|
|
if (ele!=NULL) liste.ajouter(ele); |
1035 |
|
|
} |
1036 |
|
|
} |
1037 |
|
|
} |
1038 |
|
|
} |
1039 |
|
|
} |
1040 |
|
|
if (app.get_action()==95) |
1041 |
|
|
{ |
1042 |
|
|
int nb=liste.get_nb(); |
1043 |
|
|
for (int i=0;i<nb;i++) liste.get(i)->get_topologie_sousjacente(&liste); |
1044 |
|
|
} |
1045 |
|
|
int nb=liste.get_nb(); |
1046 |
|
|
for (int i=0;i<nb;i++) liste.get(i)->ajouter_ccf(typeccf,valccf);; |
1047 |
|
|
gest.enregistrer(nomfichier); |
1048 |
|
|
} |
1049 |
|
|
if ((app.get_action()==96) || (app.get_action()==97)) |
1050 |
|
|
{ |
1051 |
|
|
int numgeo; |
1052 |
|
|
char ccf[500]; |
1053 |
|
|
app.recupere_parametre_int_avec_defaut (31,numgeo,0); |
1054 |
|
|
app.recupere_parametre_string(49,ccf,(char*)"Valeur de la condition aux limites manquant"); |
1055 |
|
|
if (app.get_erreur()==true) return 0; |
1056 |
|
|
char mess[500]; |
1057 |
|
|
sprintf(mess," Selection de condition aux limites"); |
1058 |
|
|
unsigned long identity; |
1059 |
|
|
char typeccf[3]; |
1060 |
|
|
typeccf[2]=0; |
1061 |
|
|
char valccf[500]; |
1062 |
|
|
char formule[500]; |
1063 |
|
|
sscanf(ccf,"%lu:%c%c:%s\n",&identity,&typeccf[0],&typeccf[1],formule); |
1064 |
|
|
OT_CHAINE ot; |
1065 |
|
|
std::vector<std::string> variable=ot.split(formule,':'); |
1066 |
|
|
strcpy(valccf,variable[0].c_str()); |
1067 |
|
|
std::vector<std::string> listvariable=ot.split(variable[1].c_str(),','); |
1068 |
|
|
MC_GESTIONNAIRE mcgest; |
1069 |
|
|
int res=mcgest.existe(typeccf); |
1070 |
|
|
if (res==0) |
1071 |
|
|
{ |
1072 |
|
|
sprintf(mess," ERREUR!!!! Code conditions aux limites inconnu"); |
1073 |
|
|
app.affiche(mess); |
1074 |
|
|
return 0; |
1075 |
|
|
} |
1076 |
|
|
sprintf(mess," Ajout d'une condition aux limites : %s",mcgest.get_description(typeccf).c_str()); |
1077 |
|
|
app.affiche(mess); |
1078 |
|
|
MG_FILE gest(nomfichier); |
1079 |
|
|
MG_GEOMETRIE* geo; |
1080 |
|
|
if (numgeo==0) geo=gest.get_mg_geometrie(numgeo); else geo=gest.get_mg_geometrieid(numgeo); |
1081 |
|
|
TPL_MAP_ENTITE<MG_ELEMENT_TOPOLOGIQUE*> liste; |
1082 |
|
|
MG_VOLUME* ele; |
1083 |
|
|
ele=geo->get_mg_volumeid(identity); |
1084 |
|
|
if (ele!=NULL) liste.ajouter(ele); |
1085 |
|
|
else |
1086 |
|
|
{ |
1087 |
|
|
MG_COQUE* ele; |
1088 |
|
|
ele=geo->get_mg_coqueid(identity); |
1089 |
|
|
if (ele!=NULL) liste.ajouter(ele); |
1090 |
|
|
else |
1091 |
|
|
{ |
1092 |
|
|
MG_POUTRE* ele; |
1093 |
|
|
ele=geo->get_mg_poutreid(identity); |
1094 |
|
|
if (ele!=NULL) liste.ajouter(ele); |
1095 |
|
|
else |
1096 |
|
|
{ |
1097 |
|
|
MG_FACE* ele; |
1098 |
|
|
ele=geo->get_mg_faceid(identity); |
1099 |
|
|
if (ele!=NULL) liste.ajouter(ele); |
1100 |
|
|
else |
1101 |
|
|
{ |
1102 |
|
|
MG_ARETE* ele; |
1103 |
|
|
ele=geo->get_mg_areteid(identity); |
1104 |
|
|
if (ele!=NULL) liste.ajouter(ele); |
1105 |
|
|
else |
1106 |
|
|
{ |
1107 |
|
|
MG_SOMMET* ele; |
1108 |
|
|
ele=geo->get_mg_sommetid(identity); |
1109 |
|
|
if (ele!=NULL) liste.ajouter(ele); |
1110 |
|
|
} |
1111 |
|
|
} |
1112 |
|
|
} |
1113 |
|
|
} |
1114 |
|
|
} |
1115 |
|
|
if (app.get_action()==97) |
1116 |
|
|
{ |
1117 |
|
|
int nb=liste.get_nb(); |
1118 |
|
|
for (int i=0;i<nb;i++) liste.get(i)->get_topologie_sousjacente(&liste); |
1119 |
|
|
} |
1120 |
|
|
int nb=liste.get_nb(); |
1121 |
|
|
for (int i=0;i<nb;i++) liste.get(i)->ajouter_ccf(typeccf,valccf,listvariable);; |
1122 |
|
|
gest.enregistrer(nomfichier); |
1123 |
|
|
} |
1124 |
francois |
432 |
if (app.get_action()==48) |
1125 |
francois |
296 |
{ |
1126 |
francois |
432 |
char mess[500]; |
1127 |
francois |
296 |
sprintf(mess," Liste des conditions aux limites disponibles"); |
1128 |
francois |
432 |
app.affiche(mess); |
1129 |
francois |
296 |
MC_GESTIONNAIRE mcgest; |
1130 |
|
|
int ok=0; |
1131 |
|
|
do |
1132 |
|
|
{ |
1133 |
|
|
std::string code; |
1134 |
|
|
std::string description; |
1135 |
|
|
int res=mcgest.get_description(code,description); |
1136 |
|
|
if (res) |
1137 |
|
|
{ |
1138 |
|
|
sprintf(mess," %s : %s",code.c_str(),description.c_str()); |
1139 |
francois |
432 |
app.affiche(mess); |
1140 |
francois |
296 |
} |
1141 |
|
|
else ok=1; |
1142 |
|
|
} |
1143 |
|
|
while (ok==0); |
1144 |
francois |
432 |
} |
1145 |
|
|
if (app.get_action()==50) |
1146 |
francois |
326 |
{ |
1147 |
francois |
432 |
int numgeo,nummai,numcoque; |
1148 |
|
|
char fichierout[500]; |
1149 |
|
|
app.recupere_parametre_int_avec_defaut(31,numgeo,0); |
1150 |
|
|
app.recupere_parametre_int_avec_defaut(19,nummai,0); |
1151 |
|
|
app.recupere_parametre_int_avec_defaut(51,numcoque,0); |
1152 |
|
|
app.recupere_parametre_string_avec_defaut(5,fichierout,nomfichier); |
1153 |
|
|
if (app.get_erreur()==true) return 0; |
1154 |
|
|
char mess[500]; |
1155 |
gervaislavoie |
328 |
sprintf(mess," Orientation d'une coque"); |
1156 |
francois |
432 |
app.affiche(mess); |
1157 |
gervaislavoie |
328 |
MG_FILE gest(nomfichier); |
1158 |
francois |
432 |
MG_GEOMETRIE* geo; |
1159 |
|
|
if (numgeo==0) geo=gest.get_mg_geometrie(numgeo); else geo=gest.get_mg_geometrieid(numgeo); |
1160 |
|
|
MG_MAILLAGE* mai; |
1161 |
|
|
if (nummai==0) mai=gest.get_mg_maillage(nummai); else mai=gest.get_mg_maillageid(nummai); |
1162 |
|
|
MG_COQUE* coque; |
1163 |
|
|
if (numcoque==0) coque=mai->get_mg_geometrie()->get_mg_coque(numcoque); else coque=mai->get_mg_geometrie()->get_mg_coqueid(numcoque); |
1164 |
gervaislavoie |
328 |
coque->orienter(mai); |
1165 |
|
|
gest.enregistrer(fichierout); |
1166 |
francois |
432 |
} |
1167 |
|
|
if (app.get_action()==52) |
1168 |
francois |
428 |
{ |
1169 |
francois |
432 |
double epsf,unite; |
1170 |
|
|
app.recupere_parametre_double_avec_defaut(10,unite,1.); |
1171 |
|
|
app.recupere_parametre_double_avec_defaut(53,epsf,0.0001); |
1172 |
|
|
if (app.get_erreur()==true) return 0; |
1173 |
|
|
char mess[500]; |
1174 |
|
|
sprintf(mess," Conversion STL vers MAGiC"); |
1175 |
|
|
app.affiche(mess); |
1176 |
|
|
MG_GESTIONNAIRE gest; |
1177 |
francois |
428 |
STL_IMPORT stlimport; |
1178 |
francois |
429 |
stlimport.change_eps(epsf); |
1179 |
francois |
428 |
stlimport.importer(gest,nomfichier) ; |
1180 |
|
|
strncpy(chaine,nomfichier,p-nomfichier); |
1181 |
|
|
std::string namefic=chaine; |
1182 |
|
|
namefic=namefic + ".magic"; |
1183 |
|
|
int nb=gest.get_nb_mg_geometrie(); |
1184 |
|
|
for (int i=0;i<nb;i++) |
1185 |
|
|
gest.get_mg_geometrie(i)->change_valeur_unite(unite); |
1186 |
|
|
gest.enregistrer(namefic.c_str()); |
1187 |
|
|
} |
1188 |
francois |
432 |
if (app.get_action()==54) |
1189 |
mejrim |
597 |
{ |
1190 |
francois |
432 |
int nummai; |
1191 |
|
|
char coderesu[10]; |
1192 |
francois |
706 |
bool elastique; |
1193 |
couturad |
719 |
bool elastique_gd; |
1194 |
|
|
bool plastique; |
1195 |
mejrim |
597 |
bool thermique; |
1196 |
francois |
603 |
bool conplane; |
1197 |
|
|
bool defplane; |
1198 |
francois |
706 |
bool creeparam; |
1199 |
|
|
char nomparam[500]; |
1200 |
francois |
432 |
app.recupere_parametre_int_avec_defaut(19,nummai,0); |
1201 |
|
|
app.recupere_parametre_string_avec_defaut(7,coderesu,(char*)"11111111"); |
1202 |
francois |
706 |
app.recupere_parametre_bool_avec_defaut(63,elastique,false); |
1203 |
mejrim |
597 |
app.recupere_parametre_bool_avec_defaut(64,thermique,false); |
1204 |
francois |
603 |
app.recupere_parametre_bool_avec_defaut(65,conplane,false); |
1205 |
|
|
app.recupere_parametre_bool_avec_defaut(66,defplane,false); |
1206 |
francois |
706 |
app.recupere_parametre_bool_avec_defaut(85,creeparam,false); |
1207 |
couturad |
719 |
app.recupere_parametre_bool_avec_defaut(88,elastique_gd,false); |
1208 |
|
|
app.recupere_parametre_bool_avec_defaut(89,plastique,false); |
1209 |
francois |
706 |
if (!creeparam) app.recupere_parametre_string(1,nomfichier,(char*)"Fichier entrant manquant"); |
1210 |
|
|
app.recupere_parametre_string(84,nomparam,(char*)"Fichier parametre manquant"); |
1211 |
francois |
432 |
if (app.get_erreur()==true) return 0; |
1212 |
francois |
706 |
if (creeparam) |
1213 |
|
|
{ |
1214 |
|
|
char mess[500]; |
1215 |
|
|
sprintf(mess," Calcul ASTER\n\nCréation d'un fichier parametre\n"); |
1216 |
|
|
app.affiche(mess); |
1217 |
|
|
MG_EXPORT exp; |
1218 |
|
|
exp.ecrire_params_aster(nomparam); |
1219 |
|
|
} |
1220 |
|
|
else |
1221 |
|
|
{ |
1222 |
francois |
432 |
char mess[500]; |
1223 |
|
|
sprintf(mess," Calcul ASTER"); |
1224 |
|
|
app.affiche(mess); |
1225 |
|
|
char nometude[1000]; |
1226 |
|
|
char *p=strchr(nomfichier,'.'); |
1227 |
|
|
strncpy(nometude,nomfichier,p-nomfichier); |
1228 |
|
|
nometude[p-nomfichier]=0; |
1229 |
|
|
MG_FILE gest(nomfichier); |
1230 |
|
|
FEM_MAILLAGE* mai; |
1231 |
|
|
if (nummai==0) mai=gest.get_fem_maillage(nummai); else mai=gest.get_fem_maillageid(nummai); |
1232 |
|
|
MGASTER mgaster; |
1233 |
|
|
mgaster.active_affichage(app.affiche); |
1234 |
francois |
706 |
if (elastique) mgaster.calcule(nomparam,mai,nometude,MAGIC::CALCUL_ASTER::ELASTIQUE,coderesu); |
1235 |
|
|
if (conplane) mgaster.calcule(nomparam,mai,nometude,MAGIC::CALCUL_ASTER::CONTRAINTE_PLANE,coderesu); |
1236 |
|
|
if (defplane) mgaster.calcule(nomparam,mai,nometude,MAGIC::CALCUL_ASTER::DEFORMATION_PLANE,coderesu); |
1237 |
|
|
if (thermique) mgaster.calcule(nomparam,mai,nometude,MAGIC::CALCUL_ASTER::THERMIQUE,(char*)""); |
1238 |
couturad |
719 |
if (elastique_gd) mgaster.calcule(nomparam,mai,nometude,MAGIC::CALCUL_ASTER::ELASTIQUE_GROT_GDEF,coderesu); |
1239 |
|
|
if (plastique) mgaster.calcule(nomparam,mai,nometude,MAGIC::CALCUL_ASTER::PLASTIQUE,coderesu); |
1240 |
|
|
|
1241 |
francois |
706 |
} |
1242 |
francois |
432 |
} |
1243 |
francois |
469 |
if (app.get_action()==56) |
1244 |
|
|
{ |
1245 |
|
|
if (app.get_erreur()==true) return 0; |
1246 |
|
|
char mess[500]; |
1247 |
francois |
505 |
sprintf(mess," Conversion carte de taille nouvelle version vers GMSH"); |
1248 |
francois |
469 |
app.affiche(mess); |
1249 |
|
|
FCT_TAILLE_FEM_SOLUTION carte(nomfichier); |
1250 |
|
|
strncpy(chaine,nomfichier,p-nomfichier); |
1251 |
|
|
std::string namefic=chaine; |
1252 |
|
|
MG_EXPORT exp; |
1253 |
francois |
505 |
exp.gmsh(&carte,namefic); |
1254 |
francois |
469 |
sprintf(mess," Carte de taille FEM : Creation de %s.msh",namefic.c_str()); |
1255 |
|
|
app.affiche(mess); |
1256 |
|
|
} |
1257 |
francois |
514 |
if ((app.get_action()==58) || (app.get_action()==60)) |
1258 |
|
|
{ |
1259 |
|
|
int nummai; |
1260 |
|
|
app.recupere_parametre_int_avec_defaut(19,nummai,0); |
1261 |
|
|
char nomcarte[500]; |
1262 |
|
|
if (app.get_action()==58) |
1263 |
|
|
app.recupere_parametre_string(59,nomcarte,(char*)"Fichier carte manquant"); |
1264 |
|
|
if (app.get_action()==60) |
1265 |
|
|
app.recupere_parametre_string(59,nomcarte,(char*)"Fichier carte manquant"); |
1266 |
|
|
if (app.get_erreur()==true) return 0; |
1267 |
|
|
char mess[500]; |
1268 |
|
|
sprintf(mess," Comparaison de la taille reelle d'un maillage avec la carte de taille"); |
1269 |
|
|
app.affiche(mess); |
1270 |
|
|
sprintf(mess," Lecture fichier MAGiC"); |
1271 |
|
|
app.affiche(mess); |
1272 |
|
|
MG_FILE gest(nomfichier); |
1273 |
|
|
MG_MAILLAGE* mai; |
1274 |
|
|
if (nummai==0) mai=gest.get_mg_maillage(nummai); else mai=gest.get_mg_maillageid(nummai); |
1275 |
|
|
sprintf(mess," Lecture fichier carte de taille"); |
1276 |
|
|
app.affiche(mess); |
1277 |
|
|
FCT_TAILLE *carte; |
1278 |
|
|
if (app.get_action()==58) |
1279 |
|
|
carte=new FCT_GENERATEUR_3D<4>(nomcarte); |
1280 |
francois |
518 |
if (app.get_action()==60) |
1281 |
francois |
514 |
carte=new FCT_TAILLE_FEM_SOLUTION(nomcarte); |
1282 |
|
|
char nometude[1000]; |
1283 |
|
|
char *p=strchr(nomfichier,'.'); |
1284 |
|
|
strncpy(nometude,nomfichier,p-nomfichier); |
1285 |
|
|
nometude[p-nomfichier]=0; |
1286 |
|
|
char nomsolution[500]; |
1287 |
|
|
sprintf(nomsolution,"%s_comp%lu.sol",nometude,mai->get_id()); |
1288 |
|
|
sprintf(mess," Comparaison"); |
1289 |
|
|
app.affiche(mess); |
1290 |
|
|
MAILLEUR_ANALYSE m3d(mai); |
1291 |
francois |
577 |
sprintf(mess," Respect global de la taille demandee"); |
1292 |
|
|
app.affiche(mess); |
1293 |
|
|
double tabtaille[3]; |
1294 |
|
|
m3d.compare_maillage_carte_isotrope(carte,nomsolution,tabtaille); |
1295 |
|
|
sprintf(mess," Nombre de maille théorique : %lf - Nombre de maille reelle : %lf",tabtaille[0],tabtaille[1]); |
1296 |
|
|
app.affiche(mess); |
1297 |
|
|
sprintf(mess," Erreur : %lf%%",tabtaille[2]); |
1298 |
|
|
app.affiche(mess); |
1299 |
francois |
560 |
MG_SOLUTION *sol=gest.get_mg_solution(gest.get_nb_mg_solution()-1); |
1300 |
|
|
sol->active_solution(2); |
1301 |
|
|
LISTE_MG_NOEUD::iterator it; |
1302 |
|
|
int tab[201]; |
1303 |
|
|
for (int i=0;i<201;i++) tab[i]=0; |
1304 |
|
|
for (MG_NOEUD* no=mai->get_premier_noeud(it);no!=NULL;no=mai->get_suivant_noeud(it)) |
1305 |
|
|
{ |
1306 |
|
|
double val=no->get_solution(); |
1307 |
|
|
int valint=(int)val+100; |
1308 |
|
|
if (valint<0) valint=0; |
1309 |
|
|
if (valint>200) valint=200; |
1310 |
|
|
tab[valint]++; |
1311 |
|
|
} |
1312 |
francois |
577 |
sprintf(mess," Repartition du respect de la taille demandee"); |
1313 |
francois |
560 |
app.affiche(mess); |
1314 |
|
|
char nomanalyse[500]; |
1315 |
|
|
sprintf(nomanalyse,"%s_comp%lu.csv",nometude,mai->get_id()); |
1316 |
|
|
FILE *in=fopen(nomanalyse,"wt"); |
1317 |
|
|
for (int i=0;i<201;i++) |
1318 |
|
|
if (i<101) fprintf(in,"%d;%d;\n",i-100,tab[i]); |
1319 |
|
|
else fprintf(in,"%d;%d;%d;\n",i-100,tab[i],tab[i]+tab[200-i]); |
1320 |
|
|
fclose(in); |
1321 |
francois |
514 |
sprintf(mess," Enregistrement"); |
1322 |
|
|
app.affiche(mess); |
1323 |
|
|
sprintf(nomsolution,"%s_comp%lu.magic",nometude,mai->get_id()); |
1324 |
|
|
gest.enregistrer(nomsolution); |
1325 |
|
|
delete carte; |
1326 |
|
|
} |
1327 |
francois |
475 |
if (app.get_action()==57) |
1328 |
|
|
{ |
1329 |
|
|
int nummai; |
1330 |
|
|
app.recupere_parametre_int_avec_defaut(19,nummai,0); |
1331 |
|
|
if (app.get_erreur()==true) return 0; |
1332 |
|
|
char mess[500]; |
1333 |
|
|
sprintf(mess," Conversion mg maillage en stl"); |
1334 |
|
|
app.affiche(mess); |
1335 |
|
|
MG_FILE gest(nomfichier); |
1336 |
|
|
strncpy(chaine,nomfichier,p-nomfichier); |
1337 |
|
|
MG_MAILLAGE* mai; |
1338 |
|
|
if (nummai==0) mai=gest.get_mg_maillage(0); else mai=gest.get_mg_maillageid(nummai); |
1339 |
|
|
sprintf(chaine,"%s%lu",chaine,mai->get_id()); |
1340 |
|
|
std::string namefic=chaine; |
1341 |
|
|
MG_EXPORT exp; |
1342 |
|
|
exp.stl(mai,namefic); |
1343 |
|
|
sprintf(mess," creation de %s.stl",namefic.c_str()); |
1344 |
|
|
app.affiche(mess); |
1345 |
|
|
|
1346 |
|
|
} |
1347 |
francois |
517 |
if (app.get_action()==62) |
1348 |
|
|
{ |
1349 |
|
|
int nummai; |
1350 |
|
|
app.recupere_parametre_int_avec_defaut(19,nummai,0); |
1351 |
|
|
char outfile[500]; |
1352 |
|
|
app.recupere_parametre_string(5,outfile,(char*)"Fichier de sortie manquant"); |
1353 |
|
|
if (app.get_erreur()==true) return 0; |
1354 |
|
|
char mess[500]; |
1355 |
|
|
sprintf(mess," Détachement d'un mg maillage de sa geometrie"); |
1356 |
|
|
app.affiche(mess); |
1357 |
|
|
MG_FILE gest(nomfichier); |
1358 |
|
|
MG_MAILLAGE* mai; |
1359 |
|
|
if (nummai==0) mai=gest.get_mg_maillage(0); else mai=gest.get_mg_maillageid(nummai); |
1360 |
|
|
MG_GESTIONNAIRE gest2; |
1361 |
|
|
MG_MAILLAGE *mai2=mai->detacher(&gest2); |
1362 |
|
|
sprintf(mess," Enregistrement"); |
1363 |
|
|
app.affiche(mess); |
1364 |
|
|
gest2.enregistrer(outfile); |
1365 |
francois |
604 |
} |
1366 |
|
|
if (app.get_action()==67) |
1367 |
|
|
{ |
1368 |
|
|
int numsol; |
1369 |
|
|
int numchamp; |
1370 |
|
|
int numare; |
1371 |
|
|
int numgeo; |
1372 |
|
|
char outfile[500]; |
1373 |
|
|
app.recupere_parametre_int_avec_defaut(31,numgeo,0); |
1374 |
|
|
app.recupere_parametre_int_avec_defaut(68,numsol,0); |
1375 |
|
|
app.recupere_parametre_int_avec_defaut(69,numchamp,0); |
1376 |
|
|
app.recupere_parametre_int_avec_defaut(71,numare,0); |
1377 |
|
|
app.recupere_parametre_string(70,outfile,(char*)"Fichier de sortie manquant"); |
1378 |
|
|
if (app.get_erreur()==true) return 0; |
1379 |
|
|
MG_FILE gest(nomfichier); |
1380 |
|
|
FEM_SOLUTION* sol; |
1381 |
|
|
if (numsol==0) sol=gest.get_fem_solution(0); else sol=gest.get_fem_solutionid(numsol); |
1382 |
|
|
MG_GEOMETRIE* geo; |
1383 |
|
|
if (numgeo==0) geo=gest.get_mg_geometrie(0); else geo=gest.get_mg_geometrie(numgeo); |
1384 |
|
|
MG_ARETE *are; |
1385 |
|
|
if (numare==0) are=geo->get_mg_arete(0); else are=geo->get_mg_areteid(numare); |
1386 |
|
|
char mess[500]; |
1387 |
francois |
628 |
sprintf(mess," Sonde de %s_%s sur l'arète %lu",(char*)sol->get_nom().c_str(),(char*)sol->get_legende(numchamp).c_str(),are->get_id()); |
1388 |
francois |
604 |
app.affiche(mess); |
1389 |
|
|
are->recupere_resultat(sol,numchamp,outfile); |
1390 |
|
|
|
1391 |
|
|
} |
1392 |
francois |
628 |
if (app.get_action()==72) |
1393 |
|
|
{ |
1394 |
|
|
int numsol; |
1395 |
|
|
int numchamp; |
1396 |
|
|
int nummai; |
1397 |
|
|
char outfile[500]; |
1398 |
|
|
char infile[500]; |
1399 |
|
|
app.recupere_parametre_int_avec_defaut(68,numsol,0); |
1400 |
|
|
app.recupere_parametre_int_avec_defaut(69,numchamp,0); |
1401 |
|
|
app.recupere_parametre_int_avec_defaut(19,nummai,0); |
1402 |
|
|
app.recupere_parametre_string(73,infile,(char*)"Fichier de solution manquant"); |
1403 |
|
|
app.recupere_parametre_string_avec_defaut(5,outfile,infile); |
1404 |
|
|
if (app.get_erreur()==true) return 0; |
1405 |
francois |
633 |
app.affiche((char*)"Lecture du fichier MAGIC"); |
1406 |
|
|
MG_FILE gest(nomfichier); |
1407 |
|
|
app.affiche((char*)"Lecture de la solution a projeter"); |
1408 |
|
|
MG_FILE gestsol(infile); |
1409 |
francois |
628 |
FEM_SOLUTION* sol; |
1410 |
|
|
if (numsol==0) sol=gestsol.get_fem_solution(0); else sol=gestsol.get_fem_solutionid(numsol); |
1411 |
|
|
FEM_MAILLAGE* fem; |
1412 |
|
|
if (nummai==0) fem=gest.get_fem_maillage(0); else fem=gest.get_fem_maillageid(nummai); |
1413 |
|
|
char mess[500]; |
1414 |
|
|
sprintf(mess," Projection de la solution %s_%s du maillage %lu sur le maillage %lu",(char*)sol->get_nom().c_str(),(char*)sol->get_legende(numchamp).c_str(),sol->get_maillage()->get_id(),fem->get_id()); |
1415 |
|
|
app.affiche(mess); |
1416 |
|
|
FEM_MAILLAGE_OUTILS otfem; |
1417 |
francois |
635 |
int res=otfem.projete_solution_maillage(sol,numchamp,fem); |
1418 |
|
|
if (res==MAGIC::PROJECTION::SUCCES) gest.enregistrer(outfile); |
1419 |
|
|
if (res==MAGIC::PROJECTION::DIMENSION_MAILLAGE_INCOMPATIBLE) app.affiche((char*)" Erreur : Dimension des maillages incompatibles"); |
1420 |
|
|
if (res==MAGIC::PROJECTION::TYPE_SOLUTION_INCORRECT) app.affiche((char*)" Erreur : Solution a projeter n'est pas exprimer aux noeuds"); |
1421 |
|
|
if (res==MAGIC::PROJECTION::NON_IMPLEMENTER) app.affiche((char*)" Erreur : Cas de projection non implementer"); |
1422 |
francois |
628 |
} |
1423 |
|
|
if (app.get_action()==74) |
1424 |
|
|
{ |
1425 |
|
|
int numsol1; |
1426 |
|
|
int numchamp1; |
1427 |
|
|
int numsol2; |
1428 |
|
|
int numchamp2; |
1429 |
|
|
char outfile[500]; |
1430 |
|
|
app.recupere_parametre_int_avec_defaut(40,numsol1,0); |
1431 |
|
|
app.recupere_parametre_int_avec_defaut(41,numsol2,0); |
1432 |
|
|
app.recupere_parametre_int_avec_defaut(43,numchamp1,0); |
1433 |
|
|
app.recupere_parametre_int_avec_defaut(44,numchamp2,0); |
1434 |
|
|
app.recupere_parametre_string_avec_defaut(5,outfile,nomfichier); |
1435 |
|
|
if (app.get_erreur()==true) return 0; |
1436 |
|
|
MG_FILE gest(nomfichier); |
1437 |
|
|
FEM_SOLUTION* sol1; |
1438 |
|
|
if (numsol1==0) sol1=gest.get_fem_solution(0); else sol1=gest.get_fem_solutionid(numsol1); |
1439 |
|
|
FEM_SOLUTION* sol2; |
1440 |
|
|
if (numsol2==0) sol2=gest.get_fem_solution(0); else sol2=gest.get_fem_solutionid(numsol2); |
1441 |
|
|
char mess[500]; |
1442 |
|
|
sprintf(mess," Comparaison de %s_%s et de %s_%s",(char*)sol1->get_nom().c_str(),(char*)sol1->get_legende(numchamp1).c_str(),(char*)sol2->get_nom().c_str(),(char*)sol2->get_legende(numchamp2).c_str()); |
1443 |
|
|
app.affiche(mess); |
1444 |
|
|
FEM_MAILLAGE_OUTILS otfem; |
1445 |
francois |
674 |
otfem.compare_champs_solution(sol1,numchamp1,sol2,numchamp2); |
1446 |
francois |
628 |
gest.enregistrer(outfile); |
1447 |
|
|
} |
1448 |
francois |
697 |
if (app.get_action()==76) |
1449 |
|
|
{ |
1450 |
francois |
757 |
bool bnoeud,belement1,belement2,belement3,bgelement1,bgelement2,bgelement3; |
1451 |
francois |
698 |
int nummai,numtopo; |
1452 |
francois |
697 |
char out[500]; |
1453 |
|
|
app.recupere_parametre_string(5,out,(char*)"Fichier sortant manquant"); |
1454 |
|
|
app.recupere_parametre_int_avec_defaut(19,nummai,0); |
1455 |
|
|
app.recupere_parametre_bool_avec_defaut(77,bnoeud,false); |
1456 |
|
|
app.recupere_parametre_bool_avec_defaut(78,belement1,false); |
1457 |
|
|
app.recupere_parametre_bool_avec_defaut(79,belement2,false); |
1458 |
|
|
app.recupere_parametre_bool_avec_defaut(80,belement3,false); |
1459 |
francois |
757 |
app.recupere_parametre_bool_avec_defaut(91,bgelement3,false); |
1460 |
|
|
app.recupere_parametre_bool_avec_defaut(92,bgelement3,false); |
1461 |
|
|
app.recupere_parametre_bool_avec_defaut(93,bgelement3,false); |
1462 |
francois |
698 |
app.recupere_parametre_int_avec_defaut(81,numtopo,0); |
1463 |
francois |
697 |
if (app.get_erreur()==true) return 0; |
1464 |
francois |
698 |
char mess[500]; |
1465 |
|
|
sprintf(mess," Extraction de tables de valeurs"); |
1466 |
|
|
app.affiche(mess); |
1467 |
francois |
697 |
MG_FILE gest(nomfichier); |
1468 |
|
|
FEM_MAILLAGE *fem; |
1469 |
francois |
698 |
MG_ELEMENT_TOPOLOGIQUE *topo; |
1470 |
francois |
697 |
if (nummai==0) fem=gest.get_fem_maillage(0); else fem=gest.get_fem_maillageid(nummai); |
1471 |
francois |
698 |
if (numtopo==0) topo=NULL; |
1472 |
|
|
else |
1473 |
|
|
{ |
1474 |
|
|
MG_GEOMETRIE* geo=fem->get_mg_geometrie(); |
1475 |
|
|
topo=geo->get_mg_faceid(numtopo); |
1476 |
|
|
if (topo==NULL) topo=geo->get_mg_volumeid(numtopo); |
1477 |
|
|
if (topo==NULL) topo=geo->get_mg_areteid(numtopo); |
1478 |
|
|
if (topo==NULL) topo=geo->get_mg_sommetid(numtopo); |
1479 |
|
|
} |
1480 |
francois |
697 |
MG_TABLE tab; |
1481 |
|
|
if (bnoeud) |
1482 |
|
|
{ |
1483 |
francois |
698 |
app.affiche((char*)" Création de la table aux noeuds"); |
1484 |
francois |
697 |
char nomout[500]; |
1485 |
|
|
sprintf(nomout,"%s_noeud.csv",out); |
1486 |
francois |
698 |
tab.info_noeud(fem,nomout,topo); |
1487 |
francois |
697 |
} |
1488 |
|
|
if (belement1) |
1489 |
|
|
{ |
1490 |
francois |
698 |
app.affiche((char*)" Création de la table aux elements 1D"); |
1491 |
francois |
697 |
char nomout[500]; |
1492 |
|
|
sprintf(nomout,"%s_element1.csv",out); |
1493 |
francois |
698 |
tab.info_element1(fem,nomout,topo); |
1494 |
francois |
697 |
} |
1495 |
|
|
if (belement2) |
1496 |
|
|
{ |
1497 |
francois |
698 |
app.affiche((char*)" Création de la table aux elements 2D"); |
1498 |
francois |
697 |
char nomout[500]; |
1499 |
|
|
sprintf(nomout,"%s_element2.csv",out); |
1500 |
francois |
698 |
tab.info_element2(fem,nomout,topo); |
1501 |
francois |
697 |
} |
1502 |
|
|
if (belement3) |
1503 |
|
|
{ |
1504 |
francois |
698 |
app.affiche((char*)" Création de la table aux elements 3D"); |
1505 |
francois |
697 |
char nomout[500]; |
1506 |
|
|
sprintf(nomout,"%s_element3.csv",out); |
1507 |
francois |
698 |
tab.info_element3(fem,nomout,topo); |
1508 |
francois |
697 |
} |
1509 |
francois |
757 |
if (bgelement1) |
1510 |
|
|
{ |
1511 |
|
|
app.affiche((char*)" Création de la table aux point de gauss des elements 1D"); |
1512 |
|
|
char nomout[500]; |
1513 |
|
|
sprintf(nomout,"%s_elementgauss1.csv",out); |
1514 |
|
|
tab.info_element_gauss1(fem,nomout,topo); |
1515 |
|
|
} |
1516 |
|
|
if (bgelement2) |
1517 |
|
|
{ |
1518 |
|
|
app.affiche((char*)" Création de la table aux point de gauss des elements 2D"); |
1519 |
|
|
char nomout[500]; |
1520 |
|
|
sprintf(nomout,"%s_elementgauss2.csv",out); |
1521 |
|
|
tab.info_element_gauss2(fem,nomout,topo); |
1522 |
|
|
} |
1523 |
|
|
if (bgelement3) |
1524 |
|
|
{ |
1525 |
|
|
app.affiche((char*)" Création de la table aux point de gauss des elements 3D"); |
1526 |
|
|
char nomout[500]; |
1527 |
|
|
sprintf(nomout,"%s_elementgauss3.csv",out); |
1528 |
|
|
tab.info_element_gauss3(fem,nomout,topo); |
1529 |
|
|
} |
1530 |
francois |
697 |
} |
1531 |
francois |
702 |
if (app.get_action()==82) |
1532 |
|
|
{ |
1533 |
|
|
int numgeo; |
1534 |
|
|
char out[500]; |
1535 |
|
|
char in[500]; |
1536 |
|
|
char fgmsh[500]; |
1537 |
|
|
app.recupere_parametre_string_avec_defaut(1,in,(char*)""); |
1538 |
|
|
if (strcmp(in,"")==0) |
1539 |
|
|
app.recupere_parametre_string(5,out,(char*)"Fichier sortant manquant"); |
1540 |
|
|
else |
1541 |
|
|
app.recupere_parametre_string_avec_defaut(5,out,in); |
1542 |
|
|
app.recupere_parametre_int_avec_defaut(31,numgeo,0); |
1543 |
|
|
app.recupere_parametre_string(83,fgmsh,(char*)"Fichier GMSH manquant"); |
1544 |
|
|
if (app.get_erreur()==true) return 0; |
1545 |
|
|
char mess[2000]; |
1546 |
|
|
sprintf(mess,"Importation d'un maillage GMSH"); |
1547 |
|
|
app.affiche(mess); |
1548 |
|
|
MG_GESTIONNAIRE *gest; |
1549 |
|
|
if (strcmp(in,"")==0) gest=new MG_GESTIONNAIRE; else gest=new MG_FILE(in); |
1550 |
|
|
MG_GEOMETRIE *geo; |
1551 |
|
|
if ((numgeo!=0) && (gest->get_nb_mg_geometrie()>0)) geo=gest->get_mg_geometrieid(numgeo); |
1552 |
|
|
MG_IMPORT imp; |
1553 |
|
|
imp.maillage_gmsh(gest,fgmsh,geo); |
1554 |
|
|
sprintf(mess,"Enregistrement du fichier"); |
1555 |
|
|
app.affiche(mess); |
1556 |
|
|
gest->enregistrer(out); |
1557 |
|
|
delete gest; |
1558 |
|
|
} |
1559 |
francois |
712 |
if (app.get_action()==86) |
1560 |
|
|
{ |
1561 |
|
|
int numgeo; |
1562 |
|
|
char chemin[1000]; |
1563 |
|
|
app.recupere_parametre_int_avec_defaut(31,numgeo,0); |
1564 |
|
|
app.recupere_parametre_string(87,chemin,(char*)"Fichier de fonction manquant"); |
1565 |
|
|
if (app.get_erreur()==true) return 0; |
1566 |
|
|
char mess[2000]; |
1567 |
|
|
sprintf(mess,"Importation d'une fonction geometrique"); |
1568 |
|
|
app.affiche(mess); |
1569 |
|
|
sprintf(mess,"\nLecture du fichier MAGiC"); |
1570 |
|
|
app.affiche(mess); |
1571 |
|
|
MG_FILE gest(nomfichier); |
1572 |
|
|
MG_GEOMETRIE *geo; |
1573 |
|
|
if (numgeo==0) geo=gest.get_mg_geometrie(numgeo); else geo=gest.get_mg_geometrieid(numgeo); |
1574 |
|
|
sprintf(mess,"Importation de la courbe"); |
1575 |
|
|
app.affiche(mess); |
1576 |
|
|
MG_GEOM_FONCTION *gf=new MG_GEOM_FONCTION(chemin); |
1577 |
|
|
geo->ajouter_mg_geom_fonction(gf); |
1578 |
|
|
gest.enregistrer(nomfichier); |
1579 |
|
|
} |
1580 |
francois |
432 |
char mess[255]; |
1581 |
|
|
sprintf(mess,"Fin"); |
1582 |
|
|
app.affiche(mess); |
1583 |
|
|
} |
1584 |
|
|
|
1585 |
|
|
|
1586 |
|
|
|
1587 |
|
|
|
1588 |
|
|
|
1589 |
|
|
|
1590 |
|
|
|
1591 |
|
|
|
1592 |
|
|
|
1593 |
|
|
|
1594 |
|
|
|
1595 |
|
|
|
1596 |
|
|
|
1597 |
|
|
|
1598 |
|
|
|