pre_lmgc.html 14.3 KB
Newer Older
1
2
3
4
5
6
7
8
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
mozul's avatar
mozul committed
9
    <title>pylmgc90.pre_lmgc &mdash; pylmgc90.pre 2015.2 documentation</title>
10
11
12
13
14
15
16
    
    <link rel="stylesheet" href="../../_static/default.css" type="text/css" />
    <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../../',
mozul's avatar
mozul committed
17
        VERSION:     '2015.2',
18
19
20
21
22
23
24
25
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../../_static/jquery.js"></script>
    <script type="text/javascript" src="../../_static/underscore.js"></script>
    <script type="text/javascript" src="../../_static/doctools.js"></script>
mozul's avatar
mozul committed
26
    <link rel="top" title="pylmgc90.pre 2015.2 documentation" href="../../index.html" />
27
28
29
30
31
32
33
34
35
36
37
38
    <link rel="up" title="Module code" href="../index.html" /> 
  </head>
  <body>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
mozul's avatar
mozul committed
39
        <li><a href="../../index.html">pylmgc90.pre 2015.2 documentation</a> &raquo;</li>
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
          <li><a href="../index.html" accesskey="U">Module code</a> &raquo;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <h1>Source code for pylmgc90.pre_lmgc</h1><div class="highlight"><pre>
<span class="c"># import du module permettant de savoir si on pourra importer les pre_tools</span>
<span class="kn">from</span> <span class="nn">utilities.check_compiled_modules</span> <span class="kn">import</span> <span class="o">*</span>

<span class="c"># import des maps permettant de verifier la coherence des donnees</span>
<span class="kn">from</span> <span class="nn">config.lmgc90dicts</span> <span class="kn">import</span> <span class="o">*</span>

<span class="c"># import de l&#39;objet tact_behav (i.e. definissant les parametres d&#39;une loi de contact)</span>
<span class="kn">from</span> <span class="nn">shared.tact_behav</span> <span class="kn">import</span> <span class="o">*</span>
<span class="c"># import de l&#39;objet bulk_behav (i.e. definissant les parametres materiau)</span>
<span class="kn">from</span> <span class="nn">shared.bulk_behav</span> <span class="kn">import</span> <span class="o">*</span>
<span class="c"># import de l&#39;objet postpro_command (i.e. definissant une commande de post-traitement) </span>
<span class="kn">from</span> <span class="nn">shared.postpro_command</span> <span class="kn">import</span> <span class="o">*</span>
<span class="c"># import de l&#39;objet model (i.e. definissant un modele, mecanique ou thermique)</span>
<span class="kn">from</span> <span class="nn">shared.model</span> <span class="kn">import</span> <span class="o">*</span>

<span class="c"># import des conteneneurs</span>
<span class="c">#   * d&#39;avatars</span>
<span class="kn">from</span> <span class="nn">avatars</span> <span class="kn">import</span> <span class="o">*</span>
<span class="c">#   * de modeles</span>
<span class="kn">from</span> <span class="nn">models</span> <span class="kn">import</span> <span class="o">*</span>
<span class="c">#   * de materiaux</span>
<span class="kn">from</span> <span class="nn">bulk_behavs</span> <span class="kn">import</span> <span class="o">*</span>
<span class="c">#   * de loi de contact</span>
<span class="kn">from</span> <span class="nn">tact_behavs</span> <span class="kn">import</span> <span class="o">*</span>
<span class="c">#   * de commandes de post-traitement</span>
<span class="kn">from</span> <span class="nn">postpro_commands</span> <span class="kn">import</span> <span class="o">*</span>

