<h2>Generic spherical distributions:<a class="headerlink" href="#generic-spherical-distributions" title="Permalink to this headline">¶</a></h2>
<p>In spherical cases, its possible to generate any mass profile, using a
generic function (<a class="reference internal" href="IcModule.html#pNbody.ic.generic_Mr" title="pNbody.ic.generic_Mr"><tt class="xref py py-func docutils literal"><span class="pre">generic_Mr()</span></tt></a>). The function takes as argument a vector that
defines the cumulative mass as a function of the radius:</p>
</div><p>As before, we use the function <a class="reference internal" href="IcModule.html#pNbody.ic.generic_Mr" title="pNbody.ic.generic_Mr"><tt class="xref py py-func docutils literal"><span class="pre">generic_Mr()</span></tt></a>:</p>
<h2>Generic cubic distributions:<a class="headerlink" href="#generic-cubic-distributions" title="Permalink to this headline">¶</a></h2>
<p>Its possible generate a cubic box with the density varying along one axix. This is obtained
by using the <a class="reference internal" href="IcModule.html#pNbody.ic.generic_Mx" title="pNbody.ic.generic_Mx"><tt class="xref py py-func docutils literal"><span class="pre">generic_Mx()</span></tt></a> function. As for <a class="reference internal" href="IcModule.html#pNbody.ic.generic_Mr" title="pNbody.ic.generic_Mr"><tt class="xref py py-func docutils literal"><span class="pre">generic_Mr()</span></tt></a>, we have to define
the variation of the cumulative mass, in this case, the x axis. In the following example,
we set a two level transition along the x axis, following the function:</p>
<h2>Spherical distribution with variable resolution:<a class="headerlink" href="#spherical-distribution-with-variable-resolution" title="Permalink to this headline">¶</a></h2>
<p>In some circumstances, it may be insterested to generate a profile, with
a variable resolution. In all previous examples, the mass of the particles where
identical. Here, we show a case where the mass of the particles varies with the radius.
This allows to increase the number of particles in the central regrions, where resolution
is needed, and to decrease it in the outer regions.</p>