<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://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/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.15"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>dfnTrans: Docs_PT/ParticleTracking_source/InitialPartPositions.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  $(document).ready(initResizable);
/* @license-end */</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link rel="search" href="search_opensearch.php?v=opensearch.xml" type="application/opensearchdescription+xml" title="dfnTrans"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">dfnTrans
   </div>
   <div id="projectbrief">Code for Particle Tracking simulations in 3D DFN</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.15 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,true,'search.php','Search');
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  $(document).ready(function() {
    if ($('.searchresults').length > 0) { searchBox.DOMSearchField().focus(); }
  });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('_initial_part_positions_8c.html','');});
/* @license-end */
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">InitialPartPositions.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &lt;stdio.h&gt;</code><br />
<code>#include &lt;search.h&gt;</code><br />
<code>#include &lt;stdlib.h&gt;</code><br />
<code>#include &lt;math.h&gt;</code><br />
<code>#include &lt;string.h&gt;</code><br />
<code>#include &quot;<a class="el" href="_func_def_8h_source.html">FuncDef.h</a>&quot;</code><br />
<code>#include &lt;unistd.h&gt;</code><br />
<code>#include &lt;time.h&gt;</code><br />
</div>
<p><a href="_initial_part_positions_8c_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structinpfile.html">inpfile</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structposit3d.html">posit3d</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ae2df2bd90c8d4aa96e508002a36327c9"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_initial_part_positions_8c.html#ae2df2bd90c8d4aa96e508002a36327c9">InitPos</a> ()</td></tr>
<tr class="separator:ae2df2bd90c8d4aa96e508002a36327c9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a461479d92dd1f67c7ef94fa953186860"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_initial_part_positions_8c.html#a461479d92dd1f67c7ef94fa953186860">InitCell</a> ()</td></tr>
<tr class="separator:a461479d92dd1f67c7ef94fa953186860"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a30b78ca10a78d9e5d6de6d5831a5557a"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_initial_part_positions_8c.html#a30b78ca10a78d9e5d6de6d5831a5557a">InitParticles_np</a> (int k_current, int firstnd, int lastnd, int parts_fracture, int first_ind, int last_ind)</td></tr>
<tr class="separator:a30b78ca10a78d9e5d6de6d5831a5557a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a01e7bd2a5bd9417f1d28849b8577b0b9"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_initial_part_positions_8c.html#a01e7bd2a5bd9417f1d28849b8577b0b9">InitParticles_eq</a> (int k_current, int firstn, int lastn, double parts_dist, int first_ind, int last_ind)</td></tr>
<tr class="separator:a01e7bd2a5bd9417f1d28849b8577b0b9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2e978219b990b7dfb64b4f9d567054db"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_initial_part_positions_8c.html#a2e978219b990b7dfb64b4f9d567054db">InitParticles_ones</a> (int k_current, double inter_p[][4], int fracture_n, int parts_fracture, int ii, double thirdcoor, int zonenumb_in, int first_ind, int last_ind)</td></tr>
<tr class="separator:a2e978219b990b7dfb64b4f9d567054db"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a59d54f4d5c97e70b0f25e32de87ee3da"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_initial_part_positions_8c.html#a59d54f4d5c97e70b0f25e32de87ee3da">FlowInWeight</a> (int numberpart)</td></tr>
<tr class="separator:a59d54f4d5c97e70b0f25e32de87ee3da"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0355cfa365c20964163da103eec2f0e5"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_initial_part_positions_8c.html#a0355cfa365c20964163da103eec2f0e5">InitInMatrix</a> ()</td></tr>
<tr class="separator:a0355cfa365c20964163da103eec2f0e5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0610d22ad530758b4de42acd23a5df92"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_initial_part_positions_8c.html#a0610d22ad530758b4de42acd23a5df92">TimeFromMatrix</a> (double pdist)</td></tr>
<tr class="separator:a0610d22ad530758b4de42acd23a5df92"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad3b7970929b5c9502172afc4e0bc65e8"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_initial_part_positions_8c.html#ad3b7970929b5c9502172afc4e0bc65e8">InitParticles_flux</a> (int k_current, int first_ind, int last_ind, double weight_p)</td></tr>
<tr class="separator:ad3b7970929b5c9502172afc4e0bc65e8"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a id="a59d54f4d5c97e70b0f25e32de87ee3da"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a59d54f4d5c97e70b0f25e32de87ee3da">&#9670;&nbsp;</a></span>FlowInWeight()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void FlowInWeight </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>numberpart</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Function calculates particle's in-flow flux weight. Used in option #1, #2, #3. </p>

<p class="definition">Definition at line <a class="el" href="_initial_part_positions_8c_source.html#l00861">861</a> of file <a class="el" href="_initial_part_positions_8c_source.html">InitialPartPositions.c</a>.</p>

</div>
</div>
<a id="a461479d92dd1f67c7ef94fa953186860"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a461479d92dd1f67c7ef94fa953186860">&#9670;&nbsp;</a></span>InitCell()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int InitCell </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Function performs a search to find cell Id where the particle was initially placed. </p>

<p class="definition">Definition at line <a class="el" href="_initial_part_positions_8c_source.html#l00621">621</a> of file <a class="el" href="_initial_part_positions_8c_source.html">InitialPartPositions.c</a>.</p>

</div>
</div>
<a id="a0355cfa365c20964163da103eec2f0e5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0355cfa365c20964163da103eec2f0e5">&#9670;&nbsp;</a></span>InitInMatrix()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void InitInMatrix </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Function performs data reading from files for Option #5, init_matrix. In this option particles are placed at random positions in matrix, the time to move from initial position to nearest fracture is calculated in function TimeFromMatrix.</p>
<p>Input files ParticleInitCoordR.dat and ClosestNodeR.inp provide particles initial positions at matrix and te closes node ID at DFN mesh, respectively. </p>