<span class="c"># import des differents modules de build_avatar</span>
<span class="c">#   * module de creation de briques 2D, ou 3D</span>
<span class="kn">from</span> <span class="nn">build_avatar.brick</span> <span class="kn">import</span> <span class="o">*</span>
<span class="c">#   * module de creation de rangees de briques 3D</span>
<span class="kn">from</span> <span class="nn">build_avatar.brick_row</span> <span class="kn">import</span> <span class="o">*</span>
<span class="c">#   * module de creation de rangees de mur de briques 3D</span>
<span class="kn">from</span> <span class="nn">build_avatar.brick_wall</span> <span class="kn">import</span> <span class="o">*</span>
<span class="c">#   * module d&#39;extrusion de corps rigides 2D, pour obtenir des corps rigides 3D</span>
<span class="kn">from</span> <span class="nn">build_avatar.extrusion</span> <span class="kn">import</span> <span class="o">*</span>
<span class="c">#   * module de gestion de maillage generique (2D/3D)</span>
<span class="kn">from</span> <span class="nn">build_avatar.mesh</span> <span class="kn">import</span> <span class="o">*</span>
<span class="c">#   * module de gestion de maillage 2D</span>
<span class="kn">from</span> <span class="nn">build_avatar.mesh2D</span> <span class="kn">import</span> <span class="o">*</span>
<span class="c">#   * module de gestion de maillage 3D</span>
<span class="kn">from</span> <span class="nn">build_avatar.mesh3D</span> <span class="kn">import</span> <span class="o">*</span>
<span class="c">##   * module de lecture de maillages</span>
<span class="kn">from</span> <span class="nn">build_avatar.lecture</span> <span class="kn">import</span> <span class="o">*</span>
<span class="c">#   * module de creation de particules 2D, ou 3D</span>
<span class="kn">from</span> <span class="nn">build_avatar.particles</span> <span class="kn">import</span> <span class="o">*</span>

<span class="c"># import des macros fournisant les fonctionnalites des anciens pre-processeurs pour mes milieux granulaires</span>
<span class="kn">from</span> <span class="nn">build_avatar.tools.granulometry</span>  <span class="kn">import</span> <span class="o">*</span>

<span class="c"># si on peut essayer d&#39;importer le module pre_tools sans tout faire planter</span>
<span class="k">if</span> <span class="n">import_lmgc90</span><span class="p">():</span>
   <span class="c"># on essaye</span>
   <span class="k">try</span><span class="p">:</span>
      <span class="k">try</span><span class="p">:</span>
         <span class="c">#   * import des macros de depot de grains</span>
         <span class="c">#       - dans un conteneneur 2D</span>
         <span class="kn">from</span> <span class="nn">build_avatar.tools.containers2D</span> <span class="kn">import</span> <span class="o">*</span>
         <span class="c">#       - dans un conteneneur 3D</span>
         <span class="kn">from</span> <span class="nn">build_avatar.tools.containers3D</span> <span class="kn">import</span> <span class="o">*</span>
         <span class="c"># import du module de creation de parois 2D (reposant sur le module fournissant les fonctions permettant de</span>
         <span class="c"># choisir la granulometrie)</span>
         <span class="kn">from</span> <span class="nn">build_avatar.walls</span> <span class="kn">import</span> <span class="o">*</span>
      <span class="k">except</span> <span class="ne">ImportError</span><span class="p">:</span>
         <span class="k">print</span> <span class="s">&#39;Unable to import wrapped part of the granular media module!&#39;</span>
         <span class="k">print</span> <span class="s">&#39;You cannot use granulometry facilities or deposit grains in a container&#39;</span>
   <span class="k">except</span><span class="p">:</span>
      <span class="k">raise</span> 
<span class="c"># sinon,</span>
<span class="k">else</span><span class="p">:</span>
   <span class="c"># on explique que c&#39;est impossible</span>
   <span class="k">print</span> <span class="s">&#39;Unable to import wrapped part of the granular media module!&#39;</span>
   <span class="k">print</span> <span class="s">&#39;You cannot use granulometry facilities or deposit grains in a container&#39;</span>

<span class="c">#       - sur un reseau 2D</span>
<span class="kn">from</span> <span class="nn">build_avatar.lattices2D</span> <span class="kn">import</span> <span class="o">*</span>
<span class="c">#       - sur un reseau 3D</span>
<span class="kn">from</span> <span class="nn">build_avatar.lattices3D</span> <span class="kn">import</span> <span class="o">*</span>

<span class="k">try</span><span class="p">:</span>
   <span class="kn">from</span> <span class="nn">build_avatar.medpre</span> <span class="kn">import</span> <span class="o">*</span>
<span class="k">except</span> <span class="ne">ImportError</span><span class="p">:</span>
   <span class="k">print</span> <span class="s">&#39;Unable to import med file reading&#39;</span>
<span class="k">except</span><span class="p">:</span>
   <span class="k">raise</span>

