<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<section xmlns="http://docbook.org/ns/docbook" version="5.0" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="_rwmodel__param_8h">
<title>/Users/bernard/b20/bsoft/include/rwmodel_param.h File Reference</title>
<indexterm><primary>/Users/bernard/b20/bsoft/include/rwmodel_param.h</primary></indexterm>
<para>

<para>Header to read and write model dynamics parameters in STAR format. </para>
 
</para>
<programlisting>#include &quot;rwmodel.h&quot;
</programlisting><simplesect>
    <title>Classes    </title>
        <itemizedlist>
            <listitem><para>struct <link linkend="_struct_bmodparam">Bmodparam</link></para>
</listitem>
        </itemizedlist>
</simplesect>
<simplesect>
    <title>Macros    </title>
        <itemizedlist>
            <listitem><para>#define <link linkend="_rwmodel__param_8h_1a9b6952fee51f90461129a53a8aba47bf">DISTMAT_COMPTYPE1</link>   &quot;distance_matrix.component_type1&quot;</para>
</listitem>
            <listitem><para>#define <link linkend="_rwmodel__param_8h_1a7963f63adceb9428741a9530102935d1">DISTMAT_COMPTYPE2</link>   &quot;distance_matrix.component_type2&quot;</para>
</listitem>
            <listitem><para>#define <link linkend="_rwmodel__param_8h_1a3b172492e7b0dd9dd2be3d025fa6e9d3">DISTMAT_LLEN</link>   &quot;distance_matrix.link_length&quot;</para>
</listitem>
            <listitem><para>#define <link linkend="_rwmodel__param_8h_1a08438a157c46f601d34838734696ce9c">DISTMAT_DIST</link>   &quot;distance_matrix.distance&quot;</para>
</listitem>
            <listitem><para>#define <link linkend="_rwmodel__param_8h_1ab30523009496d2b2784b921f3e2d9e84">DISTMAT_KL</link>   &quot;distance_matrix.link_constant&quot;</para>
</listitem>
            <listitem><para>#define <link linkend="_rwmodel__param_8h_1a47a6d8c128ea34d4650b5ded267848b4">DISTMAT_KD</link>   &quot;distance_matrix.distance_constant&quot;</para>
</listitem>
            <listitem><para>#define <link linkend="_rwmodel__param_8h_1a68c15f3405430e41743d999609ded8f1">DISTMAT_POTTYPE</link>   &quot;distance_matrix.potential_type&quot;</para>
</listitem>
            <listitem><para>#define <link linkend="_rwmodel__param_8h_1a326716cdd8b82ef8801f07a473d5bbfd">ANGLEMAT_COMPTYPE1</link>   &quot;angle_matrix.component_type1&quot;</para>
</listitem>
            <listitem><para>#define <link linkend="_rwmodel__param_8h_1acc854ac5fbdae72e16814630f8f9dcf6">ANGLEMAT_COMPTYPE2</link>   &quot;angle_matrix.component_type2&quot;</para>
</listitem>
            <listitem><para>#define <link linkend="_rwmodel__param_8h_1a6d3211f81a8fbbf1c167c3ec97f9d060">ANGLEMAT_COMPTYPE3</link>   &quot;angle_matrix.component_type3&quot;</para>
</listitem>
            <listitem><para>#define <link linkend="_rwmodel__param_8h_1a977f87fd418be40e08661cce42212b43">ANGLEMAT_ANGLE</link>   &quot;angle_matrix.angle&quot;</para>
</listitem>
            <listitem><para>#define <link linkend="_rwmodel__param_8h_1a2fae83ceeec456162e0de33aee6b0c7b">ANGLEMAT_KA</link>   &quot;angle_matrix.angle_constant&quot;</para>
</listitem>
        </itemizedlist>
</simplesect>
<simplesect>
    <title>Functions    </title>
        <itemizedlist>
            <listitem><para><link linkend="_struct_bmodparam">Bmodparam</link> * <link linkend="_rwmodel__param_8h_1a193915e61035be6e15aee4c63f876236">model_param_init</link> (int num)</para>