<p class="definition">Definition at line <a class="el" href="_initial_part_positions_8c_source.html#l00968">968</a> of file <a class="el" href="_initial_part_positions_8c_source.html">InitialPartPositions.c</a>.</p>

</div>
</div>
<a id="a01e7bd2a5bd9417f1d28849b8577b0b9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a01e7bd2a5bd9417f1d28849b8577b0b9">&#9670;&nbsp;</a></span>InitParticles_eq()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int InitParticles_eq </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>k_current</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>firstn</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>lastn</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>parts_dist</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>first_ind</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>last_ind</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Function defines particles initial positions at a single fracture edge, using calculated before distance between particles. Option #2, init_eqd. </p>

<p class="definition">Definition at line <a class="el" href="_initial_part_positions_8c_source.html#l00711">711</a> of file <a class="el" href="_initial_part_positions_8c_source.html">InitialPartPositions.c</a>.</p>

</div>
</div>
<a id="ad3b7970929b5c9502172afc4e0bc65e8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad3b7970929b5c9502172afc4e0bc65e8">&#9670;&nbsp;</a></span>InitParticles_flux()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int InitParticles_flux </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>k_current</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>first_ind</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>last_ind</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>weight_p</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Function defines particle's initial positions at single fracture edge in Option #6. Particles are placed according to input flux weights. In this case, all the particles have the same flux weight, but number of particles per fracture edge depends on in-flow flux of this fracture. </p>

<p class="definition">Definition at line <a class="el" href="_initial_part_positions_8c_source.html#l01095">1095</a> of file <a class="el" href="_initial_part_positions_8c_source.html">InitialPartPositions.c</a>.</p>

</div>
</div>
<a id="a30b78ca10a78d9e5d6de6d5831a5557a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a30b78ca10a78d9e5d6de6d5831a5557a">&#9670;&nbsp;</a></span>InitParticles_np()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int InitParticles_np </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>k_current</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>firstnd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>lastnd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>parts_fracture</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>first_ind</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>last_ind</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Function defines particle's initial positions on a single fracture edge. Option #1, init_nf </p>

<p class="definition">Definition at line <a class="el" href="_initial_part_positions_8c_source.html#l00660">660</a> of file <a class="el" href="_initial_part_positions_8c_source.html">InitialPartPositions.c</a>.</p>

</div>
</div>
<a id="a2e978219b990b7dfb64b4f9d567054db"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2e978219b990b7dfb64b4f9d567054db">&#9670;&nbsp;</a></span>InitParticles_ones()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int InitParticles_ones </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>k_current</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>inter_p</em>[][4], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>fracture_n</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>parts_fracture</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>ii</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>thirdcoor</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>zonenumb_in</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>first_ind</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>last_ind</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Function defines particles initial positions in option #3, where user defines region at in-flow boundary face for particles. </p>

<p class="definition">Definition at line <a class="el" href="_initial_part_positions_8c_source.html#l00764">764</a> of file <a class="el" href="_initial_part_positions_8c_source.html">InitialPartPositions.c</a>.</p>

</div>
</div>
<a id="ae2df2bd90c8d4aa96e508002a36327c9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae2df2bd90c8d4aa96e508002a36327c9">&#9670;&nbsp;</a></span>InitPos()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int InitPos </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Function defines the required option of particles initial positions defined at input control file; calculates number of particles, allocates memory. </p>
<p>First option init_nf: equal number of particles on every boundary edge regardless of edge length</p>
<p>Second option init_eqd: calculate total length of boundary edges; define the distance between particles and place particles equidistant from each other on all edges</p>
<p>Third option init_oneregion: user specifies a region and all particles start from the fracture edges that located inside the region</p>
<p>Fourth option init_random: particles will be set randomly over all fractures surfaces; in this case the particles are weighted acoording to the aperture</p>
<p>5th option init_matrix: particles are set randomly in rock matrix, their time from initial positions is calculated, then particles move through fractures to out-flow boundary. This option requires preprocessing; the script RandomPositGener.py will provide necessary input files</p>
<p>Sixth option init_flux: place particles according to input fluxes. Each particle has the same flux weight. The number of particles are placed propportionally to inflow flux on each cell and fracture edge. </p>

<p class="definition">Definition at line <a class="el" href="_initial_part_positions_8c_source.html#l00021">21</a> of file <a class="el" href="_initial_part_positions_8c_source.html">InitialPartPositions.c</a>.</p>

</div>
</div>
<a id="a0610d22ad530758b4de42acd23a5df92"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0610d22ad530758b4de42acd23a5df92">&#9670;&nbsp;</a></span>TimeFromMatrix()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">double TimeFromMatrix </td>
          <td>(</td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>pdist</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Option #5. Estimation of travel time of particles moving from matrix to the closest fracture. </p>

<p class="definition">Definition at line <a class="el" href="_initial_part_positions_8c_source.html#l01062">1062</a> of file <a class="el" href="_initial_part_positions_8c_source.html">InitialPartPositions.c</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_f80ddb2df819b297fd9c7beccba09984.html">Docs_PT</a></li><li class="navelem"><a class="el" href="dir_966eb28a5fc4cd2ac9e3086fcb212f97.html">ParticleTracking_source</a></li><li class="navelem"><a class="el" href="_initial_part_positions_8c.html">InitialPartPositions.c</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.15 </li>
  </ul>
</div>
</body>
</html>