<span class="c"># import des fonctions d&#39;ecriture des fichiers decrivant</span>
<span class="c">#   * la geometrie des corps (BODIES.DAT)</span>
<span class="kn">from</span> <span class="nn">files.bodiesFile</span> <span class="kn">import</span> <span class="o">*</span>
<span class="c">#   * les modeles (MODELS.DAT)</span>
<span class="kn">from</span> <span class="nn">files.modelFile</span>     <span class="kn">import</span> <span class="o">*</span>
<span class="c">#   * les parametres materiaux (BULK_BEHAV.DAT)</span>
<span class="kn">from</span> <span class="nn">files.bulkBehavFile</span> <span class="kn">import</span> <span class="o">*</span>
<span class="c">#   * les lois de contat et les tables de visibilite (TACT_BEHAV.DAT)</span>
<span class="kn">from</span> <span class="nn">files.dofIniFile</span>    <span class="kn">import</span> <span class="o">*</span>
<span class="c">#   * les conditions limites (DRV_DOF.DAT)</span>
<span class="kn">from</span> <span class="nn">files.tactBehavFile</span> <span class="kn">import</span> <span class="o">*</span>
<span class="c">#   * les valeurs des ddl iniales (DOF.INI)</span>
<span class="kn">from</span> <span class="nn">files.drvDofFile</span>    <span class="kn">import</span> <span class="o">*</span>
<span class="c">#   * les valeurs aux points de Gauss iniales (GPV.INI)</span>
<span class="kn">from</span> <span class="nn">files.gpvIniFile</span>    <span class="kn">import</span> <span class="o">*</span>
<span class="c">#   * les contacts initiaux (Vloc_Rloc.INI)</span>
<span class="kn">from</span> <span class="nn">files.vlocrlocIniFile</span>    <span class="kn">import</span> <span class="o">*</span>
<span class="c">#   * les fichiers d&#39;evolution, pour les conditions limites</span>
<span class="kn">from</span> <span class="nn">files.evolutionFile</span> <span class="kn">import</span> <span class="o">*</span>
<span class="c">#   * les commandes de post-traitement (POSTPRO.DAT)</span>
<span class="kn">from</span> <span class="nn">files.postproFile</span> <span class="kn">import</span> <span class="o">*</span>

<span class="k">try</span><span class="p">:</span>
  <span class="kn">from</span> <span class="nn">viz.visuVtk</span> <span class="kn">import</span> <span class="o">*</span>
<span class="k">except</span> <span class="ne">ImportError</span><span class="p">:</span>
   <span class="k">print</span> <span class="s">&#39;Unable to import visualization module with vtk&#39;</span>
<span class="k">except</span><span class="p">:</span>
   <span class="k">raise</span> 

<span class="c"># si on peut essayer d&#39;importer le module lmgc90 sans tout faire planter</span>
<span class="k">if</span> <span class="n">import_lmgc90</span><span class="p">():</span>
   <span class="c"># on essaye</span>
   <span class="k">try</span><span class="p">:</span>
      <span class="c"># import melimelo reading/writing</span>
      <span class="kn">from</span> <span class="nn">build_avatar.melimeloLecture</span> <span class="kn">import</span> <span class="o">*</span>
      <span class="kn">from</span> <span class="nn">files.melimeloFile</span> <span class="kn">import</span> <span class="o">*</span>
   <span class="k">except</span> <span class="ne">ImportError</span><span class="p">:</span>
      <span class="k">print</span> <span class="s">&#39;Unable to import melimelo reading/writing functions&#39;</span>
   <span class="k">except</span><span class="p">:</span>
      <span class="k">raise</span> 
<span class="c"># sinon,</span>
<span class="k">else</span><span class="p">:</span>
   <span class="c"># on explique que c&#39;est impossible</span>
   <span class="k">print</span> <span class="s">&#39;Unable to import lmgc90 module for transfert to melimelo!&#39;</span>
   <span class="k">print</span> <span class="s">&#39;You cannot use melimelo&#39;</span>

<span class="c">#__all__=[&#39;pre_lmgc&#39;,&#39;viz&#39;]</span>
</pre></div>

          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="../../search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="../../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
mozul's avatar
mozul committed
216
        <li><a href="../../index.html">pylmgc90.pre 2015.2 documentation</a> &raquo;</li>
217
218
219
220
          <li><a href="../index.html" >Module code</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
mozul's avatar
mozul committed
221
        &copy; Copyright 2015, CNRS.
222
223
224
225
      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
    </div>
  </body>
</html>