<para>Initializes a model parameter structure and allocates memory. </para>
</listitem>
            <listitem><para>int <link linkend="_rwmodel__param_8h_1a42f14e2510bb898c04b488d4a976d007">model_param_kill</link> (<link linkend="_struct_bmodparam">Bmodparam</link> *mp)</para>

<para>Deallocates memory for a model parameter structure. </para>
</listitem>
            <listitem><para><link linkend="_struct_bmodparam">Bmodparam</link> * <link linkend="_rwmodel__param_8h_1a36e77c46c172085c0151ac22bfae0333">model_param_read</link> (<link linkend="_class_bstring">Bstring</link> &amp;filename)</para>

<para>Reads a model parameter file. </para>
</listitem>
            <listitem><para>int <link linkend="_rwmodel__param_8h_1a10dd41497da2449920c3343f38b952c8">model_param_write</link> (<link linkend="_class_bstring">Bstring</link> &amp;filename, <link linkend="_struct_bmodparam">Bmodparam</link> *mp)</para>

<para>Writes a model parameter file. </para>
</listitem>
            <listitem><para>int <link linkend="_rwmodel__param_8h_1acecdc284e5aca1e78c0431d43af65133">model_param_display</link> (<link linkend="_struct_bmodparam">Bmodparam</link> *mp)</para>

<para>Displays a model parameter in the shell. </para>
</listitem>
            <listitem><para><link linkend="_struct_bmodparam">Bmodparam</link> * <link linkend="_rwmodel__param_8h_1afcbcfddbea1f6abd5e7615eeb0e20af9">model_param_generate</link> (<link linkend="_struct_bmodel">Bmodel</link> *<link linkend="_tcltk__bmodel_8cpp_1a828359eaa8de833b547ac96934f43841">model</link>)</para>

<para>Generates a model parameter file from a model. </para>
</listitem>
            <listitem><para>int <link linkend="_rwmodel__param_8h_1a84de59b9c168a3af8b87118b0684056d">model_param_set_type_indices</link> (<link linkend="_struct_bmodel">Bmodel</link> *<link linkend="_tcltk__bmodel_8cpp_1a828359eaa8de833b547ac96934f43841">model</link>, <link linkend="_struct_bmodparam">Bmodparam</link> *mp)</para>

<para>Sets the component type indices from the model parameters. </para>
</listitem>
        </itemizedlist>
</simplesect>
<section>
<title>Detailed Description</title>

<para>Header to read and write model dynamics parameters in STAR format. </para>

<para><formalpara><title>Author: </title>

<para>Bernard Heymann </para>
</formalpara>
<formalpara><title>Date: </title>

<para>Created: 20100305 </para>

<para>Modified: 20100423 </para>
</formalpara>
</para>
</section>
<section>
<title>Macro Definition Documentation</title>
<anchor xml:id="_rwmodel__param_8h_1a977f87fd418be40e08661cce42212b43"/>    <section>
    <title>ANGLEMAT_ANGLE</title>
<indexterm><primary>ANGLEMAT_ANGLE</primary><secondary>rwmodel_param.h</secondary></indexterm>
<indexterm><primary>rwmodel_param.h</primary><secondary>ANGLEMAT_ANGLE</secondary></indexterm>
<para><computeroutput>#define ANGLEMAT_ANGLE   &quot;angle_matrix.angle&quot;</computeroutput></para><para>
Definition at line 24 of file rwmodel_param.h.</para>
    </section><anchor xml:id="_rwmodel__param_8h_1a326716cdd8b82ef8801f07a473d5bbfd"/>    <section>
    <title>ANGLEMAT_COMPTYPE1</title>
