ESPResSo 3.2.0-64-g5125f6e-git
Extensible Simulation Package for Soft Matter Research
Defines | Functions
parser.h File Reference

This file contains macros for parsing the parameters to the 'inter' command. More...

#include "utils.h"
#include <string.h>
#include <tcl.h>
Include dependency graph for parser.h:

Go to the source code of this file.

Defines

#define ARG_IS_S(no, str)   !strncasecmp(argv[(no)], (str), strlen(argv[(no)]))
#define ARG0_IS_S(str)   ARG_IS_S(0, (str))
#define ARG1_IS_S(str)   ARG_IS_S(1, (str))
#define ARG_IS_S_EXACT(no, str)   !strcmp(argv[(no)], (str))
#define ARG0_IS_S_EXACT(str)   ARG_IS_S_EXACT(0, (str))
#define ARG1_IS_S_EXACT(str)   ARG_IS_S_EXACT(1, (str))
#define ARG_IS_I(no, dest)   (!(Tcl_GetInt(interp, argv[(no)], &(dest)) == TCL_ERROR))
#define ARG0_IS_I(dest)   ARG_IS_I(0, (dest))
#define ARG1_IS_I(dest)   ARG_IS_I(1, (dest))
#define ARG_IS_D(no, dest)   (!(Tcl_GetDouble(interp, argv[(no)], &(dest)) == TCL_ERROR))
#define ARG0_IS_D(dest)   ARG_IS_D(0, (dest))
#define ARG1_IS_D(dest)   ARG_IS_D(1, (dest))
#define ARG_IS_INTLIST(no, il)   (parse_int_list(interp, argv[(no)], &(il)))
#define ARG0_IS_INTLIST(il)   ARG_IS_INTLIST(0, (il))
#define ARG1_IS_INTLIST(il)   ARG_IS_INTLIST(1, (il))
#define ARG_IS_DOUBLELIST(no, il)   (parse_double_list(interp, argv[(no)], &(il)))
#define ARG0_IS_DOUBLELIST(il)   ARG_IS_DOUBLELIST(0, (il))
#define ARG1_IS_DOUBLELIST(il)   ARG_IS_DOUBLELIST(1, (il))
#define CHECK_VALUE(func, errmsg)

Functions

int parse_int_list (Tcl_Interp *interp, char *list, IntList *il)
 parse an integer list
int parse_double_list (Tcl_Interp *interp, char *list, DoubleList *dl)
 parse an double list
int gather_runtime_errors (Tcl_Interp *interp, int ret_state)
 gather all error messages from all nodes and set the interpreter result to these error messages.

Detailed Description

This file contains macros for parsing the parameters to the 'inter' command.

Definition in file parser.h.


Define Documentation

#define ARG0_IS_D (   dest)    ARG_IS_D(0, (dest))
#define ARG0_IS_DOUBLELIST (   il)    ARG_IS_DOUBLELIST(0, (il))

Definition at line 82 of file parser.h.

Referenced by tclcommand_analyze_set_parse_trapmol().

#define ARG0_IS_I (   dest)    ARG_IS_I(0, (dest))

Definition at line 70 of file parser.h.

Referenced by part_parse_vs_relate_to(), part_parse_vs_relative(), tclcommand_analyze_parse_activate(), tclcommand_analyze_parse_and_print_energy_kinetic(), tclcommand_analyze_parse_and_print_energy_kinetic_mol(), tclcommand_analyze_parse_and_print_pressure_mol(), tclcommand_analyze_parse_angularmomentum(), tclcommand_analyze_parse_bilayer_density_profile(), tclcommand_analyze_parse_centermass(), tclcommand_analyze_parse_cluster_size_dist(), tclcommand_analyze_parse_configs(), tclcommand_analyze_parse_cwvac(), tclcommand_analyze_parse_density_profile_av(), tclcommand_analyze_parse_diffusion_profile(), tclcommand_analyze_parse_distribution(), tclcommand_analyze_parse_find_principal_axis(), tclcommand_analyze_parse_gyration_tensor(), tclcommand_analyze_parse_local_stress_tensor(), tclcommand_analyze_parse_mol(), tclcommand_analyze_parse_momentofinertiamatrix(), tclcommand_analyze_parse_MSD(), tclcommand_analyze_parse_push(), tclcommand_analyze_parse_rdf(), tclcommand_analyze_parse_remove(), tclcommand_analyze_parse_replace(), tclcommand_analyze_parse_structurefactor(), tclcommand_analyze_parse_vanhove(), tclcommand_analyze_parse_vel_distr(), tclcommand_analyze_set_parse_chain_topology(), tclcommand_analyze_set_parse_trapmol(), tclcommand_correlation(), tclcommand_part_parse_bond(), tclcommand_part_parse_exclusion(), tclcommand_part_parse_mol_id(), tclcommand_part_parse_rotation(), tclcommand_part_parse_type(), and tclcommand_part_parse_virtual().

