masonry.html 15.7 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>Masonry &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
39
40
41
42
43
44
45
    <link rel="next" title="Mesh" href="mesh.html" />
    <link rel="prev" title="Granular material" href="granular.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>
        <li class="right" >
          <a href="mesh.html" title="Mesh"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="granular.html" title="Granular material"
             accesskey="P">previous</a> |</li>
mozul's avatar
mozul committed
46
        <li><a href="index.html">pylmgc90.pre 2015.2 documentation</a> &raquo;</li> 
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
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <span class="target" id="module-pylmgc90.pre_lmgc"></span><div class="section" id="masonry">
<h1>Masonry<a class="headerlink" href="#masonry" title="Permalink to this headline"></a></h1>
<p>This section details the pre-processing functions dedicated to masonry structures.
Here are provided two types of function, those generating bricks, and those using
the bricks to generate a wall. After that is up to the user to put together the
walls so that they fit.</p>
<div class="section" id="brick-generation">
<h2>Brick generation<a class="headerlink" href="#brick-generation" title="Permalink to this headline"></a></h2>
<p>Two classes have been designed for brick creation: <a class="reference internal" href="classes.html#pylmgc90.pre_lmgc.brick2D" title="pylmgc90.pre_lmgc.brick2D"><tt class="xref py py-class docutils literal"><span class="pre">brick2D</span></tt></a>, and <a class="reference internal" href="classes.html#pylmgc90.pre_lmgc.brick3D" title="pylmgc90.pre_lmgc.brick3D"><tt class="xref py py-class docutils literal"><span class="pre">brick3D</span></tt></a>.
The only inputs for these class are a name and the sizes of the brick.
But the brick object is not an avatar yet, it merely defined its geometry.
To obtain usable avatar(s), one of the three following methods is to be used for 2D bricks:</p>
<ul class="simple">
<li>for a rigid avatar: <a class="reference internal" href="classes.html#pylmgc90.pre_lmgc.brick2D.rigidBrick" title="pylmgc90.pre_lmgc.brick2D.rigidBrick"><tt class="xref py py-class docutils literal"><span class="pre">brick2D.rigidBrick</span></tt></a></li>
<li>for a deformable avatar: <a class="reference internal" href="classes.html#pylmgc90.pre_lmgc.brick2D.deformableBrick" title="pylmgc90.pre_lmgc.brick2D.deformableBrick"><tt class="xref py py-class docutils literal"><span class="pre">brick2D.deformableBrick</span></tt></a></li>
<li>for a deformable avatars (each element being on) <a class="reference internal" href="classes.html#pylmgc90.pre_lmgc.brick2D.explodedDeformableBrick" title="pylmgc90.pre_lmgc.brick2D.explodedDeformableBrick"><tt class="xref py py-class docutils literal"><span class="pre">brick2D.explodedDeformableBrick</span></tt></a></li>
</ul>
<p>Concerning the obtained deformable avatars, each brick has <tt class="docutils literal"><span class="pre">CLxxx</span></tt> contactors on the
lower and right sides and <tt class="docutils literal"><span class="pre">ALpxx</span></tt> on the upper and left sides.</p>
<p>To obtain 3D rigids either the <a class="reference internal" href="classes.html#pylmgc90.pre_lmgc.brick3D.rigidBrick" title="pylmgc90.pre_lmgc.brick3D.rigidBrick"><tt class="xref py py-class docutils literal"><span class="pre">brick3D.rigidBrick</span></tt></a> method is available in 3D
bricks, or the  <a class="reference internal" href="miscellaneous.html#extrusions"><em>extrusion functions</em></a> can be used on the avatar(s)
generated with the 2D bricks.</p>
<p><strong>Example:</strong></p>
<p>Creation of 2D brick:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">dim</span> <span class="o">=</span> <span class="mi">2</span>

