1
0
mirror of https://github.com/TREX-CoE/trexio.git synced 2024-12-25 13:53:55 +01:00

Deploying to gh-pages from @ TREX-CoE/trexio@b7dc5fc49f 🚀

This commit is contained in:
q-posev 2021-09-22 11:34:44 +00:00
parent 9c60541b97
commit ae6e5e7878
8 changed files with 15829 additions and 716 deletions

View File

@ -3,7 +3,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head> <head>
<!-- 2021-09-16 Thu 14:47 --> <!-- 2021-09-22 Wed 11:34 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<title>TREXIO source code documentation</title> <title>TREXIO source code documentation</title>
@ -343,7 +343,7 @@ and bug reports should be submitted at
</div> </div>
<div id="postamble" class="status"> <div id="postamble" class="status">
<p class="author">Author: TREX-CoE</p> <p class="author">Author: TREX-CoE</p>
<p class="date">Created: 2021-09-16 Thu 14:47</p> <p class="date">Created: 2021-09-22 Wed 11:34</p>
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p> <p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div> </div>
</body> </body>

View File

@ -3,7 +3,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head> <head>
<!-- 2021-09-16 Thu 14:47 --> <!-- 2021-09-22 Wed 11:34 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<title>&lrm;</title> <title>&lrm;</title>
@ -232,8 +232,8 @@ for the JavaScript code in this tag.
<h2>Table of Contents</h2> <h2>Table of Contents</h2>
<div id="text-table-of-contents"> <div id="text-table-of-contents">
<ul> <ul>
<li><a href="#org39414f4">1. Text back end</a></li> <li><a href="#org3bac473">1. Text back end</a></li>
<li><a href="#orge8df5f1">2. HDF5 Back end</a></li> <li><a href="#orge8cbf73">2. HDF5 Back end</a></li>
</ul> </ul>
</div> </div>
</div> </div>
@ -241,8 +241,8 @@ for the JavaScript code in this tag.
See templator<sub>front.org</sub> See templator<sub>front.org</sub>
</p> </p>
<div id="outline-container-org39414f4" class="outline-2"> <div id="outline-container-org3bac473" class="outline-2">
<h2 id="org39414f4"><span class="section-number-2">1</span> Text back end</h2> <h2 id="org3bac473"><span class="section-number-2">1</span> Text back end</h2>
<div class="outline-text-2" id="text-1"> <div class="outline-text-2" id="text-1">
<p> <p>
As the size of the dataset should be extensible, the simplest As the size of the dataset should be extensible, the simplest
@ -256,8 +256,8 @@ The offset can be used with <code>fseek(69L*offset, SEEK_SET)</code>
</div> </div>
</div> </div>
<div id="outline-container-orge8df5f1" class="outline-2"> <div id="outline-container-orge8cbf73" class="outline-2">
<h2 id="orge8df5f1"><span class="section-number-2">2</span> HDF5 Back end</h2> <h2 id="orge8cbf73"><span class="section-number-2">2</span> HDF5 Back end</h2>
<div class="outline-text-2" id="text-2"> <div class="outline-text-2" id="text-2">
<p> <p>
We need to declare the number of rows of the dataset as We need to declare the number of rows of the dataset as
@ -278,7 +278,7 @@ If the offset+num &gt; nmax, we need to extend the dataset.
</div> </div>
</div> </div>
<div id="postamble" class="status"> <div id="postamble" class="status">
<p class="date">Created: 2021-09-16 Thu 14:47</p> <p class="date">Created: 2021-09-22 Wed 11:34</p>
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p> <p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div> </div>
</body> </body>

View File

@ -3,7 +3,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head> <head>
<!-- 2021-09-16 Thu 14:47 --> <!-- 2021-09-22 Wed 11:34 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<title>TREXIO source code documentation</title> <title>TREXIO source code documentation</title>
@ -343,7 +343,7 @@ and bug reports should be submitted at
</div> </div>
<div id="postamble" class="status"> <div id="postamble" class="status">
<p class="author">Author: TREX-CoE</p> <p class="author">Author: TREX-CoE</p>
<p class="date">Created: 2021-09-16 Thu 14:47</p> <p class="date">Created: 2021-09-22 Wed 11:34</p>
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p> <p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div> </div>
</body> </body>

File diff suppressed because it is too large Load Diff

View File