#define ARG0_IS_INTLIST (   il)    ARG_IS_INTLIST(0, (il))
#define ARG0_IS_S (   str)    ARG_IS_S(0, (str))

Definition at line 63 of file parser.h.

Referenced by correlation_print_average1(), lbnode_parse_set(), parse_corr_operation(), parse_id_list(), part_parse_gc(), tclcommand_adress_parse_set(), tclcommand_analyze_parse_and_print_dipmom_mol(), tclcommand_analyze_parse_and_print_energy(), tclcommand_analyze_parse_and_print_momentum(), tclcommand_analyze_parse_and_print_pressure(), tclcommand_analyze_parse_and_print_stress_tensor(), tclcommand_analyze_parse_bilayer_density_profile(), tclcommand_analyze_parse_bilayer_set(), tclcommand_analyze_parse_fluid_cpu(), tclcommand_analyze_parse_fluid_gpu(), tclcommand_analyze_parse_g123(), tclcommand_analyze_parse_g_av(), tclcommand_analyze_parse_get_folded_positions(), tclcommand_analyze_parse_lipid_orient_order(), tclcommand_analyze_parse_mol(), tclcommand_analyze_parse_nbhood(), tclcommand_analyze_parse_set(), tclcommand_analyze_parse_Vkappa(), tclcommand_analyze_set_parse_trapmol(), tclcommand_analyze_wallstuff(), tclcommand_correlation(), tclcommand_correlation_parse_autoupdate(), tclcommand_correlation_parse_corr(), tclcommand_correlation_parse_print(), tclcommand_cuda(), tclcommand_iccp3m(), tclcommand_inter_coulomb_parse_elc_params(), tclcommand_inter_coulomb_parse_mmm1d(), tclcommand_inter_coulomb_parse_mmm2d(), tclcommand_inter_coulomb_parse_p3m(), tclcommand_inter_coulomb_parse_p3m_opt_params(), tclcommand_inter_coulomb_parse_p3m_tune(), tclcommand_inter_magnetic_parse_dp3m(), tclcommand_inter_magnetic_parse_dp3m_opt_params(), tclcommand_inter_magnetic_parse_dp3m_tune_params(), tclcommand_inter_magnetic_parse_mdds(), tclcommand_inter_parse_bonded(), tclcommand_inter_parse_coulomb(), tclcommand_inter_parse_forcecap(), tclcommand_inter_parse_magnetic(), tclcommand_inter_parse_rest(), tclcommand_lbfluid(), tclcommand_lbnode(), tclcommand_lbnode_extforce_gpu(), tclcommand_observable_com_force(), tclcommand_observable_com_position(), tclcommand_observable_com_velocity(), tclcommand_observable_print(), tclcommand_on_collision(), tclcommand_parse_profile(), tclcommand_parse_radial_profile(), tclcommand_part_parse_bond(), tclcommand_part_parse_cmd(), tclcommand_part_parse_exclusion(), tclcommand_part_parse_mol_id(), tclcommand_part_parse_print(), and tclcommand_thermostat_parse_dpd().

#define ARG0_IS_S_EXACT (   str)    ARG_IS_S_EXACT(0, (str))

Definition at line 66 of file parser.h.

Referenced by tclcommand_part_parse_cmd(), and tclcommand_part_parse_print().

#define ARG1_IS_D (   dest)    ARG_IS_D(1, (dest))
#define ARG1_IS_DOUBLELIST (   il)    ARG_IS_DOUBLELIST(1, (il))

Definition at line 83 of file parser.h.

Referenced by tclcommand_bin().

#define ARG1_IS_I (   dest)    ARG_IS_I(1, (dest))
#define ARG1_IS_INTLIST (   il)    ARG_IS_INTLIST(1, (il))
#define ARG1_IS_S (   str)    ARG_IS_S(1, (str))
#define ARG1_IS_S_EXACT (   str)    ARG_IS_S_EXACT(1, (str))

Definition at line 67 of file parser.h.

#define ARG_IS_D (   no,
  dest 
)    (!(Tcl_GetDouble(interp, argv[(no)], &(dest)) == TCL_ERROR))

Definition at line 73 of file parser.h.