<span class="n">lx</span> <span class="o">=</span> <span class="mf">0.1</span>
<span class="n">ly</span> <span class="o">=</span> <span class="mf">0.05</span>
<span class="n">brick</span> <span class="o">=</span> <span class="n">brick2D</span><span class="p">(</span><span class="s">&#39;std_brick&#39;</span><span class="p">,</span> <span class="n">lx</span><span class="p">,</span> <span class="n">ly</span><span class="p">)</span>
</pre></div>
</div>
<a class="reference internal image-reference" href="_images/row.png"><img alt="a row of 12 2D bricks" class="align-right" src="_images/row.png" style="height: 150px;" /></a>
<p>Creation of a row of rigid bricks:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">nb_bricks</span> <span class="o">=</span> <span class="mi">12</span>
<span class="n">bodies</span> <span class="o">=</span> <span class="n">avatars</span><span class="p">()</span>
<span class="n">mat</span> <span class="o">=</span> <span class="n">material</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="s">&#39;PLEXx&#39;</span><span class="p">,</span><span class="nb">type</span><span class="o">=</span><span class="s">&#39;RIGID&#39;</span><span class="p">,</span><span class="n">density</span><span class="o">=</span><span class="mf">2000.</span><span class="p">)</span>
<span class="n">mod</span> <span class="o">=</span> <span class="n">model</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="s">&#39;rigid&#39;</span><span class="p">,</span> <span class="nb">type</span><span class="o">=</span><span class="s">&#39;MECAx&#39;</span><span class="p">,</span> <span class="n">element</span><span class="o">=</span><span class="s">&#39;Rxx2D&#39;</span><span class="p">,</span> <span class="n">dimension</span><span class="o">=</span><span class="n">dim</span><span class="p">)</span>

<span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">xrange</span><span class="p">(</span><span class="n">nb_bricks</span><span class="p">):</span>
  <span class="n">bodies</span> <span class="o">+=</span> <span class="n">brick</span><span class="o">.</span><span class="n">rigidBrick</span><span class="p">(</span><span class="n">center</span><span class="o">=</span><span class="p">[</span><span class="n">i</span><span class="o">*</span><span class="n">lx</span><span class="p">,</span> <span class="n">ly</span><span class="o">/</span><span class="mf">2.</span><span class="p">],</span> <span class="n">model</span><span class="o">=</span><span class="n">mod</span><span class="p">,</span> <span class="n">material</span><span class="o">=</span><span class="n">mat</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="s">&#39;BLUEx&#39;</span><span class="p">)</span>
</pre></div>
</div>
</div>
<div class="section" id="wall-generation">
<h2>Wall generation<a class="headerlink" href="#wall-generation" title="Permalink to this headline"></a></h2>
<p>The <a class="reference internal" href="classes.html#pylmgc90.pre_lmgc.paneresse_simple" title="pylmgc90.pre_lmgc.paneresse_simple"><tt class="xref py py-class docutils literal"><span class="pre">paneresse_simple</span></tt></a> and <a class="reference internal" href="classes.html#pylmgc90.pre_lmgc.paneresse_double" title="pylmgc90.pre_lmgc.paneresse_double"><tt class="xref py py-class docutils literal"><span class="pre">paneresse_double</span></tt></a> classes
allow to automatically generate  simple walls without openings with regular
rigid bricks. The appealing side of these classes is that all the troubles
due to the &#8220;harpage&#8221; is taken care of automatically. The only things left
is to write the visibility tables.</p>
<p>Otherwise the governing idea of wall generation is to defined several brick
objects.  Make a list of bricks to make a row and a list of rows to make a
wall. Then using nested loops build the avatars defining the wall in a similar
way than in previous example.</p>
<p><strong>Example:</strong></p>
<a class="reference internal image-reference" href="_images/wall.png"><img alt="a &quot;paneresse simple&quot; wall" class="align-right" src="_images/wall.png" style="height: 150px;" /></a>
<p>Generation of a 3D wall of rigid bricks in &#8220;paneresse simple&#8221; configuration:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">dim</span> <span class="o">=</span> <span class="mi">3</span>
<span class="n">mat</span> <span class="o">=</span> <span class="n">material</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="s">&#39;PLEXx&#39;</span><span class="p">,</span><span class="nb">type</span><span class="o">=</span><span class="s">&#39;RIGID&#39;</span><span class="p">,</span><span class="n">density</span><span class="o">=</span><span class="mf">2000.</span><span class="p">)</span>
<span class="n">mod</span> <span class="o">=</span> <span class="n">model</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="s">&#39;rigid&#39;</span><span class="p">,</span> <span class="nb">type</span><span class="o">=</span><span class="s">&#39;MECAx&#39;</span><span class="p">,</span> <span class="n">element</span><span class="o">=</span><span class="s">&#39;Rxx3D&#39;</span><span class="p">,</span> <span class="n">dimension</span><span class="o">=</span><span class="n">dim</span><span class="p">)</span>

<span class="n">simple_brick</span> <span class="o">=</span> <span class="n">brick3D</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="s">&#39;brique simple&#39;</span><span class="p">,</span> <span class="n">lx</span><span class="o">=</span><span class="mf">0.22</span><span class="p">,</span> <span class="n">ly</span><span class="o">=</span><span class="mf">0.11</span><span class="p">,</span> <span class="n">lz</span><span class="o">=</span><span class="mf">0.06</span><span class="p">)</span>
<span class="n">wall</span>   <span class="o">=</span> <span class="n">paneresse_simple</span><span class="p">(</span><span class="n">brick_ref</span><span class="o">=</span><span class="n">simple_brick</span><span class="p">,</span> <span class="n">disposition</span><span class="o">=</span><span class="s">&quot;paneresse&quot;</span><span class="p">)</span>

<span class="n">wall</span><span class="o">.</span><span class="n">setFirstRowByLength</span><span class="p">(</span><span class="n">first_brick_type</span><span class="o">=</span><span class="s">&quot;1/2&quot;</span><span class="p">,</span> <span class="n">length</span><span class="o">=</span><span class="mf">2.3</span><span class="p">,</span> <span class="n">joint_thickness</span><span class="o">=</span><span class="mf">0.01</span><span class="p">)</span>
<span class="n">wall</span><span class="o">.</span><span class="n">setNumberOfRows</span><span class="p">(</span><span class="mf">10.</span><span class="p">)</span>
<span class="n">wall</span><span class="o">.</span><span class="n">setJointThicknessBetweenRows</span><span class="p">(</span><span class="mf">0.01</span><span class="p">)</span>
<span class="n">wall</span><span class="o">.</span><span class="n">computeHeight</span><span class="p">()</span>

<span class="n">bodies</span> <span class="o">=</span> <span class="n">wall</span><span class="o">.</span><span class="n">buildRigidWall</span><span class="p">(</span><span class="n">origin</span><span class="o">=</span><span class="p">[</span><span class="mf">0.</span><span class="p">,</span> <span class="mf">0.</span><span class="p">,</span> <span class="mf">0.</span><span class="p">],</span> <span class="n">model</span><span class="o">=</span><span class="n">mod</span><span class="p">,</span> <span class="n">material</span><span class="o">=</span><span class="n">mat</span><span class="p">,</span> <span class="n">colors</span><span class="o">=</span><span class="p">[</span><span class="s">&#39;BLUEx&#39;</span><span class="p">,</span> <span class="s">&#39;REDxx&#39;</span><span class="p">])</span>
</pre></div>
</div>
<p>For the generation of 2D wall or rigid bricks with different bricks and opening,
see <a class="reference download internal" href="_downloads/masonry.py"><tt class="xref download docutils literal"><span class="pre">this</span></tt></a> complete example.</p>
<a class="reference internal image-reference" href="_images/masonry.png"><img alt="a wall with openings" class="align-center" src="_images/masonry.png" style="height: 150px;" /></a>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
  <h3><a href="index.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">Masonry</a><ul>
<li><a class="reference internal" href="#brick-generation">Brick generation</a></li>
<li><a class="reference internal" href="#wall-generation">Wall generation</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="granular.html"
                        title="previous chapter">Granular material</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="mesh.html"
                        title="next chapter">Mesh</a></p>
  <h3>This Page</h3>
  <ul class="this-page-menu">
    <li><a href="_sources/masonry.txt"
           rel="nofollow">Show Source</a></li>
  </ul>
<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>
        <li class="right" >
          <a href="mesh.html" title="Mesh"
             >next</a> |</li>
        <li class="right" >
          <a href="granular.html" title="Granular material"
             >previous</a> |</li>
mozul's avatar
mozul committed
191
        <li><a href="index.html">pylmgc90.pre 2015.2 documentation</a> &raquo;</li> 
192
193
194
      </ul>
    </div>
    <div class="footer">
mozul's avatar
mozul committed
195
        &copy; Copyright 2015, CNRS.
196
197
198
199
      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
    </div>
  </body>
</html>