@ -3,7 +3,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head> <head>
<!-- 2021-09-16 Thu 14:47 --> <!-- 2021-09-22 Wed 11:34 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<title>HDF5 back end</title> <title>HDF5 back end</title>
@ -311,27 +311,27 @@ for the JavaScript code in this tag.
<h2>Table of Contents</h2> <h2>Table of Contents</h2>
<div id="text-table-of-contents"> <div id="text-table-of-contents">
<ul> <ul>
<li><a href="#org26617cc">1. HDF5 back end</a> <li><a href="#org4f96d3c">1. HDF5 back end</a>
<ul> <ul>
<li><a href="#org61e9dc2">1.1. Template for HDF5 definitions</a></li> <li><a href="#org935b3d3">1.1. Template for HDF5 definitions</a></li>
<li><a href="#org07b6511">1.2. Template for HDF5 structures</a></li> <li><a href="#org3f84f22">1.2. Template for HDF5 structures</a></li>
<li><a href="#org6d62c11">1.3. Template for HDF5 init/deinit</a></li> <li><a href="#org4c83b5a">1.3. Template for HDF5 init/deinit</a></li>
<li><a href="#orgd4e29e2">1.4. Template for HDF5 has/read/write a single dimensioning variable</a></li> <li><a href="#orgcaaa384">1.4. Template for HDF5 has/read/write the numerical attribute</a></li>
<li><a href="#org1996ea4">1.5. Template for HDF5 has/read/write a dataset of numerical data</a></li> <li><a href="#orgaa02987">1.5. Template for HDF5 has/read/write the dataset of numerical data</a></li>
<li><a href="#org9f4f182">1.6. Template for HDF5 has/read/write a dataset of strings</a></li> <li><a href="#orgd1e0d5c">1.6. Template for HDF5 has/read/write the dataset of strings</a></li>
<li><a href="#orgb952d9b">1.7. Template for HDF5 has/read/write a single string attribute</a></li> <li><a href="#org560a3cb">1.7. Template for HDF5 has/read/write the string attribute</a></li>
</ul> </ul>
</li> </li>
</ul> </ul>
</div> </div>
</div> </div>
<div id="outline-container-org26617cc" class="outline-2"> <div id="outline-container-org4f96d3c" class="outline-2">
<h2 id="org26617cc"><span class="section-number-2">1</span> HDF5 back end</h2> <h2 id="org4f96d3c"><span class="section-number-2">1</span> HDF5 back end</h2>
<div class="outline-text-2" id="text-1"> <div class="outline-text-2" id="text-1">
</div> </div>
<div id="outline-container-org61e9dc2" class="outline-3"> <div id="outline-container-org935b3d3" class="outline-3">
<h3 id="org61e9dc2"><span class="section-number-3">1.1</span> Template for HDF5 definitions</h3> <h3 id="org935b3d3"><span class="section-number-3">1.1</span> Template for HDF5 definitions</h3>
<div class="outline-text-3" id="text-1-1"> <div class="outline-text-3" id="text-1-1">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-c"><span style="color: #483d8b;">#define</span> $GROUP$_GROUP_NAME <span style="color: #8b2252;">"$group$"</span> <pre class="src src-c"><span style="color: #483d8b;">#define</span> $GROUP$_GROUP_NAME <span style="color: #8b2252;">"$group$"</span>
@ -343,8 +343,8 @@ for the JavaScript code in this tag.
</div> </div>
</div> </div>
<div id="outline-container-org07b6511" class="outline-3"> <div id="outline-container-org3f84f22" class="outline-3">
<h3 id="org07b6511"><span class="section-number-3">1.2</span> Template for HDF5 structures</h3> <h3 id="org3f84f22"><span class="section-number-3">1.2</span> Template for HDF5 structures</h3>
<div class="outline-text-3" id="text-1-2"> <div class="outline-text-3" id="text-1-2">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-c"><span style="color: #a020f0;">typedef</span> <span style="color: #a020f0;">struct</span> <span style="color: #228b22;">trexio_hdf5_s</span> { <pre class="src src-c"><span style="color: #a020f0;">typedef</span> <span style="color: #a020f0;">struct</span> <span style="color: #228b22;">trexio_hdf5_s</span> {
@ -358,8 +358,8 @@ for the JavaScript code in this tag.
</div> </div>
<div id="outline-container-org6d62c11" class="outline-3"> <div id="outline-container-org4c83b5a" class="outline-3">
<h3 id="org6d62c11"><span class="section-number-3">1.3</span> Template for HDF5 init/deinit</h3> <h3 id="org4c83b5a"><span class="section-number-3">1.3</span> Template for HDF5 init/deinit</h3>
<div class="outline-text-3" id="text-1-3"> <div class="outline-text-3" id="text-1-3">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span> <pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span>
@ -439,12 +439,12 @@ for the JavaScript code in this tag.
</div> </div>
</div> </div>
<div id="outline-container-orgd4e29e2" class="outline-3"> <div id="outline-container-orgcaaa384" class="outline-3">
<h3 id="orgd4e29e2"><span class="section-number-3">1.4</span> Template for HDF5 has/read/write a single dimensioning variable</h3> <h3 id="orgcaaa384"><span class="section-number-3">1.4</span> Template for HDF5 has/read/write the numerical attribute</h3>
<div class="outline-text-3" id="text-1-4"> <div class="outline-text-3" id="text-1-4">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span> <pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span>
<span style="color: #0000ff;">trexio_hdf5_read_$group_num$</span> (<span style="color: #228b22;">trexio_t</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">file</span>, <span style="color: #228b22;">uint64_t</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">num</span>) <span style="color: #0000ff;">trexio_hdf5_read_$group_num$</span> (<span style="color: #228b22;">trexio_t</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">file</span>, $group_num_dtype_double$* <span style="color: #a020f0;">const</span> num)
{ {
<span style="color: #a020f0;">if</span> (file == <span style="color: #008b8b;">NULL</span>) <span style="color: #a020f0;">return</span> TREXIO_INVALID_ARG_1; <span style="color: #a020f0;">if</span> (file == <span style="color: #008b8b;">NULL</span>) <span style="color: #a020f0;">return</span> TREXIO_INVALID_ARG_1;
@ -458,7 +458,7 @@ for the JavaScript code in this tag.
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">hid_t</span> <span style="color: #a0522d;">num_id</span> = H5Aopen(f-&gt;$group$_group, $GROUP_NUM$_NAME, H5P_DEFAULT); <span style="color: #a020f0;">const</span> <span style="color: #228b22;">hid_t</span> <span style="color: #a0522d;">num_id</span> = H5Aopen(f-&gt;$group$_group, $GROUP_NUM$_NAME, H5P_DEFAULT);
<span style="color: #a020f0;">if</span> (num_id &lt;= 0) <span style="color: #a020f0;">return</span> TREXIO_INVALID_ID; <span style="color: #a020f0;">if</span> (num_id &lt;= 0) <span style="color: #a020f0;">return</span> TREXIO_INVALID_ID;
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">herr_t</span> <span style="color: #a0522d;">status</span> = H5Aread(num_id, H5T_NATIVE_UINT64, num); <span style="color: #a020f0;">const</span> <span style="color: #228b22;">herr_t</span> <span style="color: #a0522d;">status</span> = H5Aread(num_id, H5T_$GROUP_NUM_H5_DTYPE$, num);
H5Aclose(num_id); H5Aclose(num_id);
@ -473,22 +473,19 @@ for the JavaScript code in this tag.
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span> <pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span>
<span style="color: #0000ff;">trexio_hdf5_write_$group_num$</span> (<span style="color: #228b22;">trexio_t</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">file</span>, <span style="color: #a020f0;">const</span> <span style="color: #228b22;">uint64_t</span> <span style="color: #a0522d;">num</span>) <span style="color: #0000ff;">trexio_hdf5_write_$group_num$</span> (<span style="color: #228b22;">trexio_t</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">file</span>, <span style="color: #a020f0;">const</span> $group_num_dtype_double$ num)
{ {
<span style="color: #a020f0;">if</span> (file == <span style="color: #008b8b;">NULL</span>) <span style="color: #a020f0;">return</span> TREXIO_INVALID_ARG_1; <span style="color: #a020f0;">if</span> (file == <span style="color: #008b8b;">NULL</span>) <span style="color: #a020f0;">return</span> TREXIO_INVALID_ARG_1;
<span style="color: #a020f0;">if</span> (num == 0L ) <span style="color: #a020f0;">return</span> TREXIO_INVALID_ARG_2;
<span style="color: #228b22;">trexio_hdf5_t</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">f</span> = (<span style="color: #228b22;">trexio_hdf5_t</span>*) file; <span style="color: #228b22;">trexio_hdf5_t</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">f</span> = (<span style="color: #228b22;">trexio_hdf5_t</span>*) file;
<span style="color: #a020f0;">if</span> (H5Aexists(f-&gt;$group$_group, $GROUP_NUM$_NAME) == 0) {
/* <span style="color: #b22222;">Write the dimensioning variables </span>*/ /* <span style="color: #b22222;">Write the dimensioning variables </span>*/
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">hid_t</span> <span style="color: #a0522d;">dtype</span> = H5Tcopy(H5T_NATIVE_UINT64); <span style="color: #a020f0;">const</span> <span style="color: #228b22;">hid_t</span> <span style="color: #a0522d;">dtype</span> = H5Tcopy(H5T_$GROUP_NUM_H5_DTYPE$);
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">hid_t</span> <span style="color: #a0522d;">dspace</span> = H5Screate(H5S_SCALAR); <span style="color: #a020f0;">const</span> <span style="color: #228b22;">hid_t</span> <span style="color: #a0522d;">dspace</span> = H5Screate(H5S_SCALAR);
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">hid_t</span> <span style="color: #a0522d;">num_id</span> = H5Acreate(f-&gt;$group$_group, $GROUP_NUM$_NAME, dtype, dspace, <span style="color: #a020f0;">const</span> <span style="color: #228b22;">hid_t</span> <span style="color: #a0522d;">num_id</span> = H5Acreate(f-&gt;$group$_group, $GROUP_NUM$_NAME,
H5P_DEFAULT, H5P_DEFAULT); dtype, dspace, H5P_DEFAULT, H5P_DEFAULT);
<span style="color: #a020f0;">if</span> (num_id &lt;= 0) { <span style="color: #a020f0;">if</span> (num_id &lt;= 0) {
H5Sclose(dspace); H5Sclose(dspace);
H5Tclose(dtype); H5Tclose(dtype);
@ -504,30 +501,11 @@ for the JavaScript code in this tag.
} }
H5Sclose(dspace); H5Sclose(dspace);
H5Aclose(num_id);
H5Tclose(dtype);
<span style="color: #a020f0;">return</span> TREXIO_SUCCESS;
} <span style="color: #a020f0;">else</span> {
<span style="color: #228b22;">uint64_t</span> <span style="color: #a0522d;">infile_num</span>;
<span style="color: #228b22;">trexio_exit_code</span> <span style="color: #a0522d;">rc</span> = trexio_hdf5_read_$group_num$(file, &amp;(infile_num));
<span style="color: #a020f0;">if</span> (rc != TREXIO_SUCCESS) <span style="color: #a020f0;">return</span> rc;
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">hid_t</span> <span style="color: #a0522d;">dtype</span> = H5Tcopy(H5T_NATIVE_UINT64);
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">hid_t</span> <span style="color: #a0522d;">num_id</span> = H5Aopen(f-&gt;$group$_group, $GROUP_NUM$_NAME, H5P_DEFAULT);
<span style="color: #a020f0;">if</span> (num_id &lt;= 0) <span style="color: #a020f0;">return</span> TREXIO_INVALID_ID;
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">herr_t</span> <span style="color: #a0522d;">status</span> = H5Awrite(num_id, dtype, &amp;(num));
<span style="color: #a020f0;">if</span> (status &lt; 0) <span style="color: #a020f0;">return</span> TREXIO_FAILURE;
H5Aclose(num_id); H5Aclose(num_id);
H5Tclose(dtype); H5Tclose(dtype);
<span style="color: #a020f0;">return</span> TREXIO_SUCCESS; <span style="color: #a020f0;">return</span> TREXIO_SUCCESS;
} }
}
</pre> </pre>
</div> </div>
@ -556,8 +534,8 @@ for the JavaScript code in this tag.
</div> </div>
</div> </div>
<div id="outline-container-org1996ea4" class="outline-3"> <div id="outline-container-orgaa02987" class="outline-3">
<h3 id="org1996ea4"><span class="section-number-3">1.5</span> Template for HDF5 has/read/write a dataset of numerical data</h3> <h3 id="orgaa02987"><span class="section-number-3">1.5</span> Template for HDF5 has/read/write the dataset of numerical data</h3>
<div class="outline-text-3" id="text-1-5"> <div class="outline-text-3" id="text-1-5">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span> <pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span>
@ -623,12 +601,6 @@ for the JavaScript code in this tag.
<span style="color: #a020f0;">if</span> (file == <span style="color: #008b8b;">NULL</span>) <span style="color: #a020f0;">return</span> TREXIO_INVALID_ARG_1; <span style="color: #a020f0;">if</span> (file == <span style="color: #008b8b;">NULL</span>) <span style="color: #a020f0;">return</span> TREXIO_INVALID_ARG_1;
<span style="color: #a020f0;">if</span> ($group_dset$ == <span style="color: #008b8b;">NULL</span>) <span style="color: #a020f0;">return</span> TREXIO_INVALID_ARG_2; <span style="color: #a020f0;">if</span> ($group_dset$ == <span style="color: #008b8b;">NULL</span>) <span style="color: #a020f0;">return</span> TREXIO_INVALID_ARG_2;
<span style="color: #228b22;">trexio_exit_code</span> <span style="color: #a0522d;">rc</span>;
uint64_t $group_dset_dim$;
// <span style="color: #b22222;">error handling for rc is added by the generator</span>
rc = trexio_hdf5_read_$group_dset_dim$(file, &amp;($group_dset_dim$));
<span style="color: #a020f0;">if</span> ($group_dset_dim$ == 0L) <span style="color: #a020f0;">return</span> TREXIO_INVALID_NUM;
<span style="color: #228b22;">trexio_hdf5_t</span>* <span style="color: #a0522d;">f</span> = (<span style="color: #228b22;">trexio_hdf5_t</span>*) file; <span style="color: #228b22;">trexio_hdf5_t</span>* <span style="color: #a0522d;">f</span> = (<span style="color: #228b22;">trexio_hdf5_t</span>*) file;
<span style="color: #a020f0;">if</span> ( H5LTfind_dataset(f-&gt;$group$_group, $GROUP_DSET$_NAME) != 1 ) { <span style="color: #a020f0;">if</span> ( H5LTfind_dataset(f-&gt;$group$_group, $GROUP_DSET$_NAME) != 1 ) {
@ -686,8 +658,8 @@ for the JavaScript code in this tag.
</div> </div>
</div> </div>
<div id="outline-container-org9f4f182" class="outline-3"> <div id="outline-container-orgd1e0d5c" class="outline-3">
<h3 id="org9f4f182"><span class="section-number-3">1.6</span> Template for HDF5 has/read/write a dataset of strings</h3> <h3 id="orgd1e0d5c"><span class="section-number-3">1.6</span> Template for HDF5 has/read/write the dataset of strings</h3>
<div class="outline-text-3" id="text-1-6"> <div class="outline-text-3" id="text-1-6">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span> <pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span>
@ -805,12 +777,6 @@ for the JavaScript code in this tag.
<span style="color: #a020f0;">if</span> (file == <span style="color: #008b8b;">NULL</span>) <span style="color: #a020f0;">return</span> TREXIO_INVALID_ARG_1; <span style="color: #a020f0;">if</span> (file == <span style="color: #008b8b;">NULL</span>) <span style="color: #a020f0;">return</span> TREXIO_INVALID_ARG_1;
<span style="color: #a020f0;">if</span> ($group_dset$ == <span style="color: #008b8b;">NULL</span>) <span style="color: #a020f0;">return</span> TREXIO_INVALID_ARG_2; <span style="color: #a020f0;">if</span> ($group_dset$ == <span style="color: #008b8b;">NULL</span>) <span style="color: #a020f0;">return</span> TREXIO_INVALID_ARG_2;
<span style="color: #228b22;">trexio_exit_code</span> <span style="color: #a0522d;">rc</span>;
uint64_t $group_dset_dim$;
// <span style="color: #b22222;">error handling for rc is added by the generator</span>
rc = trexio_hdf5_read_$group_dset_dim$(file, &amp;($group_dset_dim$));
<span style="color: #a020f0;">if</span> ($group_dset_dim$ == 0L) <span style="color: #a020f0;">return</span> TREXIO_INVALID_NUM;
<span style="color: #228b22;">trexio_hdf5_t</span>* <span style="color: #a0522d;">f</span> = (<span style="color: #228b22;">trexio_hdf5_t</span>*) file; <span style="color: #228b22;">trexio_hdf5_t</span>* <span style="color: #a0522d;">f</span> = (<span style="color: #228b22;">trexio_hdf5_t</span>*) file;
<span style="color: #228b22;">herr_t</span> <span style="color: #a0522d;">status</span>; <span style="color: #228b22;">herr_t</span> <span style="color: #a0522d;">status</span>;
@ -898,8 +864,8 @@ for the JavaScript code in this tag.
</div> </div>
</div> </div>
<div id="outline-container-orgb952d9b" class="outline-3"> <div id="outline-container-org560a3cb" class="outline-3">
<h3 id="orgb952d9b"><span class="section-number-3">1.7</span> Template for HDF5 has/read/write a single string attribute</h3> <h3 id="org560a3cb"><span class="section-number-3">1.7</span> Template for HDF5 has/read/write the string attribute</h3>
<div class="outline-text-3" id="text-1-7"> <div class="outline-text-3" id="text-1-7">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span> <pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span>
@ -1026,7 +992,7 @@ for the JavaScript code in this tag.
</div> </div>
<div id="postamble" class="status"> <div id="postamble" class="status">
<p class="author">Author: TREX-CoE</p> <p class="author">Author: TREX-CoE</p>
<p class="date">Created: 2021-09-16 Thu 14:47</p> <p class="date">Created: 2021-09-22 Wed 11:34</p>
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p> <p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div> </div>
</body> </body>

View File

@ -3,7 +3,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head> <head>
<!-- 2021-09-16 Thu 14:47 --> <!-- 2021-09-22 Wed 11:34 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<title>TEXT back end</title> <title>TEXT back end</title>
@ -311,26 +311,26 @@ for the JavaScript code in this tag.
<h2>Table of Contents</h2> <h2>Table of Contents</h2>
<div id="text-table-of-contents"> <div id="text-table-of-contents">
<ul> <ul>
<li><a href="#org52f7e07">1. TEXT back end</a> <li><a href="#orga4d2401">1. TEXT back end</a>
<ul> <ul>
<li><a href="#org9ec603c">1.1. Template for group-related structures in text back end</a></li> <li><a href="#orge21a8c1">1.1. Template for group-related structures in text back end</a></li>
<li><a href="#org1aaf4f6">1.2. Template for general structure in text back end</a></li> <li><a href="#orgf6a2e80">1.2. Template for general structure in text back end</a></li>
<li><a href="#org838d52e">1.3. Initialize function (constant part)</a></li> <li><a href="#org7acd3e2">1.3. Initialize function (constant part)</a></li>
<li><a href="#org3106705">1.4. Deinitialize function (templated part)</a></li> <li><a href="#orgcb97c8c">1.4. Deinitialize function (templated part)</a></li>
<li><a href="#org7810f25">1.5. Template for text read struct</a></li> <li><a href="#org626a4b9">1.5. Template for text read struct</a></li>
<li><a href="#orga899e45">1.6. Template for text flush struct</a></li> <li><a href="#orgbd6f77e">1.6. Template for text flush struct</a></li>
<li><a href="#org4704bff">1.7. Template for text free memory</a></li> <li><a href="#org64836c8">1.7. Template for text free memory</a></li>
<li><a href="#org98dc9f8">1.8. Template for has/read/write the num attribute</a></li> <li><a href="#org5570dff">1.8. Template for has/read/write the numerical attribute</a></li>
<li><a href="#org4e36999">1.9. Template for has/read/write the dataset of numerical data</a></li> <li><a href="#org80fd31f">1.9. Template for has/read/write the dataset of numerical data</a></li>
<li><a href="#org62fd780">1.10. Template for has/read/write the dataset of strings</a></li> <li><a href="#org674f937">1.10. Template for has/read/write the dataset of strings</a></li>
<li><a href="#org21d2224">1.11. Template for has/read/write the string attribute</a></li> <li><a href="#org717b30b">1.11. Template for has/read/write the string attribute</a></li>
<li><a href="#orgaf090f2">1.12. RDM struct (hard-coded)</a> <li><a href="#org00fb9fd">1.12. RDM struct (hard-coded)</a>
<ul> <ul>
<li><a href="#orgcb0d605">1.12.1. Read the complete struct</a></li> <li><a href="#org5d5a720">1.12.1. Read the complete struct</a></li>
<li><a href="#org58df0ff">1.12.2. Flush the complete struct</a></li> <li><a href="#orge037de5">1.12.2. Flush the complete struct</a></li>
<li><a href="#org6db163c">1.12.3. Free memory</a></li> <li><a href="#org8974291">1.12.3. Free memory</a></li>
<li><a href="#org750d656">1.12.4. Read/Write the one<sub>e</sub> attribute</a></li> <li><a href="#org6c7c856">1.12.4. Read/Write the one<sub>e</sub> attribute</a></li>
<li><a href="#org6f559f9">1.12.5. Read/Write the two<sub>e</sub> attribute</a></li> <li><a href="#org62e0f4e">1.12.5. Read/Write the two<sub>e</sub> attribute</a></li>
</ul> </ul>
</li> </li>
</ul> </ul>
@ -339,8 +339,8 @@ for the JavaScript code in this tag.
</div> </div>
</div> </div>
<div id="outline-container-org52f7e07" class="outline-2"> <div id="outline-container-orga4d2401" class="outline-2">
<h2 id="org52f7e07"><span class="section-number-2">1</span> TEXT back end</h2> <h2 id="orga4d2401"><span class="section-number-2">1</span> TEXT back end</h2>
<div class="outline-text-2" id="text-1"> <div class="outline-text-2" id="text-1">
<p> <p>
The "file" produced by the text back end is a directory with one The "file" produced by the text back end is a directory with one
@ -361,12 +361,13 @@ The file is written when closed, or when the flush function is called.
</p> </p>
</div> </div>
<div id="outline-container-org9ec603c" class="outline-3"> <div id="outline-container-orge21a8c1" class="outline-3">
<h3 id="org9ec603c"><span class="section-number-3">1.1</span> Template for group-related structures in text back end</h3> <h3 id="orge21a8c1"><span class="section-number-3">1.1</span> Template for group-related structures in text back end</h3>
<div class="outline-text-3" id="text-1-1"> <div class="outline-text-3" id="text-1-1">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-c"><span style="color: #a020f0;">typedef</span> <span style="color: #a020f0;">struct</span> $group$_s { <pre class="src src-c"><span style="color: #a020f0;">typedef</span> <span style="color: #a020f0;">struct</span> $group$_s {
uint64_t $group_num$; $group_num_dtype_double$ $group_num$;
bool $group_num$_isSet;
$group_dset_dtype$* $group_dset$; $group_dset_dtype$* $group_dset$;
<span style="color: #228b22;">uint32_t</span> <span style="color: #a0522d;">rank_$group_dset$</span>; <span style="color: #228b22;">uint32_t</span> <span style="color: #a0522d;">rank_$group_dset$</span>;
<span style="color: #228b22;">uint32_t</span> <span style="color: #a0522d;">to_flush</span>; <span style="color: #228b22;">uint32_t</span> <span style="color: #a0522d;">to_flush</span>;
@ -380,8 +381,8 @@ The file is written when closed, or when the flush function is called.
</div> </div>
</div> </div>
<div id="outline-container-org1aaf4f6" class="outline-3"> <div id="outline-container-orgf6a2e80" class="outline-3">
<h3 id="org1aaf4f6"><span class="section-number-3">1.2</span> Template for general structure in text back end</h3> <h3 id="orgf6a2e80"><span class="section-number-3">1.2</span> Template for general structure in text back end</h3>
<div class="outline-text-3" id="text-1-2"> <div class="outline-text-3" id="text-1-2">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-c"><span style="color: #a020f0;">typedef</span> <span style="color: #a020f0;">struct</span> <span style="color: #228b22;">rdm_s</span> { <pre class="src src-c"><span style="color: #a020f0;">typedef</span> <span style="color: #a020f0;">struct</span> <span style="color: #228b22;">rdm_s</span> {
@ -407,8 +408,8 @@ The file is written when closed, or when the flush function is called.
</div> </div>
</div> </div>
<div id="outline-container-org838d52e" class="outline-3"> <div id="outline-container-org7acd3e2" class="outline-3">
<h3 id="org838d52e"><span class="section-number-3">1.3</span> Initialize function (constant part)</h3> <h3 id="org7acd3e2"><span class="section-number-3">1.3</span> Initialize function (constant part)</h3>
<div class="outline-text-3" id="text-1-3"> <div class="outline-text-3" id="text-1-3">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span> <pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span>
@ -509,8 +510,8 @@ The file is written when closed, or when the flush function is called.
</div> </div>
</div> </div>
<div id="outline-container-org3106705" class="outline-3"> <div id="outline-container-orgcb97c8c" class="outline-3">
<h3 id="org3106705"><span class="section-number-3">1.4</span> Deinitialize function (templated part)</h3> <h3 id="orgcb97c8c"><span class="section-number-3">1.4</span> Deinitialize function (templated part)</h3>
<div class="outline-text-3" id="text-1-4"> <div class="outline-text-3" id="text-1-4">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span> <pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span>
@ -535,8 +536,8 @@ The file is written when closed, or when the flush function is called.
</div> </div>
</div> </div>
<div id="outline-container-org7810f25" class="outline-3"> <div id="outline-container-org626a4b9" class="outline-3">
<h3 id="org7810f25"><span class="section-number-3">1.5</span> Template for text read struct</h3> <h3 id="org626a4b9"><span class="section-number-3">1.5</span> Template for text read struct</h3>
<div class="outline-text-3" id="text-1-5"> <div class="outline-text-3" id="text-1-5">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-c">$group$_t* <pre class="src src-c">$group$_t*
@ -633,8 +634,30 @@ trexio_text_read_$group$ (<span style="color: #228b22;">trexio_text_t</span>* <s
} }
// <span style="color: #b22222;">END REPEAT GROUP_DSET_ALL</span> // <span style="color: #b22222;">END REPEAT GROUP_DSET_ALL</span>
<span style="color: #228b22;">unsigned</span> <span style="color: #228b22;">int</span> <span style="color: #a0522d;">local_isSet</span>;
// <span style="color: #b22222;">START REPEAT GROUP_NUM</span> // <span style="color: #b22222;">START REPEAT GROUP_NUM</span>
/* <span style="color: #b22222;">Read data </span>*/ /* <span style="color: #b22222;">Read data </span>*/
rc = fscanf(f, <span style="color: #8b2252;">"%1023s"</span>, buffer);
assert(!((rc != 1) || (strcmp(buffer, <span style="color: #8b2252;">"$group_num$_isSet"</span>) != 0)));
<span style="color: #a020f0;">if</span> ((rc != 1) || (strcmp(buffer, <span style="color: #8b2252;">"$group_num$_isSet"</span>) != 0)) {
FREE(buffer);
fclose(f);
FREE($group$);
<span style="color: #a020f0;">return</span> <span style="color: #008b8b;">NULL</span>;
}
/* <span style="color: #b22222;">additional parameter local_isSet is needed to suppress warning when fscanf into bool variable using %u or %d </span>*/
rc = fscanf(f, <span style="color: #8b2252;">"%u"</span>, &amp;(local_isSet));
$group$-&gt;$group_num$_isSet = (<span style="color: #228b22;">bool</span>) local_isSet;
assert(!(rc != 1));
<span style="color: #a020f0;">if</span> (rc != 1) {
FREE(buffer);
fclose(f);
FREE($group$);
<span style="color: #a020f0;">return</span> <span style="color: #008b8b;">NULL</span>;
}
<span style="color: #a020f0;">if</span> ($group$-&gt;$group_num$_isSet == <span style="color: #008b8b;">true</span>) {
rc = fscanf(f, <span style="color: #8b2252;">"%1023s"</span>, buffer); rc = fscanf(f, <span style="color: #8b2252;">"%1023s"</span>, buffer);
assert(!((rc != 1) || (strcmp(buffer, <span style="color: #8b2252;">"$group_num$"</span>) != 0))); assert(!((rc != 1) || (strcmp(buffer, <span style="color: #8b2252;">"$group_num$"</span>) != 0)));
<span style="color: #a020f0;">if</span> ((rc != 1) || (strcmp(buffer, <span style="color: #8b2252;">"$group_num$"</span>) != 0)) { <span style="color: #a020f0;">if</span> ((rc != 1) || (strcmp(buffer, <span style="color: #8b2252;">"$group_num$"</span>) != 0)) {
@ -644,7 +667,7 @@ trexio_text_read_$group$ (<span style="color: #228b22;">trexio_text_t</span>* <s
<span style="color: #a020f0;">return</span> <span style="color: #008b8b;">NULL</span>; <span style="color: #a020f0;">return</span> <span style="color: #008b8b;">NULL</span>;
} }
rc = fscanf(f, <span style="color: #8b2252;">"%"</span> SCNu64 <span style="color: #8b2252;">""</span>, &amp;($group$-&gt;$group_num$)); rc = fscanf(f, <span style="color: #8b2252;">"%$group_num_std_dtype_in$"</span>, &amp;($group$-&gt;$group_num$));
assert(!(rc != 1)); assert(!(rc != 1));
<span style="color: #a020f0;">if</span> (rc != 1) { <span style="color: #a020f0;">if</span> (rc != 1) {
FREE(buffer); FREE(buffer);
@ -652,6 +675,7 @@ trexio_text_read_$group$ (<span style="color: #228b22;">trexio_text_t</span>* <s
FREE($group$); FREE($group$);
<span style="color: #a020f0;">return</span> <span style="color: #008b8b;">NULL</span>; <span style="color: #a020f0;">return</span> <span style="color: #008b8b;">NULL</span>;
} }
}
// <span style="color: #b22222;">END REPEAT GROUP_NUM</span> // <span style="color: #b22222;">END REPEAT GROUP_NUM</span>
// <span style="color: #b22222;">START REPEAT GROUP_ATTR_STR</span> // <span style="color: #b22222;">START REPEAT GROUP_ATTR_STR</span>
@ -745,6 +769,7 @@ trexio_text_read_$group$ (<span style="color: #228b22;">trexio_text_t</span>* <s
// <span style="color: #b22222;">START REPEAT GROUP_DSET_STR</span> // <span style="color: #b22222;">START REPEAT GROUP_DSET_STR</span>
/* <span style="color: #b22222;">Allocate arrays </span>*/ /* <span style="color: #b22222;">Allocate arrays </span>*/
<span style="color: #a020f0;">if</span>(size_$group_dset$ != 0) {
$group$-&gt;$group_dset$ = CALLOC(size_$group_dset$, $group_dset_dtype$); $group$-&gt;$group_dset$ = CALLOC(size_$group_dset$, $group_dset_dtype$);
assert (!($group$-&gt;$group_dset$ == <span style="color: #008b8b;">NULL</span>)); assert (!($group$-&gt;$group_dset$ == <span style="color: #008b8b;">NULL</span>));
<span style="color: #a020f0;">if</span> ($group$-&gt;$group_dset$ == <span style="color: #008b8b;">NULL</span>) { <span style="color: #a020f0;">if</span> ($group$-&gt;$group_dset$ == <span style="color: #008b8b;">NULL</span>) {
@ -769,7 +794,7 @@ trexio_text_read_$group$ (<span style="color: #228b22;">trexio_text_t</span>* <s
<span style="color: #b22222;"> , BUT it's size has to be number_of_str*max_len_str where max_len_str is somewhat arbitrary, e.g. 32.</span> <span style="color: #b22222;"> , BUT it's size has to be number_of_str*max_len_str where max_len_str is somewhat arbitrary, e.g. 32.</span>
<span style="color: #b22222;"> </span>*/ <span style="color: #b22222;"> </span>*/
<span style="color: #228b22;">char</span>* <span style="color: #a0522d;">tmp_$group_dset$</span>; <span style="color: #228b22;">char</span>* <span style="color: #a0522d;">tmp_$group_dset$</span>;
<span style="color: #a020f0;">if</span>(size_$group_dset$ != 0) tmp_$group_dset$ = CALLOC(size_$group_dset$*32, <span style="color: #228b22;">char</span>); tmp_$group_dset$ = CALLOC(size_$group_dset$*32, <span style="color: #228b22;">char</span>);
<span style="color: #a020f0;">for</span> (<span style="color: #228b22;">uint64_t</span> <span style="color: #a0522d;">i</span>=0 ; i&lt;size_$group_dset$ ; ++i) { <span style="color: #a020f0;">for</span> (<span style="color: #228b22;">uint64_t</span> <span style="color: #a0522d;">i</span>=0 ; i&lt;size_$group_dset$ ; ++i) {
$group$-&gt;$group_dset$[i] = tmp_$group_dset$; $group$-&gt;$group_dset$[i] = tmp_$group_dset$;
@ -789,6 +814,7 @@ trexio_text_read_$group$ (<span style="color: #228b22;">trexio_text_t</span>* <s
<span style="color: #228b22;">size_t</span> <span style="color: #a0522d;">tmp_$group_dset$_len</span> = strlen($group$-&gt;$group_dset$[i]); <span style="color: #228b22;">size_t</span> <span style="color: #a0522d;">tmp_$group_dset$_len</span> = strlen($group$-&gt;$group_dset$[i]);
tmp_$group_dset$ += tmp_$group_dset$_len + 1; tmp_$group_dset$ += tmp_$group_dset$_len + 1;
} }
}
// <span style="color: #b22222;">END REPEAT GROUP_DSET_STR</span> // <span style="color: #b22222;">END REPEAT GROUP_DSET_STR</span>
FREE(buffer); FREE(buffer);
@ -805,8 +831,8 @@ trexio_text_read_$group$ (<span style="color: #228b22;">trexio_text_t</span>* <s
</div> </div>
</div> </div>
<div id="outline-container-orga899e45" class="outline-3"> <div id="outline-container-orgbd6f77e" class="outline-3">
<h3 id="orga899e45"><span class="section-number-3">1.6</span> Template for text flush struct</h3> <h3 id="orgbd6f77e"><span class="section-number-3">1.6</span> Template for text flush struct</h3>
<div class="outline-text-3" id="text-1-6"> <div class="outline-text-3" id="text-1-6">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span> <pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span>
@ -842,7 +868,8 @@ trexio_text_read_$group$ (<span style="color: #228b22;">trexio_text_t</span>* <s
// <span style="color: #b22222;">END REPEAT GROUP_DSET_ALL</span> // <span style="color: #b22222;">END REPEAT GROUP_DSET_ALL</span>
// <span style="color: #b22222;">START REPEAT GROUP_NUM</span> // <span style="color: #b22222;">START REPEAT GROUP_NUM</span>
fprintf(f, <span style="color: #8b2252;">"$group_num$ %"</span> PRIu64 <span style="color: #8b2252;">"\n"</span>, $group$-&gt;$group_num$); fprintf(f, <span style="color: #8b2252;">"$group_num$_isSet %u \n"</span>, $group$-&gt;$group_num$_isSet);
<span style="color: #a020f0;">if</span> ($group$-&gt;$group_num$_isSet == <span style="color: #008b8b;">true</span>) fprintf(f, <span style="color: #8b2252;">"$group_num$ %$group_num_std_dtype_out$ \n"</span>, $group$-&gt;$group_num$);
// <span style="color: #b22222;">END REPEAT GROUP_NUM</span> // <span style="color: #b22222;">END REPEAT GROUP_NUM</span>
// <span style="color: #b22222;">START REPEAT GROUP_ATTR_STR</span> // <span style="color: #b22222;">START REPEAT GROUP_ATTR_STR</span>
@ -870,8 +897,8 @@ trexio_text_read_$group$ (<span style="color: #228b22;">trexio_text_t</span>* <s
</div> </div>
</div> </div>
<div id="outline-container-org4704bff" class="outline-3"> <div id="outline-container-org64836c8" class="outline-3">
<h3 id="org4704bff"><span class="section-number-3">1.7</span> Template for text free memory</h3> <h3 id="org64836c8"><span class="section-number-3">1.7</span> Template for text free memory</h3>
<div class="outline-text-3" id="text-1-7"> <div class="outline-text-3" id="text-1-7">
<p> <p>
Memory is allocated when reading. The following function frees memory. Memory is allocated when reading. The following function frees memory.
@ -916,12 +943,12 @@ Memory is allocated when reading. The following function frees memory.
</div> </div>
</div> </div>
<div id="outline-container-org98dc9f8" class="outline-3"> <div id="outline-container-org5570dff" class="outline-3">
<h3 id="org98dc9f8"><span class="section-number-3">1.8</span> Template for has/read/write the num attribute</h3> <h3 id="org5570dff"><span class="section-number-3">1.8</span> Template for has/read/write the numerical attribute</h3>
<div class="outline-text-3" id="text-1-8"> <div class="outline-text-3" id="text-1-8">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span> <pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span>
<span style="color: #0000ff;">trexio_text_read_$group_num$</span> (<span style="color: #228b22;">trexio_t</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">file</span>, <span style="color: #228b22;">uint64_t</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">num</span>) <span style="color: #0000ff;">trexio_text_read_$group_num$</span> (<span style="color: #228b22;">trexio_t</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">file</span>, $group_num_dtype_double$* <span style="color: #a020f0;">const</span> num)
{ {
<span style="color: #a020f0;">if</span> (file == <span style="color: #008b8b;">NULL</span>) <span style="color: #a020f0;">return</span> TREXIO_INVALID_ARG_1; <span style="color: #a020f0;">if</span> (file == <span style="color: #008b8b;">NULL</span>) <span style="color: #a020f0;">return</span> TREXIO_INVALID_ARG_1;
@ -940,7 +967,7 @@ Memory is allocated when reading. The following function frees memory.
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span> <pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span>
<span style="color: #0000ff;">trexio_text_write_$group_num$</span> (<span style="color: #228b22;">trexio_t</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">file</span>, <span style="color: #a020f0;">const</span> <span style="color: #228b22;">uint64_t</span> <span style="color: #a0522d;">num</span>) <span style="color: #0000ff;">trexio_text_write_$group_num$</span> (<span style="color: #228b22;">trexio_t</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">file</span>, <span style="color: #a020f0;">const</span> $group_num_dtype_double$ num)
{ {
<span style="color: #a020f0;">if</span> (file == <span style="color: #008b8b;">NULL</span>) <span style="color: #a020f0;">return</span> TREXIO_INVALID_ARG_1; <span style="color: #a020f0;">if</span> (file == <span style="color: #008b8b;">NULL</span>) <span style="color: #a020f0;">return</span> TREXIO_INVALID_ARG_1;
@ -950,6 +977,7 @@ Memory is allocated when reading. The following function frees memory.
<span style="color: #a020f0;">if</span> ($group$ == <span style="color: #008b8b;">NULL</span>) <span style="color: #a020f0;">return</span> TREXIO_FAILURE; <span style="color: #a020f0;">if</span> ($group$ == <span style="color: #008b8b;">NULL</span>) <span style="color: #a020f0;">return</span> TREXIO_FAILURE;
$group$-&gt;$group_num$ = num; $group$-&gt;$group_num$ = num;
$group$-&gt;$group_num$_isSet = <span style="color: #008b8b;">true</span>;
$group$-&gt;to_flush = 1; $group$-&gt;to_flush = 1;
<span style="color: #a020f0;">return</span> TREXIO_SUCCESS; <span style="color: #a020f0;">return</span> TREXIO_SUCCESS;
@ -967,7 +995,7 @@ Memory is allocated when reading. The following function frees memory.
$group$_t* $group$ = trexio_text_read_$group$((<span style="color: #228b22;">trexio_text_t</span>*) file); $group$_t* $group$ = trexio_text_read_$group$((<span style="color: #228b22;">trexio_text_t</span>*) file);
<span style="color: #a020f0;">if</span> ($group$ == <span style="color: #008b8b;">NULL</span>) <span style="color: #a020f0;">return</span> TREXIO_FAILURE; <span style="color: #a020f0;">if</span> ($group$ == <span style="color: #008b8b;">NULL</span>) <span style="color: #a020f0;">return</span> TREXIO_FAILURE;
<span style="color: #a020f0;">if</span> ($group$-&gt;$group_num$ &gt; 0L){ <span style="color: #a020f0;">if</span> ($group$-&gt;$group_num$_isSet == <span style="color: #008b8b;">true</span>){
<span style="color: #a020f0;">return</span> TREXIO_SUCCESS; <span style="color: #a020f0;">return</span> TREXIO_SUCCESS;
} <span style="color: #a020f0;">else</span> { } <span style="color: #a020f0;">else</span> {
<span style="color: #a020f0;">return</span> TREXIO_HAS_NOT; <span style="color: #a020f0;">return</span> TREXIO_HAS_NOT;
@ -979,8 +1007,8 @@ Memory is allocated when reading. The following function frees memory.
</div> </div>
</div> </div>
<div id="outline-container-org4e36999" class="outline-3"> <div id="outline-container-org80fd31f" class="outline-3">
<h3 id="org4e36999"><span class="section-number-3">1.9</span> Template for has/read/write the dataset of numerical data</h3> <h3 id="org80fd31f"><span class="section-number-3">1.9</span> Template for has/read/write the dataset of numerical data</h3>
<div class="outline-text-3" id="text-1-9"> <div class="outline-text-3" id="text-1-9">
<p> <p>
The <code>group_dset</code> array is assumed allocated with the appropriate size. The <code>group_dset</code> array is assumed allocated with the appropriate size.
@ -1076,8 +1104,8 @@ The <code>group_dset</code> array is assumed allocated with the appropriate size
</div> </div>
</div> </div>
</div> </div>
<div id="outline-container-org62fd780" class="outline-3"> <div id="outline-container-org674f937" class="outline-3">
<h3 id="org62fd780"><span class="section-number-3">1.10</span> Template for has/read/write the dataset of strings</h3> <h3 id="org674f937"><span class="section-number-3">1.10</span> Template for has/read/write the dataset of strings</h3>
<div class="outline-text-3" id="text-1-10"> <div class="outline-text-3" id="text-1-10">
<p> <p>
The <code>group_dset</code> array is assumed allocated with the appropriate size. The <code>group_dset</code> array is assumed allocated with the appropriate size.
@ -1178,8 +1206,8 @@ The <code>group_dset</code> array is assumed allocated with the appropriate size
</div> </div>
</div> </div>
</div> </div>
<div id="outline-container-org21d2224" class="outline-3"> <div id="outline-container-org717b30b" class="outline-3">
<h3 id="org21d2224"><span class="section-number-3">1.11</span> Template for has/read/write the string attribute</h3> <h3 id="org717b30b"><span class="section-number-3">1.11</span> Template for has/read/write the string attribute</h3>
<div class="outline-text-3" id="text-1-11"> <div class="outline-text-3" id="text-1-11">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span> <pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span>
@ -1253,12 +1281,12 @@ The <code>group_dset</code> array is assumed allocated with the appropriate size
</div> </div>
</div> </div>
</div> </div>
<div id="outline-container-orgaf090f2" class="outline-3"> <div id="outline-container-org00fb9fd" class="outline-3">
<h3 id="orgaf090f2"><span class="section-number-3">1.12</span> RDM struct (hard-coded)</h3> <h3 id="org00fb9fd"><span class="section-number-3">1.12</span> RDM struct (hard-coded)</h3>
<div class="outline-text-3" id="text-1-12"> <div class="outline-text-3" id="text-1-12">
</div> </div>
<div id="outline-container-orgcb0d605" class="outline-4"> <div id="outline-container-org5d5a720" class="outline-4">
<h4 id="orgcb0d605"><span class="section-number-4">1.12.1</span> Read the complete struct</h4> <h4 id="org5d5a720"><span class="section-number-4">1.12.1</span> Read the complete struct</h4>
<div class="outline-text-4" id="text-1-12-1"> <div class="outline-text-4" id="text-1-12-1">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">rdm_t</span>* <span style="color: #0000ff;">trexio_text_read_rdm</span>(<span style="color: #228b22;">trexio_text_t</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">file</span>); <pre class="src src-c"><span style="color: #228b22;">rdm_t</span>* <span style="color: #0000ff;">trexio_text_read_rdm</span>(<span style="color: #228b22;">trexio_text_t</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">file</span>);
@ -1353,8 +1381,8 @@ The <code>group_dset</code> array is assumed allocated with the appropriate size
</div> </div>
</div> </div>
<div id="outline-container-org58df0ff" class="outline-4"> <div id="outline-container-orge037de5" class="outline-4">
<h4 id="org58df0ff"><span class="section-number-4">1.12.2</span> Flush the complete struct</h4> <h4 id="orge037de5"><span class="section-number-4">1.12.2</span> Flush the complete struct</h4>
<div class="outline-text-4" id="text-1-12-2"> <div class="outline-text-4" id="text-1-12-2">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span> <span style="color: #0000ff;">trexio_text_flush_rdm</span>(<span style="color: #228b22;">trexio_text_t</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">file</span>); <pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span> <span style="color: #0000ff;">trexio_text_flush_rdm</span>(<span style="color: #228b22;">trexio_text_t</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">file</span>);
@ -1396,8 +1424,8 @@ The <code>group_dset</code> array is assumed allocated with the appropriate size
</div> </div>
</div> </div>
<div id="outline-container-org6db163c" class="outline-4"> <div id="outline-container-org8974291" class="outline-4">
<h4 id="org6db163c"><span class="section-number-4">1.12.3</span> Free memory</h4> <h4 id="org8974291"><span class="section-number-4">1.12.3</span> Free memory</h4>
<div class="outline-text-4" id="text-1-12-3"> <div class="outline-text-4" id="text-1-12-3">
<p> <p>
Memory is allocated when reading. The followig function frees memory. Memory is allocated when reading. The followig function frees memory.
@ -1433,8 +1461,8 @@ Memory is allocated when reading. The followig function frees memory.
</div> </div>
</div> </div>
<div id="outline-container-org750d656" class="outline-4"> <div id="outline-container-org6c7c856" class="outline-4">
<h4 id="org750d656"><span class="section-number-4">1.12.4</span> Read/Write the one<sub>e</sub> attribute</h4> <h4 id="org6c7c856"><span class="section-number-4">1.12.4</span> Read/Write the one<sub>e</sub> attribute</h4>
<div class="outline-text-4" id="text-1-12-4"> <div class="outline-text-4" id="text-1-12-4">
<p> <p>
The <code>one_e</code> array is assumed allocated with the appropriate size. The <code>one_e</code> array is assumed allocated with the appropriate size.
@ -1500,8 +1528,8 @@ The <code>one_e</code> array is assumed allocated with the appropriate size.
</div> </div>
</div> </div>
<div id="outline-container-org6f559f9" class="outline-4"> <div id="outline-container-org62e0f4e" class="outline-4">
<h4 id="org6f559f9"><span class="section-number-4">1.12.5</span> Read/Write the two<sub>e</sub> attribute</h4> <h4 id="org62e0f4e"><span class="section-number-4">1.12.5</span> Read/Write the two<sub>e</sub> attribute</h4>
<div class="outline-text-4" id="text-1-12-5"> <div class="outline-text-4" id="text-1-12-5">
<p> <p>
<code>two_e</code> is a sparse data structure, which can be too large to fit <code>two_e</code> is a sparse data structure, which can be too large to fit
@ -1609,7 +1637,7 @@ file for each sparse float structure.
</div> </div>
<div id="postamble" class="status"> <div id="postamble" class="status">
<p class="author">Author: TREX-CoE</p> <p class="author">Author: TREX-CoE</p>
<p class="date">Created: 2021-09-16 Thu 14:47</p> <p class="date">Created: 2021-09-22 Wed 11:34</p>
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p> <p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div> </div>
</body> </body>

150
trex.html
View File

@ -3,7 +3,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head> <head>
<!-- 2021-09-16 Thu 14:47 --> <!-- 2021-09-22 Wed 11:34 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<title>TREX Configuration file</title> <title>TREX Configuration file</title>
@ -333,28 +333,28 @@ for the JavaScript code in this tag.
<h2>Table of Contents</h2> <h2>Table of Contents</h2>
<div id="text-table-of-contents"> <div id="text-table-of-contents">
<ul> <ul>
<li><a href="#orgf01cc8b">1. Metadata (metadata group)</a></li> <li><a href="#orgc291cc2">1. Metadata (metadata group)</a></li>
<li><a href="#org6e07d76">2. Electron (electron group)</a></li> <li><a href="#org73e1250">2. Electron (electron group)</a></li>
<li><a href="#orga389cc4">3. Nucleus (nucleus group)</a></li> <li><a href="#org597fcf8">3. Nucleus (nucleus group)</a></li>
<li><a href="#orge373450">4. Effective core potentials (ecp group)</a></li> <li><a href="#org87488df">4. Effective core potentials (ecp group)</a></li>
<li><a href="#org9b59ff1">5. Basis set (basis group)</a></li> <li><a href="#org0791ffe">5. Basis set (basis group)</a></li>
<li><a href="#orged437c1">6. Atomic orbitals (ao group)</a> <li><a href="#org4666864">6. Atomic orbitals (ao group)</a>
<ul> <ul>
<li><a href="#ao_one_e">6.1. One-electron integrals (<code>ao_1e_int</code> group)</a></li> <li><a href="#ao_one_e">6.1. One-electron integrals (<code>ao_1e_int</code> group)</a></li>
<li><a href="#ao_two_e">6.2. Two-electron integrals (<code>ao_2e_int</code> group)</a></li> <li><a href="#ao_two_e">6.2. Two-electron integrals (<code>ao_2e_int</code> group)</a></li>
</ul> </ul>
</li> </li>
<li><a href="#orgbb85665">7. Molecular orbitals (mo group)</a> <li><a href="#orgc2e724a">7. Molecular orbitals (mo group)</a>
<ul> <ul>
<li><a href="#orgff9b4c2">7.1. One-electron integrals (<code>mo_1e_int</code> group)</a></li> <li><a href="#org7dae4a0">7.1. One-electron integrals (<code>mo_1e_int</code> group)</a></li>
<li><a href="#org6aedef6">7.2. Two-electron integrals (<code>mo_2e_int</code> group)</a></li> <li><a href="#org68387d3">7.2. Two-electron integrals (<code>mo_2e_int</code> group)</a></li>
</ul> </ul>
</li> </li>
<li><a href="#orgd7378f6">8. <span class="todo TODO">TODO</span> Slater determinants</a></li> <li><a href="#org7a75fad">8. <span class="todo TODO">TODO</span> Slater determinants</a></li>
<li><a href="#orgb3124cb">9. <span class="todo TODO">TODO</span> Reduced density matrices (rdm group)</a></li> <li><a href="#orgf1a2f70">9. <span class="todo TODO">TODO</span> Reduced density matrices (rdm group)</a></li>
<li><a href="#org951d21b">10. Appendix</a> <li><a href="#orgf5c229e">10. Appendix</a>
<ul> <ul>
<li><a href="#orgbd76282">10.1. Python script from table to json</a></li> <li><a href="#orgf7576f4">10.1. Python script from table to json</a></li>
</ul> </ul>
</li> </li>
</ul> </ul>
@ -380,14 +380,24 @@ is reversed in the produced <code>trex.json</code> configuration file as the lib
written in C. written in C.
</p> </p>
<p>
TREXIO currently supports <code>int</code>, <code>float</code> and <code>str</code> types for both single attributes and arrays.
Note, that some attributes might have <code>dim</code> type (e.g. <code>num</code> of the <code>nucleus</code> group).
This type is treated exactly the same as <code>int</code> with the only difference that <code>dim</code> variables
cannot be negative or zero. This additional constraint is required because <code>dim</code> attributes
are used internally to allocate memory and to check array boundaries in the memory-safe API.
Most of the times, the <code>dim</code> variables contain <code>num</code> suffix.
</p>
<p> <p>
In Fortran, the arrays are 1-based and in most other languages the In Fortran, the arrays are 1-based and in most other languages the
arrays are 0-based. Hence, we introduce the <code>index</code> type which is an arrays are 0-based. Hence, we introduce the <code>index</code> type which is an
1-based <code>int</code> in the Fortran interface and 0-based otherwise. 1-based <code>int</code> in the Fortran interface and 0-based otherwise.
</p> </p>
<div id="outline-container-orgf01cc8b" class="outline-2"> <div id="outline-container-orgc291cc2" class="outline-2">
<h2 id="orgf01cc8b"><span class="section-number-2">1</span> Metadata (metadata group)</h2> <h2 id="orgc291cc2"><span class="section-number-2">1</span> Metadata (metadata group)</h2>
<div class="outline-text-2" id="text-1"> <div class="outline-text-2" id="text-1">
<p> <p>
As we expect our files to be archived in open-data repositories, we As we expect our files to be archived in open-data repositories, we
@ -397,7 +407,7 @@ which have participated to the creation of the file, a list of
authors of the file, and a textual description. authors of the file, and a textual description.
</p> </p>
<table id="orgae2a71e" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides"> <table id="org96a99b2" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup> <colgroup>
@ -420,7 +430,7 @@ authors of the file, and a textual description.
<tbody> <tbody>
<tr> <tr>
<td class="org-left"><code>code_num</code></td> <td class="org-left"><code>code_num</code></td>
<td class="org-left"><code>int</code></td> <td class="org-left"><code>dim</code></td>
<td class="org-left">&#xa0;</td> <td class="org-left">&#xa0;</td>
<td class="org-left">Number of codes used to produce the file</td> <td class="org-left">Number of codes used to produce the file</td>
</tr> </tr>
@ -434,7 +444,7 @@ authors of the file, and a textual description.
<tr> <tr>
<td class="org-left"><code>author_num</code></td> <td class="org-left"><code>author_num</code></td>
<td class="org-left"><code>int</code></td> <td class="org-left"><code>dim</code></td>
<td class="org-left">&#xa0;</td> <td class="org-left">&#xa0;</td>
<td class="org-left">Number of authors of the file</td> <td class="org-left">Number of authors of the file</td>
</tr> </tr>
@ -464,15 +474,15 @@ authors of the file, and a textual description.
</div> </div>
</div> </div>
<div id="outline-container-org6e07d76" class="outline-2"> <div id="outline-container-org73e1250" class="outline-2">
<h2 id="org6e07d76"><span class="section-number-2">2</span> Electron (electron group)</h2> <h2 id="org73e1250"><span class="section-number-2">2</span> Electron (electron group)</h2>
<div class="outline-text-2" id="text-2"> <div class="outline-text-2" id="text-2">
<p> <p>
We consider wave functions expressed in the spin-free formalism, where We consider wave functions expressed in the spin-free formalism, where
the number of &uarr; and &darr; electrons is fixed. the number of &uarr; and &darr; electrons is fixed.
</p> </p>
<table id="orgbaec19d" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides"> <table id="orgcf1029a" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup> <colgroup>
@ -495,14 +505,14 @@ the number of &uarr; and &darr; electrons is fixed.
<tbody> <tbody>
<tr> <tr>
<td class="org-left"><code>up_num</code></td> <td class="org-left"><code>up_num</code></td>
<td class="org-left"><code>int</code></td> <td class="org-left"><code>dim</code></td>
<td class="org-left">&#xa0;</td> <td class="org-left">&#xa0;</td>
<td class="org-left">Number of &uarr;-spin electrons</td> <td class="org-left">Number of &uarr;-spin electrons</td>
</tr> </tr>
<tr> <tr>
<td class="org-left"><code>dn_num</code></td> <td class="org-left"><code>dn_num</code></td>
<td class="org-left"><code>int</code></td> <td class="org-left"><code>dim</code></td>
<td class="org-left">&#xa0;</td> <td class="org-left">&#xa0;</td>
<td class="org-left">Number of &darr;-spin electrons</td> <td class="org-left">Number of &darr;-spin electrons</td>
</tr> </tr>
@ -511,15 +521,15 @@ the number of &uarr; and &darr; electrons is fixed.
</div> </div>
</div> </div>
<div id="outline-container-orga389cc4" class="outline-2"> <div id="outline-container-org597fcf8" class="outline-2">
<h2 id="orga389cc4"><span class="section-number-2">3</span> Nucleus (nucleus group)</h2> <h2 id="org597fcf8"><span class="section-number-2">3</span> Nucleus (nucleus group)</h2>
<div class="outline-text-2" id="text-3"> <div class="outline-text-2" id="text-3">
<p> <p>
The nuclei are considered as fixed point charges. Coordinates are The nuclei are considered as fixed point charges. Coordinates are
given in Cartesian \((x,y,z)\) format. given in Cartesian \((x,y,z)\) format.
</p> </p>
<table id="org4271e24" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides"> <table id="orgc14b8fe" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup> <colgroup>
@ -542,7 +552,7 @@ given in Cartesian \((x,y,z)\) format.
<tbody> <tbody>
<tr> <tr>
<td class="org-left"><code>num</code></td> <td class="org-left"><code>num</code></td>
<td class="org-left"><code>int</code></td> <td class="org-left"><code>dim</code></td>
<td class="org-left">&#xa0;</td> <td class="org-left">&#xa0;</td>
<td class="org-left">Number of nuclei</td> <td class="org-left">Number of nuclei</td>
</tr> </tr>
@ -579,8 +589,8 @@ given in Cartesian \((x,y,z)\) format.
</div> </div>
</div> </div>
<div id="outline-container-orge373450" class="outline-2"> <div id="outline-container-org87488df" class="outline-2">
<h2 id="orge373450"><span class="section-number-2">4</span> Effective core potentials (ecp group)</h2> <h2 id="org87488df"><span class="section-number-2">4</span> Effective core potentials (ecp group)</h2>
<div class="outline-text-2" id="text-4"> <div class="outline-text-2" id="text-4">
<p> <p>
An effective core potential (ECP) \(V_A^{\text{ECP}}\) replacing the An effective core potential (ECP) \(V_A^{\text{ECP}}\) replacing the
@ -608,7 +618,7 @@ The functions \(V_{A\ell}\) are parameterized as:
See <a href="http://dx.doi.org/10.1063/1.4984046">http://dx.doi.org/10.1063/1.4984046</a> for more info. See <a href="http://dx.doi.org/10.1063/1.4984046">http://dx.doi.org/10.1063/1.4984046</a> for more info.
</p> </p>
<table id="org3e82be2" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides"> <table id="orgfd7506b" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup> <colgroup>
@ -652,7 +662,7 @@ See <a href="http://dx.doi.org/10.1063/1.4984046">http://dx.doi.org/10.1063/1.49
<tr> <tr>
<td class="org-left"><code>local_num_n_max</code></td> <td class="org-left"><code>local_num_n_max</code></td>
<td class="org-left"><code>int</code></td> <td class="org-left"><code>dim</code></td>
<td class="org-left">&#xa0;</td> <td class="org-left">&#xa0;</td>
<td class="org-left">Maximum value of <code>local_n</code>, used for dimensioning arrays</td> <td class="org-left">Maximum value of <code>local_n</code>, used for dimensioning arrays</td>
</tr> </tr>
@ -687,7 +697,7 @@ See <a href="http://dx.doi.org/10.1063/1.4984046">http://dx.doi.org/10.1063/1.49
<tr> <tr>
<td class="org-left"><code>non_local_num_n_max</code></td> <td class="org-left"><code>non_local_num_n_max</code></td>
<td class="org-left"><code>int</code></td> <td class="org-left"><code>dim</code></td>
<td class="org-left">&#xa0;</td> <td class="org-left">&#xa0;</td>
<td class="org-left">Maximum value of <code>non_local_n</code>, used for dimensioning arrays</td> <td class="org-left">Maximum value of <code>non_local_n</code>, used for dimensioning arrays</td>
</tr> </tr>
@ -717,8 +727,8 @@ See <a href="http://dx.doi.org/10.1063/1.4984046">http://dx.doi.org/10.1063/1.49
</div> </div>
</div> </div>
<div id="outline-container-org9b59ff1" class="outline-2"> <div id="outline-container-org0791ffe" class="outline-2">
<h2 id="org9b59ff1"><span class="section-number-2">5</span> Basis set (basis group)</h2> <h2 id="org0791ffe"><span class="section-number-2">5</span> Basis set (basis group)</h2>
<div class="outline-text-2" id="text-5"> <div class="outline-text-2" id="text-5">
<p> <p>
We consider here basis functions centered on nuclei. Hence, we enable We consider here basis functions centered on nuclei. Hence, we enable
@ -771,7 +781,7 @@ If the the basis function is not considered normalized, \(\mathcal{N}_s=1\).
All the basis set parameters are stored in one-dimensional arrays: All the basis set parameters are stored in one-dimensional arrays:
</p> </p>
<table id="org7bbfbca" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides"> <table id="org8a64b8c" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup> <colgroup>
@ -801,14 +811,14 @@ All the basis set parameters are stored in one-dimensional arrays:
<tr> <tr>
<td class="org-left"><code>num</code></td> <td class="org-left"><code>num</code></td>
<td class="org-left"><code>int</code></td> <td class="org-left"><code>dim</code></td>
<td class="org-left">&#xa0;</td> <td class="org-left">&#xa0;</td>
<td class="org-left">Total Number of shells</td> <td class="org-left">Total Number of shells</td>
</tr> </tr>
<tr> <tr>
<td class="org-left"><code>prim_num</code></td> <td class="org-left"><code>prim_num</code></td>
<td class="org-left"><code>int</code></td> <td class="org-left"><code>dim</code></td>
<td class="org-left">&#xa0;</td> <td class="org-left">&#xa0;</td>
<td class="org-left">Total number of primitives</td> <td class="org-left">Total number of primitives</td>
</tr> </tr>
@ -940,8 +950,8 @@ prim_factor =
</div> </div>
</div> </div>
<div id="outline-container-orged437c1" class="outline-2"> <div id="outline-container-org4666864" class="outline-2">
<h2 id="orged437c1"><span class="section-number-2">6</span> Atomic orbitals (ao group)</h2> <h2 id="org4666864"><span class="section-number-2">6</span> Atomic orbitals (ao group)</h2>
<div class="outline-text-2" id="text-6"> <div class="outline-text-2" id="text-6">
<p> <p>
Going from the atomic basis set to AOs implies a systematic Going from the atomic basis set to AOs implies a systematic
@ -989,13 +999,13 @@ shell, as in the GAMESS convention where
<p> <p>
In such a case, one should set the normalization of the shell (in In such a case, one should set the normalization of the shell (in
the <a href="#org9b59ff1">Basis set</a> section) to \(\mathcal{N}_{z^2}\), which is the the <a href="#org0791ffe">Basis set</a> section) to \(\mathcal{N}_{z^2}\), which is the
normalization factor of the atomic orbitals in spherical coordinates. normalization factor of the atomic orbitals in spherical coordinates.
The normalization factor of the \(xy\) function which should be The normalization factor of the \(xy\) function which should be
introduced here should be \(\frac{\mathcal{N}_{xy}}{\mathcal{N}_{z^2}}\). introduced here should be \(\frac{\mathcal{N}_{xy}}{\mathcal{N}_{z^2}}\).
</p> </p>
<table id="orge2b99d5" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides"> <table id="orgfdf45f4" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup> <colgroup>
@ -1025,7 +1035,7 @@ introduced here should be \(\frac{\mathcal{N}_{xy}}{\mathcal{N}_{z^2}}\).
<tr> <tr>
<td class="org-left"><code>num</code></td> <td class="org-left"><code>num</code></td>
<td class="org-left"><code>int</code></td> <td class="org-left"><code>dim</code></td>
<td class="org-left">&#xa0;</td> <td class="org-left">&#xa0;</td>
<td class="org-left">Total number of atomic orbitals</td> <td class="org-left">Total number of atomic orbitals</td>
</tr> </tr>
@ -1047,8 +1057,8 @@ introduced here should be \(\frac{\mathcal{N}_{xy}}{\mathcal{N}_{z^2}}\).
</table> </table>
</div> </div>
<div id="outline-container-orgcaa1ff2" class="outline-3"> <div id="outline-container-org15c6107" class="outline-3">
<h3 id="ao_one_e"><a id="orgcaa1ff2"></a><span class="section-number-3">6.1</span> One-electron integrals (<code>ao_1e_int</code> group)</h3> <h3 id="ao_one_e"><a id="org15c6107"></a><span class="section-number-3">6.1</span> One-electron integrals (<code>ao_1e_int</code> group)</h3>
<div class="outline-text-3" id="text-ao_one_e"> <div class="outline-text-3" id="text-ao_one_e">
<ul class="org-ul"> <ul class="org-ul">
<li>\[ \hat{V}_{\text{ne}} = \sum_{A=1}^{N_\text{nucl}} <li>\[ \hat{V}_{\text{ne}} = \sum_{A=1}^{N_\text{nucl}}
@ -1066,7 +1076,7 @@ The one-electron integrals for a one-electron operator \(\hat{O}\) are
over atomic orbitals. over atomic orbitals.
</p> </p>
<table id="org508a477" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides"> <table id="org3bc1d9c" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup> <colgroup>
@ -1133,8 +1143,8 @@ over atomic orbitals.
</div> </div>
</div> </div>
<div id="outline-container-org19a3d73" class="outline-3"> <div id="outline-container-orgdf4e873" class="outline-3">
<h3 id="ao_two_e"><a id="org19a3d73"></a><span class="section-number-3">6.2</span> Two-electron integrals (<code>ao_2e_int</code> group)</h3> <h3 id="ao_two_e"><a id="orgdf4e873"></a><span class="section-number-3">6.2</span> Two-electron integrals (<code>ao_2e_int</code> group)</h3>
<div class="outline-text-3" id="text-ao_two_e"> <div class="outline-text-3" id="text-ao_two_e">
<p> <p>
The two-electron integrals for a two-electron operator \(\hat{O}\) are The two-electron integrals for a two-electron operator \(\hat{O}\) are
@ -1155,7 +1165,7 @@ notation.
\mathbf{r}_j \vert)}{\vert \mathbf{r}_i - \mathbf{r}_j \vert} \] : electron-electron long range potential</li> \mathbf{r}_j \vert)}{\vert \mathbf{r}_i - \mathbf{r}_j \vert} \] : electron-electron long range potential</li>
</ul> </ul>
<table id="org095dd51" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides"> <table id="orgc46ab51" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup> <colgroup>
@ -1195,10 +1205,10 @@ notation.
</div> </div>
</div> </div>
<div id="outline-container-orgbb85665" class="outline-2"> <div id="outline-container-orgc2e724a" class="outline-2">
<h2 id="orgbb85665"><span class="section-number-2">7</span> Molecular orbitals (mo group)</h2> <h2 id="orgc2e724a"><span class="section-number-2">7</span> Molecular orbitals (mo group)</h2>
<div class="outline-text-2" id="text-7"> <div class="outline-text-2" id="text-7">
<table id="orgad0e1ed" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides"> <table id="orgf858b0b" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup> <colgroup>
@ -1228,7 +1238,7 @@ notation.
<tr> <tr>
<td class="org-left"><code>num</code></td> <td class="org-left"><code>num</code></td>
<td class="org-left"><code>int</code></td> <td class="org-left"><code>dim</code></td>
<td class="org-left">&#xa0;</td> <td class="org-left">&#xa0;</td>
<td class="org-left">Number of MOs</td> <td class="org-left">Number of MOs</td>
</tr> </tr>
@ -1264,8 +1274,8 @@ notation.
</table> </table>
</div> </div>
<div id="outline-container-orgff9b4c2" class="outline-3"> <div id="outline-container-org7dae4a0" class="outline-3">
<h3 id="orgff9b4c2"><span class="section-number-3">7.1</span> One-electron integrals (<code>mo_1e_int</code> group)</h3> <h3 id="org7dae4a0"><span class="section-number-3">7.1</span> One-electron integrals (<code>mo_1e_int</code> group)</h3>
<div class="outline-text-3" id="text-7-1"> <div class="outline-text-3" id="text-7-1">
<p> <p>
The operators as the same as those defined in the The operators as the same as those defined in the
@ -1273,7 +1283,7 @@ The operators as the same as those defined in the
the basis of molecular orbitals. the basis of molecular orbitals.
</p> </p>
<table id="org276731f" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides"> <table id="org51eb58d" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup> <colgroup>
@ -1340,8 +1350,8 @@ the basis of molecular orbitals.
</div> </div>
</div> </div>
<div id="outline-container-org6aedef6" class="outline-3"> <div id="outline-container-org68387d3" class="outline-3">
<h3 id="org6aedef6"><span class="section-number-3">7.2</span> Two-electron integrals (<code>mo_2e_int</code> group)</h3> <h3 id="org68387d3"><span class="section-number-3">7.2</span> Two-electron integrals (<code>mo_2e_int</code> group)</h3>
<div class="outline-text-3" id="text-7-2"> <div class="outline-text-3" id="text-7-2">
<p> <p>
The operators as the same as those defined in the The operators as the same as those defined in the
@ -1349,7 +1359,7 @@ The operators as the same as those defined in the
the basis of molecular orbitals. the basis of molecular orbitals.
</p> </p>
<table id="org91cfad3" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides"> <table id="orgb953cb5" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup> <colgroup>
@ -1389,13 +1399,13 @@ the basis of molecular orbitals.
</div> </div>
</div> </div>
<div id="outline-container-orgd7378f6" class="outline-2"> <div id="outline-container-org7a75fad" class="outline-2">
<h2 id="orgd7378f6"><span class="section-number-2">8</span> <span class="todo TODO">TODO</span> Slater determinants</h2> <h2 id="org7a75fad"><span class="section-number-2">8</span> <span class="todo TODO">TODO</span> Slater determinants</h2>
</div> </div>
<div id="outline-container-orgb3124cb" class="outline-2"> <div id="outline-container-orgf1a2f70" class="outline-2">
<h2 id="orgb3124cb"><span class="section-number-2">9</span> <span class="todo TODO">TODO</span> Reduced density matrices (rdm group)</h2> <h2 id="orgf1a2f70"><span class="section-number-2">9</span> <span class="todo TODO">TODO</span> Reduced density matrices (rdm group)</h2>
<div class="outline-text-2" id="text-9"> <div class="outline-text-2" id="text-9">
<table id="orgf4ea161" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides"> <table id="org7a1d0c4" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup> <colgroup>
@ -1448,15 +1458,15 @@ the basis of molecular orbitals.
</div> </div>
</div> </div>
<div id="outline-container-org951d21b" class="outline-2"> <div id="outline-container-orgf5c229e" class="outline-2">
<h2 id="org951d21b"><span class="section-number-2">10</span> Appendix</h2> <h2 id="orgf5c229e"><span class="section-number-2">10</span> Appendix</h2>
<div class="outline-text-2" id="text-10"> <div class="outline-text-2" id="text-10">
</div> </div>
<div id="outline-container-orgbd76282" class="outline-3"> <div id="outline-container-orgf7576f4" class="outline-3">
<h3 id="orgbd76282"><span class="section-number-3">10.1</span> Python script from table to json</h3> <h3 id="orgf7576f4"><span class="section-number-3">10.1</span> Python script from table to json</h3>
<div class="outline-text-3" id="text-10-1"> <div class="outline-text-3" id="text-10-1">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-python" id="org55db609"><span style="color: #a020f0;">print</span>(<span style="color: #8b2252;">"""#+begin_src python :tangle trex.json"""</span>) <pre class="src src-python" id="org6318b64"><span style="color: #a020f0;">print</span>(<span style="color: #8b2252;">"""#+begin_src python :tangle trex.json"""</span>)
<span style="color: #a020f0;">print</span>(<span style="color: #8b2252;">""" "%s": {"""</span>%(title)) <span style="color: #a020f0;">print</span>(<span style="color: #8b2252;">""" "%s": {"""</span>%(title))
<span style="color: #a0522d;">indent</span> = <span style="color: #8b2252;">" "</span> <span style="color: #a0522d;">indent</span> = <span style="color: #8b2252;">" "</span>
<span style="color: #a0522d;">f1</span> = 0 ; <span style="color: #a0522d;">f2</span> = 0 ; <span style="color: #a0522d;">f3</span> = 0 <span style="color: #a0522d;">f1</span> = 0 ; <span style="color: #a0522d;">f2</span> = 0 ; <span style="color: #a0522d;">f3</span> = 0
@ -1509,7 +1519,7 @@ the basis of molecular orbitals.
</div> </div>
<div id="postamble" class="status"> <div id="postamble" class="status">
<p class="author">Author: TREX-CoE</p> <p class="author">Author: TREX-CoE</p>
<p class="date">Created: 2021-09-16 Thu 14:47</p> <p class="date">Created: 2021-09-22 Wed 11:34</p>
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p> <p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div> </div>
</body> </body>

File diff suppressed because one or more lines are too long