Referenced by lbnode_parse_set(), parse_corr_operation(), part_parse_gamma(), part_parse_temp(), tclcommand_adress_parse_set(), tclcommand_analyze_parse_aggregation(), tclcommand_analyze_parse_bilayer_density_profile(), tclcommand_analyze_parse_bilayer_set(), tclcommand_analyze_parse_cell_gpb(), tclcommand_analyze_parse_configs(), tclcommand_analyze_parse_g_av(), tclcommand_analyze_parse_get_folded_positions(), tclcommand_analyze_parse_necklace(), tclcommand_analyze_parse_radial_density_map(), tclcommand_analyze_parse_vel_distr(), tclcommand_analyze_parse_Vkappa(), tclcommand_analyze_wallstuff(), tclcommand_bin(), tclcommand_constraint_mindist_position(), tclcommand_constraint_mindist_position_vec(), tclcommand_counterions(), tclcommand_crosslink(), tclcommand_diamond(), tclcommand_icosaeder(), tclcommand_integrate_set_npt_isotropic(), tclcommand_inter_coulomb_parse_elc_params(), tclcommand_inter_coulomb_parse_maggs(), tclcommand_inter_coulomb_parse_mmm1d(), tclcommand_inter_coulomb_parse_mmm2d(), tclcommand_inter_coulomb_parse_p3m(), tclcommand_inter_coulomb_parse_p3m_opt_params(), tclcommand_inter_coulomb_parse_rf(), tclcommand_inter_magnetic_parse_dp3m(), tclcommand_inter_magnetic_parse_dp3m_opt_params(), tclcommand_inter_parse_angle(), tclcommand_inter_parse_angle_cosine(), tclcommand_inter_parse_angle_cossquare(), tclcommand_inter_parse_angle_harmonic(), tclcommand_inter_parse_angledist(), tclcommand_inter_parse_area_force_global(), tclcommand_inter_parse_area_force_local(), tclcommand_inter_parse_bending_force(), tclcommand_inter_parse_BMHTF(), tclcommand_inter_parse_buckingham(), tclcommand_inter_parse_comforce(), tclcommand_inter_parse_dihedral(), tclcommand_inter_parse_endangledist(), tclcommand_inter_parse_fene(), tclcommand_inter_parse_gaussian(), tclcommand_inter_parse_gb(), tclcommand_inter_parse_harmonic(), tclcommand_inter_parse_hat(), tclcommand_inter_parse_hertzian(), tclcommand_inter_parse_inter_dpd(), tclcommand_inter_parse_lj(), tclcommand_inter_parse_ljangle(), tclcommand_inter_parse_ljcos(), tclcommand_inter_parse_ljcos2(), tclcommand_inter_parse_ljgen(), tclcommand_inter_parse_molcut(), tclcommand_inter_parse_morse(), tclcommand_inter_parse_rigid_bond(), tclcommand_inter_parse_SmSt(), tclcommand_inter_parse_soft(), tclcommand_inter_parse_stretching_force(), tclcommand_inter_parse_subt_lj(), tclcommand_inter_parse_tunable_slip(), tclcommand_inter_parse_volume_force(), tclcommand_lbfluid(), tclcommand_lbfluid_print_interpolated_velocity(), tclcommand_metadynamics_parse_distance(), tclcommand_metadynamics_parse_relative_z(), tclcommand_nemd_parse_shearrate(), tclcommand_observable_interacts_with(), tclcommand_on_collision(), tclcommand_parse_radial_profile(), tclcommand_part_parse_dip(), tclcommand_part_parse_ext_force(), tclcommand_part_parse_ext_torque(), tclcommand_part_parse_f(), tclcommand_part_parse_mu_E(), tclcommand_part_parse_omega_body(), tclcommand_part_parse_omega_lab(), tclcommand_part_parse_pos(), tclcommand_part_parse_quat(), tclcommand_part_parse_rotational_inertia(), tclcommand_part_parse_torque_body(), tclcommand_part_parse_torque_lab(), tclcommand_part_parse_v(), tclcommand_polymer(), tclcommand_reaction(), tclcommand_salt(), tclcommand_thermodynamic_force(), tclcommand_thermostat_parse_dpd(), tclcommand_thermostat_parse_ghmc(), tclcommand_thermostat_parse_inter_dpd(), tclcommand_thermostat_parse_langevin(), tclcommand_thermostat_parse_lb(), tclcommand_thermostat_parse_npt_isotropic(), and tclcommand_velocities().

#define ARG_IS_DOUBLELIST (   no,
  il 
)    (parse_double_list(interp, argv[(no)], &(il)))

Definition at line 81 of file parser.h.

Referenced by tclcommand_analyze_wallstuff(), and tclcommand_bin().

#define ARG_IS_I (   no,
  dest 
)    (!(Tcl_GetInt(interp, argv[(no)], &(dest)) == TCL_ERROR))

Definition at line 69 of file parser.h.

