ESPResSo 3.2.0-11-g9950804-git
Extensible Simulation Package for Soft Matter Research
Functions
tab.c File Reference

Implementation of tab.h. More...

#include "tab.h"
#include "communication.h"
Include dependency graph for tab.c:

Go to the source code of this file.

Functions

int tabulated_set_params (int part_type_a, int part_type_b, char *filename)
 Non-Bonded tabulated potentials: Reads tabulated parameters and force and energy tables from a file.
int tabulated_bonded_set_params (int bond_type, int tab_type, char *filename)
 Bonded tabulated potentials: Reads tabulated parameters and force and energy tables from a file.
void check_tab_forcecap (double forcecap)
 check the tabulated forcecap to see that it is sensible

Detailed Description

Implementation of tab.h.

Definition in file tab.c.


Function Documentation

void check_tab_forcecap ( double  force_cap)

check the tabulated forcecap to see that it is sensible

Warning:
This routine will probably give strange results if forcecap is applied before the table is loaded. Needs feature TABULATED compiled in (see config.h).

Definition at line 199 of file tab.c.

References DoubleList::e, errexit(), force_cap, get_ia_param(), i, DoubleList::max, n_particle_types, IA_parameters::TAB_maxval, IA_parameters::TAB_npoints, IA_parameters::TAB_startindex, and tabulated_forces.

int tabulated_bonded_set_params ( int  bond_type,
int  tab_type,
char *  filename 
)

Bonded tabulated potentials: Reads tabulated parameters and force and energy tables from a file.

ia_params and force/energy tables are then communicated to each node.

Parameters:
bond_typebond type for which the interaction is defined
tab_typetable type, TAB_BOND_LENGTH, TAB_BOND_ANGLE, TAB_BOND_DIHEDRAL
filenamefrom which file to fetch the data
Returns:
  • 0 on success
  • 1 if wrong bond type
  • 2 currently unused
  • 3 cannot open the file
  • 4 file too short
  • 5 file broken, cannot parse numbers
  • 6 parameter out of bounds

Definition at line 112 of file tab.c.

References bonded_ia_params, BONDED_IA_TABULATED, ES_OK, i, make_bond_type_exist(), malloc, mpi_bcast_ia_params(), Bonded_ia_parameters::num, Bonded_ia_parameters::p, PI, ROUND_ERROR_PREC, Bonded_ia_parameters::tab, TAB_BOND_ANGLE, TAB_BOND_DIHEDRAL, TAB_BOND_LENGTH, and Bonded_ia_parameters::type.

Referenced by tclcommand_inter_parse_tabulated_bonded().

int tabulated_set_params ( int  part_type_a,
int  part_type_b,
char *  filename 
)

Non-Bonded tabulated potentials: Reads tabulated parameters and force and energy tables from a file.

ia_params and force/energy tables are then communicated to each node

Parameters:
part_type_aparticle type for which the interaction is defined
part_type_bparticle type for which the interaction is defined
filenamefrom which file to fetch the data
Returns:
  • 0 on success
  • 1 on particle type mismatches
  • 2 file name too long
  • 3 cannot open the file
  • 4 file too short
  • 5 file broken, cannot parse numbers
  • 6 number of points of existing potential changed

Definition at line 30 of file tab.c.

References DoubleList::e, force_cap, get_ia_param_safe(), i, DoubleList::max, MAXLENGTH_TABFILE_NAME, mpi_bcast_ia_params(), mpi_cap_forces(), realloc_doublelist(), IA_parameters::TAB_filename, IA_parameters::TAB_maxval, IA_parameters::TAB_minval, IA_parameters::TAB_npoints, IA_parameters::TAB_startindex, IA_parameters::TAB_stepsize, tabulated_energies, and tabulated_forces.

Referenced by tclcommand_inter_parse_tab().