<indexterm><primary>ANGLEMAT_COMPTYPE1</primary><secondary>rwmodel_param.h</secondary></indexterm>
<indexterm><primary>rwmodel_param.h</primary><secondary>ANGLEMAT_COMPTYPE1</secondary></indexterm>
<para><computeroutput>#define ANGLEMAT_COMPTYPE1   &quot;angle_matrix.component_type1&quot;</computeroutput></para><para>
Definition at line 21 of file rwmodel_param.h.</para>
    </section><anchor xml:id="_rwmodel__param_8h_1acc854ac5fbdae72e16814630f8f9dcf6"/>    <section>
    <title>ANGLEMAT_COMPTYPE2</title>
<indexterm><primary>ANGLEMAT_COMPTYPE2</primary><secondary>rwmodel_param.h</secondary></indexterm>
<indexterm><primary>rwmodel_param.h</primary><secondary>ANGLEMAT_COMPTYPE2</secondary></indexterm>
<para><computeroutput>#define ANGLEMAT_COMPTYPE2   &quot;angle_matrix.component_type2&quot;</computeroutput></para><para>
Definition at line 22 of file rwmodel_param.h.</para>
    </section><anchor xml:id="_rwmodel__param_8h_1a6d3211f81a8fbbf1c167c3ec97f9d060"/>    <section>
    <title>ANGLEMAT_COMPTYPE3</title>
<indexterm><primary>ANGLEMAT_COMPTYPE3</primary><secondary>rwmodel_param.h</secondary></indexterm>
<indexterm><primary>rwmodel_param.h</primary><secondary>ANGLEMAT_COMPTYPE3</secondary></indexterm>
<para><computeroutput>#define ANGLEMAT_COMPTYPE3   &quot;angle_matrix.component_type3&quot;</computeroutput></para><para>
Definition at line 23 of file rwmodel_param.h.</para>
    </section><anchor xml:id="_rwmodel__param_8h_1a2fae83ceeec456162e0de33aee6b0c7b"/>    <section>
    <title>ANGLEMAT_KA</title>
<indexterm><primary>ANGLEMAT_KA</primary><secondary>rwmodel_param.h</secondary></indexterm>
<indexterm><primary>rwmodel_param.h</primary><secondary>ANGLEMAT_KA</secondary></indexterm>
<para><computeroutput>#define ANGLEMAT_KA   &quot;angle_matrix.angle_constant&quot;</computeroutput></para><para>
Definition at line 25 of file rwmodel_param.h.</para>
    </section><anchor xml:id="_rwmodel__param_8h_1a9b6952fee51f90461129a53a8aba47bf"/>    <section>
    <title>DISTMAT_COMPTYPE1</title>
<indexterm><primary>DISTMAT_COMPTYPE1</primary><secondary>rwmodel_param.h</secondary></indexterm>
<indexterm><primary>rwmodel_param.h</primary><secondary>DISTMAT_COMPTYPE1</secondary></indexterm>
<para><computeroutput>#define DISTMAT_COMPTYPE1   &quot;distance_matrix.component_type1&quot;</computeroutput></para><para>
Definition at line 13 of file rwmodel_param.h.</para>
    </section><anchor xml:id="_rwmodel__param_8h_1a7963f63adceb9428741a9530102935d1"/>    <section>
    <title>DISTMAT_COMPTYPE2</title>
<indexterm><primary>DISTMAT_COMPTYPE2</primary><secondary>rwmodel_param.h</secondary></indexterm>
<indexterm><primary>rwmodel_param.h</primary><secondary>DISTMAT_COMPTYPE2</secondary></indexterm>
<para><computeroutput>#define DISTMAT_COMPTYPE2   &quot;distance_matrix.component_type2&quot;</computeroutput></para><para>
Definition at line 14 of file rwmodel_param.h.</para>
    </section><anchor xml:id="_rwmodel__param_8h_1a08438a157c46f601d34838734696ce9c"/>    <section>
    <title>DISTMAT_DIST</title>