Referenced by part_parse_gc(), tclcommand_analyze_fluid_parse_densprof(), tclcommand_analyze_fluid_parse_velprof(), tclcommand_analyze_parse_aggregation(), tclcommand_analyze_parse_and_print_energy(), tclcommand_analyze_parse_and_print_pressure(), tclcommand_analyze_parse_and_print_stress_tensor(), tclcommand_analyze_parse_bilayer_set(), tclcommand_analyze_parse_bond_dist(), tclcommand_analyze_parse_cell_gpb(), tclcommand_analyze_parse_formfactor(), tclcommand_analyze_parse_holes(), tclcommand_analyze_parse_nbhood(), tclcommand_analyze_parse_necklace(), tclcommand_analyze_parse_radial_density_map(), tclcommand_analyze_parse_rdfchain(), tclcommand_analyze_set_parse_chain_topology(), tclcommand_analyze_wallstuff(), tclcommand_bin(), tclcommand_bit_random(), tclcommand_cellsystem(), tclcommand_counterions(), tclcommand_crosslink(), tclcommand_diamond(), tclcommand_iccp3m(), tclcommand_icosaeder(), tclcommand_imd(), tclcommand_integrate(), tclcommand_integrate_set_npt_isotropic(), tclcommand_inter(), tclcommand_inter_coulomb_parse_maggs(), tclcommand_inter_coulomb_parse_mmm1d(), tclcommand_inter_coulomb_parse_p3m(), tclcommand_inter_magnetic_parse_dp3m(), tclcommand_inter_parse_comfixed(), tclcommand_inter_parse_comforce(), tclcommand_inter_parse_dihedral(), tclcommand_inter_parse_inter_dpd(), tclcommand_inter_parse_interrf(), tclcommand_inter_parse_ljangle(), tclcommand_inter_parse_ljgen(), tclcommand_inter_parse_molcut(), tclcommand_inter_parse_SmSt(), tclcommand_lbnode(), tclcommand_lbnode_extforce_gpu(), tclcommand_maxwell_velocities(), tclcommand_metadynamics_parse_distance(), tclcommand_metadynamics_parse_relative_z(), tclcommand_nemd_parse_exchange(), tclcommand_nemd_parse_shearrate(), tclcommand_on_collision(), tclcommand_part(), tclcommand_part_parse_bond(), tclcommand_part_parse_fix(), tclcommand_polymer(), tclcommand_reaction(), tclcommand_salt(), tclcommand_t_random(), tclcommand_thermodynamic_force(), tclcommand_thermostat_parse_ghmc(), and tclcommand_velocities().

#define ARG_IS_INTLIST (   no,
  il 
)    (parse_int_list(interp, argv[(no)], &(il)))
#define ARG_IS_S (   no,
  str 
)    !strncasecmp(argv[(no)], (str), strlen(argv[(no)]))
#define ARG_IS_S_EXACT (   no,
  str 
)    !strcmp(argv[(no)], (str))
#define CHECK_VALUE (   func,
  errmsg 
)

Function Documentation

int gather_runtime_errors ( Tcl_Interp *  interp,
int  ret_state 
)

gather all error messages from all nodes and set the interpreter result to these error messages.

This should be called only on the master node.

The errors are append to the result, if ret_state == TCL_ERROR, otherwise the result is overwritten, in case an error occurs. Therefore you should end any Tcl command handler by return gather_runtime_errors(<return_value>). This code uses asynchronous communication.

Parameters:
ret_statereturn value of the procedure
interpwhere to put the errors
Returns:
new return value after the background errors, if any, have been handled

Definition at line 51 of file parser.c.

References ES_OK, free, malloc, mpi_gather_runtime_errors(), and n_nodes.

Referenced by tclcommand_adress(), tclcommand_analyze(), tclcommand_blockfile(), tclcommand_cellsystem(), tclcommand_change_volume(), tclcommand_constraint(), tclcommand_counterions(), tclcommand_crosslink(), tclcommand_diamond(), tclcommand_icosaeder(), tclcommand_integrate(), tclcommand_inter(), tclcommand_inter_coulomb_parse_mmm1d(), tclcommand_lbboundary(), tclcommand_lbfluid(), tclcommand_maxwell_velocities(), tclcommand_metadynamics(), tclcommand_nemd(), tclcommand_part_parse_cmd(), tclcommand_salt(), tclcommand_setmd(), tclcommand_thermostat(), and tclcommand_velocities().

int parse_double_list ( Tcl_Interp *  interp,
char *  list,
DoubleList dl 
)

parse an double list

Parameters:
interpfor conversion of backslash stuff
listthe string containing the list
dlwhere to store the results

Definition at line 40 of file parser.c.

References DoubleList::e, i, DoubleList::n, and realloc_doublelist().

int parse_int_list ( Tcl_Interp *  interp,
char *  list,
IntList il 
)

parse an integer list

Parameters:
interpfor conversion of backslash stuff
listthe string containing the list
ilwhere to store the results

Definition at line 29 of file parser.c.

References IntList::e, i, IntList::n, and realloc_intlist().

Referenced by parse_id_list().