Bsoft 2.1.4
Bernard's software package
rwmodel_param.h File Reference

Header to read and write model dynamics parameters in STAR format. More...

#include "rwmodel.h"

Classes

class  Bmodparam
 
class  Bmaterial
 

Macros

#define DISTMAT_COMPTYPE1   "distance_matrix.component_type1"
 
#define DISTMAT_COMPTYPE2   "distance_matrix.component_type2"
 
#define DISTMAT_LLEN   "distance_matrix.link_length"
 
#define DISTMAT_DIST   "distance_matrix.distance"
 
#define DISTMAT_KL   "distance_matrix.link_constant"
 
#define DISTMAT_KD   "distance_matrix.distance_constant"
 
#define DISTMAT_POTTYPE   "distance_matrix.potential_type"
 
#define ANGLEMAT_COMPTYPE1   "angle_matrix.component_type1"
 
#define ANGLEMAT_COMPTYPE2   "angle_matrix.component_type2"
 
#define ANGLEMAT_COMPTYPE3   "angle_matrix.component_type3"
 
#define ANGLEMAT_ANGLE   "angle_matrix.angle"
 
#define ANGLEMAT_KA   "angle_matrix.angle_constant"
 
#define _Bmaterial_
 
#define MATERIAL_NAME   "material.name"
 
#define MATERIAL_DENSITY   "material.density"
 
#define MATERIAL_DENS_UNIT   "material.density_unit"
 

Functions

Bmodparam model_param_generate (Bmodel *model)
 Generates a model parameter file from a model. More...
 
int model_param_generate (Bmodparam &md, Bmodel *model)
 
int model_param_set_type_indices (Bmodel *model, Bmodparam &mp)
 Sets the component type indices from the model parameters. More...
 
map< string, Bcomptyperead_atom_properties (Bstring &filename)
 
map< string, Bmaterialread_material_properties (Bstring &filename)
 
int write_material_properties (Bstring &filename, map< string, Bmaterial > material)
 
Bmodparam read_dynamics_parameters (Bstring &filename)
 Reads a model parameter file. More...
 
int update_dynamics_parameters (Bmodparam &md, Bstring &filename)
 Updates model parameters from a parameter file. More...
 
int write_dynamics_parameters (Bstring &filename, Bmodparam &md)
 Writes a model parameter file. More...
 

Detailed Description

Header to read and write model dynamics parameters in STAR format.

Author
Bernard Heymann
Date
Created: 20100305
Modified: 20210224

Macro Definition Documentation

◆ _Bmaterial_

#define _Bmaterial_

◆ ANGLEMAT_ANGLE

#define ANGLEMAT_ANGLE   "angle_matrix.angle"

◆ ANGLEMAT_COMPTYPE1

#define ANGLEMAT_COMPTYPE1   "angle_matrix.component_type1"

◆ ANGLEMAT_COMPTYPE2

#define ANGLEMAT_COMPTYPE2   "angle_matrix.component_type2"

◆ ANGLEMAT_COMPTYPE3

#define ANGLEMAT_COMPTYPE3   "angle_matrix.component_type3"

◆ ANGLEMAT_KA

#define ANGLEMAT_KA   "angle_matrix.angle_constant"

◆ DISTMAT_COMPTYPE1

#define DISTMAT_COMPTYPE1   "distance_matrix.component_type1"

◆ DISTMAT_COMPTYPE2

#define DISTMAT_COMPTYPE2   "distance_matrix.component_type2"

◆ DISTMAT_DIST

#define DISTMAT_DIST   "distance_matrix.distance"

◆ DISTMAT_KD

#define DISTMAT_KD   "distance_matrix.distance_constant"

◆ DISTMAT_KL

#define DISTMAT_KL   "distance_matrix.link_constant"

◆ DISTMAT_LLEN

#define DISTMAT_LLEN   "distance_matrix.link_length"

◆ DISTMAT_POTTYPE

#define DISTMAT_POTTYPE   "distance_matrix.potential_type"

◆ MATERIAL_DENS_UNIT

#define MATERIAL_DENS_UNIT   "material.density_unit"

◆ MATERIAL_DENSITY

#define MATERIAL_DENSITY   "material.density"

◆ MATERIAL_NAME

#define MATERIAL_NAME   "material.name"

Function Documentation

◆ model_param_generate() [1/2]

Bmodparam model_param_generate ( Bmodel model)

Generates a model parameter file from a model.

Parameters
*modellinked list of models.
Returns
Bmodparam* new model parameter structure.
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).

◆ model_param_generate() [2/2]

int model_param_generate ( Bmodparam md,
Bmodel model 
)

◆ model_param_set_type_indices()

int model_param_set_type_indices ( Bmodel model,
Bmodparam md 
)

Sets the component type indices from the model parameters.

Parameters
*modellinked list of models.
&mdmodel parameter structure.
Returns
int 0.
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.

◆ read_atom_properties()

map< string, Bcomptype > read_atom_properties ( Bstring filename)

◆ read_dynamics_parameters()

Bmodparam read_dynamics_parameters ( Bstring filename)

Reads a model parameter file.

Parameters
&filenamefile name.
Returns
Bmodparam new model parameter structure.
The only format supported is a STAR format.

◆ read_material_properties()

map< string, Bmaterial > read_material_properties ( Bstring filename)

◆ update_dynamics_parameters()

int update_dynamics_parameters ( Bmodparam md,
Bstring filename 
)

Updates model parameters from a parameter file.

Parameters
&mdmodel parameters.
&filenamefile name.
Returns
int 0.
The only format supported is a STAR format.

◆ write_dynamics_parameters()

int write_dynamics_parameters ( Bstring filename,
Bmodparam md 
)

Writes a model parameter file.

Parameters
&filenamefile name.
&mdmodel parameter structure.
Returns
int 0.

The only format supported is a STAR format.

◆ write_material_properties()

int write_material_properties ( Bstring filename,
map< string, Bmaterial material 
)