<indexterm><primary>DISTMAT_DIST</primary><secondary>rwmodel_param.h</secondary></indexterm>
<indexterm><primary>rwmodel_param.h</primary><secondary>DISTMAT_DIST</secondary></indexterm>
<para><computeroutput>#define DISTMAT_DIST   &quot;distance_matrix.distance&quot;</computeroutput></para><para>
Definition at line 16 of file rwmodel_param.h.</para>
    </section><anchor xml:id="_rwmodel__param_8h_1a47a6d8c128ea34d4650b5ded267848b4"/>    <section>
    <title>DISTMAT_KD</title>
<indexterm><primary>DISTMAT_KD</primary><secondary>rwmodel_param.h</secondary></indexterm>
<indexterm><primary>rwmodel_param.h</primary><secondary>DISTMAT_KD</secondary></indexterm>
<para><computeroutput>#define DISTMAT_KD   &quot;distance_matrix.distance_constant&quot;</computeroutput></para><para>
Definition at line 18 of file rwmodel_param.h.</para>
    </section><anchor xml:id="_rwmodel__param_8h_1ab30523009496d2b2784b921f3e2d9e84"/>    <section>
    <title>DISTMAT_KL</title>
<indexterm><primary>DISTMAT_KL</primary><secondary>rwmodel_param.h</secondary></indexterm>
<indexterm><primary>rwmodel_param.h</primary><secondary>DISTMAT_KL</secondary></indexterm>
<para><computeroutput>#define DISTMAT_KL   &quot;distance_matrix.link_constant&quot;</computeroutput></para><para>
Definition at line 17 of file rwmodel_param.h.</para>
    </section><anchor xml:id="_rwmodel__param_8h_1a3b172492e7b0dd9dd2be3d025fa6e9d3"/>    <section>
    <title>DISTMAT_LLEN</title>
<indexterm><primary>DISTMAT_LLEN</primary><secondary>rwmodel_param.h</secondary></indexterm>
<indexterm><primary>rwmodel_param.h</primary><secondary>DISTMAT_LLEN</secondary></indexterm>
<para><computeroutput>#define DISTMAT_LLEN   &quot;distance_matrix.link_length&quot;</computeroutput></para><para>
Definition at line 15 of file rwmodel_param.h.</para>
    </section><anchor xml:id="_rwmodel__param_8h_1a68c15f3405430e41743d999609ded8f1"/>    <section>
    <title>DISTMAT_POTTYPE</title>
<indexterm><primary>DISTMAT_POTTYPE</primary><secondary>rwmodel_param.h</secondary></indexterm>
<indexterm><primary>rwmodel_param.h</primary><secondary>DISTMAT_POTTYPE</secondary></indexterm>
<para><computeroutput>#define DISTMAT_POTTYPE   &quot;distance_matrix.potential_type&quot;</computeroutput></para><para>
Definition at line 19 of file rwmodel_param.h.</para>
</section>
</section>
<section>
<title>Function Documentation</title>
<anchor xml:id="_rwmodel__param_8h_1acecdc284e5aca1e78c0431d43af65133"/>    <section>
    <title>model_param_display()</title>
<indexterm><primary>model_param_display</primary><secondary>rwmodel_param.h</secondary></indexterm>
<indexterm><primary>rwmodel_param.h</primary><secondary>model_param_display</secondary></indexterm>
<para><computeroutput>int model_param_display (<link linkend="_struct_bmodparam">Bmodparam</link> * mp)</computeroutput></para><para>

<para>Displays a model parameter in the shell. </para>
</para>

<para>
                <formalpara>
                    <title>
Parameters                    </title>
                    <para>
                    <table frame="all">
                        <tgroup cols="2" align="left" colsep="1" rowsep="1">
                        <colspec colwidth="1*"/>
                        <colspec colwidth="4*"/>
                        <tbody>
                            <row>
                                <entry>*mp</entry>
                                <entry>
<para>model parameter structure. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>int 0. </para>
</formalpara>
</para>
<para>
Definition at line 303 of file rwmodel_param.cpp.</para>
    </section><anchor xml:id="_rwmodel__param_8h_1afcbcfddbea1f6abd5e7615eeb0e20af9"/>    <section>
    <title>model_param_generate()</title>
<indexterm><primary>model_param_generate</primary><secondary>rwmodel_param.h</secondary></indexterm>
<indexterm><primary>rwmodel_param.h</primary><secondary>model_param_generate</secondary></indexterm>
<para><computeroutput><link linkend="_struct_bmodparam">Bmodparam</link>* model_param_generate (<link linkend="_struct_bmodel">Bmodel</link> * model)</computeroutput></para><para>

<para>Generates a model parameter file from a model. </para>
</para>

<para><literallayout><computeroutput>All the types in a list of models are collated into a string list of
types for a new model parameter structure.
The distances between component types in the matrix is set to the
smallest such distance between components of the relevant types.
The distance constant is set to 1.
The distance potential type is set to 2 (soft sphere).
</computeroutput></literallayout></para>

<para>
                <formalpara>
                    <title>
Parameters                    </title>
                    <para>
                    <table frame="all">
                        <tgroup cols="2" align="left" colsep="1" rowsep="1">
                        <colspec colwidth="1*"/>
                        <colspec colwidth="4*"/>
                        <tbody>
                            <row>
                                <entry>*model</entry>
                                <entry>
<para>linked list of models. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>Bmodparam* new model parameter structure. </para>
</formalpara>
</para>
<para>
Definition at line 374 of file rwmodel_param.cpp.</para>
    </section><anchor xml:id="_rwmodel__param_8h_1a193915e61035be6e15aee4c63f876236"/>    <section>
    <title>model_param_init()</title>
<indexterm><primary>model_param_init</primary><secondary>rwmodel_param.h</secondary></indexterm>
<indexterm><primary>rwmodel_param.h</primary><secondary>model_param_init</secondary></indexterm>
<para><computeroutput><link linkend="_struct_bmodparam">Bmodparam</link>* model_param_init (int num)</computeroutput></para><para>

<para>Initializes a model parameter structure and allocates memory. </para>
</para>

<para>
                <formalpara>
                    <title>
Parameters                    </title>
                    <para>
                    <table frame="all">
                        <tgroup cols="2" align="left" colsep="1" rowsep="1">
                        <colspec colwidth="1*"/>
                        <colspec colwidth="4*"/>
                        <tbody>
                            <row>
                                <entry>num</entry>
                                <entry>
<para>number of component types. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>Bmodparam* new distance matrix structure. </para>
</formalpara>
</para>
<para>
Definition at line 23 of file rwmodel_param.cpp.</para>
    </section><anchor xml:id="_rwmodel__param_8h_1a42f14e2510bb898c04b488d4a976d007"/>    <section>
    <title>model_param_kill()</title>
<indexterm><primary>model_param_kill</primary><secondary>rwmodel_param.h</secondary></indexterm>
<indexterm><primary>rwmodel_param.h</primary><secondary>model_param_kill</secondary></indexterm>
<para><computeroutput>int model_param_kill (<link linkend="_struct_bmodparam">Bmodparam</link> * mp)</computeroutput></para><para>

<para>Deallocates memory for a model parameter structure. </para>
</para>

<para>
                <formalpara>
                    <title>
Parameters                    </title>
                    <para>
                    <table frame="all">
                        <tgroup cols="2" align="left" colsep="1" rowsep="1">
                        <colspec colwidth="1*"/>
                        <colspec colwidth="4*"/>
                        <tbody>
                            <row>
                                <entry>*mp</entry>
                                <entry>
<para>model parameter structure. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>int 0. </para>
</formalpara>
</para>
<para>
Definition at line 50 of file rwmodel_param.cpp.</para>
    </section><anchor xml:id="_rwmodel__param_8h_1a36e77c46c172085c0151ac22bfae0333"/>    <section>
    <title>model_param_read()</title>
<indexterm><primary>model_param_read</primary><secondary>rwmodel_param.h</secondary></indexterm>
<indexterm><primary>rwmodel_param.h</primary><secondary>model_param_read</secondary></indexterm>
<para><computeroutput><link linkend="_struct_bmodparam">Bmodparam</link>* model_param_read (<link linkend="_class_bstring">Bstring</link> &amp; filename)</computeroutput></para><para>

<para>Reads a model parameter file. </para>
</para>

<para><literallayout><computeroutput>The only format supported is a STAR format.
</computeroutput></literallayout></para>

<para>
                <formalpara>
                    <title>
Parameters                    </title>
                    <para>
                    <table frame="all">
                        <tgroup cols="2" align="left" colsep="1" rowsep="1">
                        <colspec colwidth="1*"/>
                        <colspec colwidth="4*"/>
                        <tbody>
                            <row>
                                <entry>&amp;filename</entry>
                                <entry>
<para>file name. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>Bmodparam* new model parameter structure. </para>
</formalpara>
</para>
<para>
Definition at line 79 of file rwmodel_param.cpp.</para>
    </section><anchor xml:id="_rwmodel__param_8h_1a84de59b9c168a3af8b87118b0684056d"/>    <section>
    <title>model_param_set_type_indices()</title>
<indexterm><primary>model_param_set_type_indices</primary><secondary>rwmodel_param.h</secondary></indexterm>
<indexterm><primary>rwmodel_param.h</primary><secondary>model_param_set_type_indices</secondary></indexterm>
<para><computeroutput>int model_param_set_type_indices (<link linkend="_struct_bmodel">Bmodel</link> * model, <link linkend="_struct_bmodparam">Bmodparam</link> * mp)</computeroutput></para><para>

<para>Sets the component type indices from the model parameters. </para>
</para>

<para><literallayout><computeroutput>The position of a type in the distance matrix type list determines
the type index within the distance matrix itself.
The indices of the component types within each model is then set
to the corresponding index for the distance matrix.
If the type is not represented in the distance matrix, its index
is set to -1.
</computeroutput></literallayout></para>

<para>
                <formalpara>
                    <title>
Parameters                    </title>
                    <para>
                    <table frame="all">
                        <tgroup cols="2" align="left" colsep="1" rowsep="1">
                        <colspec colwidth="1*"/>
                        <colspec colwidth="4*"/>
                        <tbody>
                            <row>
                                <entry>*model</entry>
                                <entry>
<para>linked list of models. </para>
</entry>
                            </row>
                            <row>
                                <entry>*mp</entry>
                                <entry>
<para>model parameter structure. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>int 0. </para>
</formalpara>
</para>
<para>
Definition at line 491 of file rwmodel_param.cpp.</para>
    </section><anchor xml:id="_rwmodel__param_8h_1a10dd41497da2449920c3343f38b952c8"/>    <section>
    <title>model_param_write()</title>
<indexterm><primary>model_param_write</primary><secondary>rwmodel_param.h</secondary></indexterm>
<indexterm><primary>rwmodel_param.h</primary><secondary>model_param_write</secondary></indexterm>
<para><computeroutput>int model_param_write (<link linkend="_class_bstring">Bstring</link> &amp; filename, <link linkend="_struct_bmodparam">Bmodparam</link> * mp)</computeroutput></para><para>

<para>Writes a model parameter file. </para>
</para>

<para><literallayout><computeroutput>The only format supported is a STAR format.
</computeroutput></literallayout></para>

<para>
                <formalpara>
                    <title>
Parameters                    </title>
                    <para>
                    <table frame="all">
                        <tgroup cols="2" align="left" colsep="1" rowsep="1">
                        <colspec colwidth="1*"/>
                        <colspec colwidth="4*"/>
                        <tbody>
                            <row>
                                <entry>&amp;filename</entry>
                                <entry>
<para>file name. </para>
</entry>
                            </row>
                            <row>
                                <entry>*mp</entry>
                                <entry>
<para>model parameter structure. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>int 0. </para>
</formalpara>
</para>
<para>
Definition at line 233 of file rwmodel_param.cpp.</para>
</section>
</section>
</section>
