C++ Interface
An example usage of the C++ interface is shown in $HOME/feasst/tutorial/tutorial.cpp and compiled in BASH as follows:
# Compile FEASST normally, ending with the command: make install.
# Set CMAKE_PREFIX_PATH in $HOME/feasst/tutorial/CMakeLists.txt
# cd /path/to/feasst/tutorial/
mkdir build; cd &_
cmake ..
make
./tutorial
C++ classes are organized as follows.
The random number generate is set by Random.
Configuration contains the identity and positions of particles, sites and the spatial Domain.
Model computes the potential energy between two sites.
To find all available Models, look at the subclasses in the documentation for one or two body Models.
VisitModel loops a Model over all selected particles and sites, or contains a many-body potential such as LongRangeCorrections or Ewald.
Potential contains both Model and VisitModel.
Trial is a MonteCarlo trial move.
Criteria determine if the Trial is accepted or rejected.
FlatHistogram methods Bias along a Macrostate.
Analyze and Modify occur every fixed number of Trials, but an Action happens only once.
These base classes have all their subclasses listed in their respective documentation.
The C++ interface is organized by plugins. A FEASST plugin is a collection of related classes. Unnecessary plugins can be removed from the FEASST_PLUGINS variable in /path/to/feasst/CMakeLists.txt. Similarly, plugins can also be added this way. In both cases, FEASST must be reinstalled.
The recommended approach for finding more information on a class is demonstrated as follows. If you would like more information on RandomMT19937 but are not sure where to find it, you could search headers files
grep -r --include=*.h RandomMT19937
And find that the class is part of the Math plugin.
See the example plugin as a template for creating your own class or plugin.
The plugins and classes listed below represent all the publicly available capabilities of FEASST.
- Threads
- Utilities
- ProgressReport
- TimerRDTSC
- utils/include/arguments
- Let
- For
- utils/include/definitions
- EndFor
- utils/include/file
- ArgumentParse
- Timer
- utils/include/utils
feasstfeasst::find_in_list()feasst::find_in_list()feasst::find_in_list()feasst::resize()feasst::resize()feasst::resize()feasst::resize()feasst::resize()feasst::fill()feasst::fill()feasst::num_elements()feasst::num_elements()feasst::has_duplicate()feasst::is_equal()feasst::is_equal()feasst::is_equal()feasst::is_equal()feasst::is_equal()
- CustomException
- utils/include/max_precision
- utils/include/io
feasstfeasst::feasst_str()feasst::feasst_str()feasst::feasst_str()feasst::str()feasst::split()feasst::trim()feasst::trim()feasst::str()feasst::num_spaces()feasst::is_found_in()feasst::replace()feasst::str_to_int()feasst::str_to_int64()feasst::str_to_double()feasst::str_to_bool()feasst::sized_int_to_str()
- utils/include/arguments_extra
- EndIf
- Cache
- Else
- If
- utils/include/debug
- Checkpoint
- utils/include/serialize
FEASST_MAPPER_RENAMESTRINGIFYFEASST_MAPPERfeasstfeasst::feasst_serialize()feasst::feasst_deserialize()feasst::feasst_serialize()feasst::feasst_deserialize()feasst::feasst_serialize()feasst::feasst_deserialize()feasst::feasst_serialize()feasst::feasst_deserialize()feasst::feasst_serialize()feasst::feasst_deserialize()feasst::feasst_serialize()feasst::feasst_deserialize()feasst::feasst_serialize_version()feasst::feasst_deserialize_version()feasst::feasst_serialize()feasst::feasst_deserialize()feasst::feasst_serialize()feasst::feasst_deserialize()feasst::feasst_serialize()feasst::feasst_deserialize()feasst::feasst_serialize()feasst::feasst_deserialize()feasst::feasst_serialize()feasst::feasst_deserialize()feasst::feasst_serialize()feasst::feasst_deserialize()feasst::feasst_deserialize()feasst::feasst_deserialize()feasst::feasst_serialize_fstobj()feasst::feasst_deserialize_fstobj()feasst::feasst_serialize_fstobj()feasst::feasst_deserialize_fstobj()feasst::feasst_serialize_fstobj()feasst::feasst_deserialize_fstobj()feasst::feasst_serialize_sp()feasst::feasst_serialize_sp()feasst::feasst_serialize()feasst::feasst_serialize()feasst::feasst_deserialize()feasst::feasst_serialize()feasst::feasst_deserialize()feasst::feasst_serialize_fstdr()feasst::feasst_serialize()feasst::feasst_serialize_fstdr()feasst::feasst_serialize()feasst::feasst_deserialize()feasst::feasst_serialize_endcap()feasst::feasst_deserialize_endcap()
- utils/include/serialize_extra
- FEASST plugin dependencies
- Math
- Random
Randomseed_by_time()seed()uniform()uniform()coin_flip()uniform_real()index()element()const_element()alpha_numeric()position_in_cube()position_in_cube()position_in_cuboid()position_in_cuboid()unit_sphere_surface()position_in_spherical_shell()index_from_cumulative_probability()quaternion()rotation()rotation()standard_normal()normal()cache()set_cache_to_load()set_cache_to_unload()class_name()
- Solver
- SolverBrentDekker
- RandomMT19937
- Histogram
- Table
- Accumulator
Accumulatormax_block_operations()num_moments()accumulate()average()stdev()std()stdev_of_av()block_stdev()block_std_of_std()block_averages()block_size()blocks()largest_blocks()largest_block_operation()block_stdev()num_values()sum()sum_dble()sum_of_squared()sum_of_squared_dble()reset()max()min()moment()moments()status_header()status()str()last_value()is_equivalent()
- Matrix
- SolverNewtonRaphson
- Euler
- Minimize
- math/include/constants
- math/include/quadratic_equation
- Position
PositionPosition()Position()coord()set_vector()set_from_cartesian()push_back()set_from_spherical()set_from_spherical()set_from_spherical()spherical()spherical()coord()set_coord()add_to_coord()size()dimension()set_to_origin_3D()set_to_origin()set_to_origin()add()subtract()divide()divide()multiply()dot_product()dot_product()cross_product()squared_distance()distance()squared_distance()distance()str()cosine()vertex_angle_radians()torsion_angle_radians()normalize()is_equal()is_equal()nearest_distance_to_axis()orthogonal()reflect()
- math/include/utils_math
feasstfeasst::round()feasst::average()feasst::product()feasst::minimum()feasst::minimum()feasst::minimum()feasst::minimum()feasst::minimum()feasst::minimum()feasst::maximum()feasst::maximum()feasst::maximum()feasst::maximum()feasst::maximum()feasst::maximum()feasst::sum()feasst::sum()feasst::sum()feasst::local_minimum_indices()feasst::feasst_union()feasst::feasst_difference()feasst::sgn()feasst::radians_to_degrees()feasst::degrees_to_radians()feasst::feasst_swap()feasst::feasst_sort()feasst::is_in_interval()feasst::cumulative_probability()feasst::spherical_shell_volume()feasst::add()feasst::add()feasst::add()feasst::add()feasst::factorial()feasst::has_bad_value()feasst::has_bad_value()
- Formula
- FormulaExponential
- FormulaPolynomial
- GoldenSearch
- RandomModulo
- SolverBisection
- FEASST plugin dependencies
- Random
- Configuration
- VisitParticles
- VisitConfiguration
- Properties
- Bond
- ModelParam
- PhysicalConstants
- Configuration
Configurationname()set_name()serialize()Configuration()add_particle_type()num_particle_types()num_site_types()num_bond_types()num_angle_types()num_dihedral_types()particle_type()type_to_file_name()particle_type_to_name()particle_name_to_type()particle_types()add()model_params()set_model_param()set_model_param()set_model_param()set_model_param()add_model_param()add_or_set_model_param()set_physical_constants()physical_constants()unique_types()unique_type()unique_type()max_sites_in_any_particle()set_site_type()site_type_to_particle_type()num_site_types_per_particle_type()site_type_to_name()site_type_names()site_name_to_index()site_index_to_name()site_type_name_to_index()add()num_groups()particle_type_to_group()particle_type_to_group_create()group_index()group_selects()group_select()add_particle_of_type()particle()particle()selection_of_all()num_particles()num_sites()num_particles_of_type()newest_particle()num_sites_of_type()num_sites_of_type()num_sites_of_type()num_sites_of_type()update_positions()update_positions()update_positions()copy_particles()displace_particles()displace_particle()displace()replace_position()remove_particles()remove_particle()set()domain()set_side_lengths()dimension()init_wrap()num_cell_lists()increment_num_cell_lists()revive()particles()select_particle()newest_particle_index()ghosts()wrap_particle()add_non_ghost_particle_of_type()set_selection_physical()set_property()add_site_property()add_or_set_site_property()add_or_set_particle_type_site_property()set_site_property()set_site_property()set_particle_type()add()neighbor_criteria()neighbor_criteria()check()are_all_sites_physical()is_equal()check_dimensions()status_header()status()str()
- PrinterXYZ
- FileVMD
- Group
- NeighborCriteria
- Site
- Particle
Particlemax_distance()clear_names()add()site()set_site()sites()num_sites()remove_site()is_isotropic()set_site_physical()check()increment_site_types()remove_non_unique_types()set_site_type()num_sites_of_type()displace()replace_position()replace_position()replace_properties()add_site_property()add_or_set_site_property()set_site_property()num_bonds()bond()bonds()add_bond()add_bond_property()add_bond_model()erase_bonds()bond()bond_neighbors()num_angles()angle()angles()add_angle()add_angle_property()add_angle_model()angle()angle_neighbors()num_dihedrals()dihedral()dihedrals()add_dihedral()add_dihedral_property()add_dihedral_model()dihedral()dihedral_neighbors()type()set_type()
- ParticleFactory
ParticleFactoryunique_particles()unique_types()check_types()check_types()check_site_types()check_particle_types()check_bond_types()check_angle_types()check_dihedral_types()add()add()remove()particle()particles()num()replace_position()replace_position()replace_properties()scale_particle_positions()check()num_site_types()num_sites()num_particle_types()num_bond_types()num_bonds()num_angle_types()num_angles()num_dihedral_types()num_dihedrals()set_site_type()remove()displace()model_params()add()set_model_param()set_model_param()set_model_param()set_model_param()add_model_param()add_or_set_model_param()set_cutoff_min_to_sigma()set_physical_constants()set_site_physical()add_property()add_property()set_property()add_site_property()add_or_set_site_property()set_site_property()set_site_property()site_name_to_index()site_index_to_name()site_type_to_particle_type()unique_type()site_type_to_name()site_type_name_to_index()name_to_index()index_to_name()
- FileParticle
- Select
Selectcheck()is_equal()random_particle()str()is_sorted()sort()is_empty()clear()add_site()set_site()set_particle()add_sites()remove_sites()add_particle()add_particle()num_particles()num_sites()add()remove()remove_last_particle()remove_last_site()remove_last_sites()remove_first_site()remove_first_sites()remove_particle()particle_indices()site_indices()site_indices()replace_indices()is_overlap()is_group_empty()set_group()group()Select()Select()has_positions()site_positions()site_properties()set_site_position()set_site_position()add_to_site_position()set_site_properties()load_position()load_positions()load_positions_of_last()geometric_center()trial_state()set_trial_state()exclude()excluded()set_new_bond()new_bond()set_old_bond()old_bond()reset_excluded_and_bond()
- Domain
Domainside_lengths()side_length()set_side_lengths()set_side_length()add_side_length()set_cubic()is_cubic()xy()xz()yz()disable()periodic()dimension()volume()h()h_inv()cartesian2scaled()cartesian2scaled_wrap()shift()shift_opt()wrap()random_position()random_position()min_side_length()max_side_length()inscribed_sphere_diameter()is_minimum_image_for_cutoff()unwrap()status_header()status()
- FEASST plugin dependencies
- System
- FEASST plugin dependencies
- API
- PotentialFactory
- Model
- ModelTwoBody
- IdealGas
- ModelTwoBodyFactory
- Potential
Potentialgroup_index()cell_index()config()configuration_index()set_configuration_index()Potential()model()Potential()visit_model()Potential()set()set_model_params()set_model_param()set_model_param()model_params()model_params()does_cutoff_fit_domain()precompute()energy()select_energy()stored_energy()set_stored_energy()change_volume()revert()finalize()cache()load_cache()unload_cache()serialize()Potential()
- System
Systemset()thermo_params()set_beta()change_volume()delta_volume_previous()total_volume()revert()finalize()load_cache()unload_cache()status_header()status()check()serialize()System()add()num_configurations()configuration()configuration_index()configuration()configuration()dimension()add()set_unoptimized()add_to_unoptimized()unoptimized()potential()add_to_optimized()optimized()add_to_reference()num_references()reference()references()reference_index()potentials()remove_opt_overlap()add()neighbor_criteria()neighbor_criteria()precompute()unoptimized_energy()energy()perturbed_energy()stored_energy()stored_energy_profile()reference_energy()reference_energy()initialize()System()
- ModelThreeBody
- ModelOneBody
- ModelEmpty
- HardSphere
- BondThreeBody
- AngleSquareWell
- RigidAngle
- ModelTwoBodyTable
- BondTwoBody
- RigidBond
- LennardJones
- ThermoParams
- VisitModelInner
- SynchronizeData
- EnergyMap
- BondFourBody
- RigidDihedral
- BondVisitor
- BondSquareWell
- CutoffOuter
- VisitModel
- LongRangeCorrections
- DontVisitModel
- VisitModelIntraMap
- VisitModelBond
- VisitModelCutoffOuter
- VisitModelCell
- VisitModelIntra
- Cells
- Monte Carlo
- Tutorial
- FEASST plugin dependencies
- API
- Constraint
- ConstrainNumParticles
- Perturb
- Action
- RemoveModify
- WriteCheckpoint
- ConstrainVolumeByCutoff
- Acceptance
Acceptanceln_metropolis_prob()set_ln_metropolis_prob()add_to_ln_metropolis_prob()reject()set_reject()endpoint()set_endpoint()reset()updated()energy_new()set_energy_new()add_to_energy_new()num_configurations()energy_profile_new()set_energy_profile_new()add_to_energy_profile_new()subtract_from_energy_profile_new()energy_old()set_energy_old()add_to_energy_old()energy_profile_old()set_energy_profile_old()add_to_energy_profile_old()energy_ref()set_energy_ref()macrostate_shift()add_to_macrostate_shift()add_to_perturbed()set_perturbed_state()perturbed()
- Run
- TrialCompute
- TrialComputeMove
- Remove
- WriteModelParams
- PerturbMove
- Criteria
CriteriaCriteria()add()is_allowed()before_attempt()is_accepted()was_accepted()set_current_energy()current_energy()set_current_energy_profile()current_energy_profile()update_current_energy()status_header()status()write()phase()increment_phase()cycles_to_complete()set_cycles_to_complete()num_cycles()is_complete()set_complete()state()num_states()set_expanded_state()expanded_state()num_expanded_states()update()is_equal()is_equal()initialize()
- TrialComputeAddRemove
- TrialSelect
TrialSelectgroup_index()particle_type()particle_type_name()configuration_index()configuration()get_configuration()set_configuration_index()set_config()config()before_select()select()sel()precompute()mobile()set_mobile()mobile_original()set_mobile_original()anchor()anchor_position()set_trial_state()reset_mobile()probability()mid_stage()set_ghost()is_ghost()printable()are_constraints_satisfied()is_particle_type_set()remove_unphysical_sites()replace_mobile()property()has_property()add_or_set_property()is_isotropic()
- TrialSelectAll
- TrialSelectParticle
- TrialSelectBond
- TrialSelectAngle
- TrialSelectDihedral
- RefPotential
- TrialComputeVolume
- PerturbAddRemove
- AlwaysReject
- TrialComputeTranslate
- RemoveTrial
- TrialComputeRemove
- MonteCarlo
MonteCarloMonteCarlo()MonteCarlo()begin()parse_args()add_args()resume()clear_arguments()set()random()seed_random()add()configuration()add()add()set()add_to_optimized()add_to_reference()add()set()thermo_params()set()system()initialize_system()trial_factory()analyze_factory()modify_factory()set()criteria()initialize_criteria()add()add()remove_trial()trials()trial()initialize_trials()add()remove_analyze()analyzers()analyze()num_analyzers()initialize_analyzers()add()remove_modify()modifiers()modify()num_modifiers()set()write_checkpoint()run()attempt()reset_trial_stats()run_num_trials()run_until_num_particles()run_for_hours()run_until_complete()run_until_file_exists()set_cycles_to_complete()attempt_trial()write_to_file()next_arg()set_parse_for_num_configs()set_parse_replace()set_parse_for()set_replace_with_index()set_timer()timer()
- Tunable
- RemoveAnalyze
- PerturbVolume
- Metropolis
- Stepper
Steppertrials_per_update()trials_per_write()output_file()output_file()output_file_append_phase()empty_output_file()append()rewrite_header()stop_after_phase()start_after_phase()stop_after_cycle()start_after_cycle()configuration_index()configuration()set_state()is_multistate()state()accumulator()get_accumulator()trials_since_update()trials_since_write()is_multistate_aggregate()header()printer()initialize()Stepper()
- Analyze
- Modify
- ModifyFactory
- PerturbRemove
- TrialStage
- Trial
Trialweight()weight_per_number_fraction()number_fraction_exclude_type()add_stage()add_stage()add_stage()set()num_stages()stage()num_success()num_attempts()num_auto_reject()increment_num_attempts()acceptance()reset_stats()status_header()name_or_description()status()tune()precompute()set()compute()revert()attempt()description()set_description()Trial()
- TrialMove
- TrialVolume
- TrialFactory
- TrialTransfer
- TrialAdd
- TrialTranslate
- TrialAddRemove
- TrialRotate
- TrialRemove
- AnalyzeFactory
- TrialComputeAdd
- OptPotential
- PerturbTranslate
- PerturbDistance
- PerturbDistanceAngle
- PerturbDihedral
- PerturbRotate
- PerturbAnywhere
- PerturbAdd
- Rosenbluth
- Models
- Steppers
- DensityProfile
- IncrementPhase
- MeanSquaredDisplacement
- Tune
- SpecificEnergy
- PairDistributionInner
- Chirality2D
- WriteStepper
- CriteriaUpdater
- Scattering
- CheckPhysicality
- Movie
- WallClockLimit
- AnalyzeData
- ReadConfigFromFile
- GhostTrialVolume
- Log
- NumParticles
- ProfileCPU
- CriteriaWriter
- Density
- WrapParticles
- SeekModify
- CPUTime
- ExtensiveMoments
- SpecificVolume
- HeatCapacity
- Check
- CheckEnergy
- CheckProperties
- Energy
- ProfileTrials
- Volume
- Tutorial
- FEASST plugin dependencies
- Flat histogram
- Tutorial
- Ideal gas equation of state using grand canonical ensemble transition-matrix Monte Carlo
- Grand canonical ensemble transition-matrix Monte Carlo
- Analysis of a one-phase (supercritical) simulation
- Analysis of a two-phase (phase separated) simulation
- Grand Canonical Flat Histogram Simulation of Lennard-Jones
- Grand Canonical Flat Histogram Simulation of SPC/E
- Grand Canonical Flat Histogram Simulation of RPM
- Grand Canonical Flat Histogram Simulation of Hard Spheres.
- Grand Canonical Flat Histogram Simulation of Patchy Trimers
- Grand Canonical Flat Histogram Simulation of Kern-Frenkel Patches
- Grand Canonical Flat Histogram Simulation at low temperature
- Grand Canonical Flat Histogram Simulation of EMP2 CO2
- Grand Canonical Flat Histogram Simulation of TraPPE alkanes
- Efficiency of 1 or 2 bin Grand Canonical Flat Histogram Simulations
- Binary Flat Histogram Simulation of SAFT-based MIE CO2 and N2
- Transition Matrix Simulation with an input guess of the Macrostate distribution
- Interpolation between Flat Histogram simulations
- FEASST plugin dependencies
- API
- Macrostate
- MacrostateNumParticles
- CollectionMatrix
- Bias
- TransitionMatrixGuess
- WLTM
- WriteFileAndCheck
- Window
- WindowExponential
- FlatHistogram
- MacrostateEnergy
- TransitionMatrix
- WangLandau
- LnProbability
- Ensemble
- CollectionMatrixSplice
- MacrostatePosition
- WindowCustom
- Clones
- Tutorial
- Patch
- Mayer
- MayerSampling
- Tutorial
- Second virial coefficient calculation of a Trimer using Mayer-Sampling
- Second virial coefficient calculation of TraPPE ethane using Mayer-Sampling
- Second virial coefficient calculation of a Kern-Frenkel patch using Mayer-Sampling
- Virial coefficients of all-atom mAb domains.
- Virial coefficients of 7-bead coarse-grained mAb model.
- Virial coefficients of spherocylinders.
- Virial coefficients of solids of revolusion.
- Virial coefficients of atomistic proteins in implicit solvent
- FEASST plugin dependencies
- XTC
- Chain
- TrialCrankshaft
- PerturbLibrary
- GhostTrialGrow
- SelectBranch
- SelectPerturbed
- SelectSegment
- SelectSiteOfType
- PerturbReptate
- PerturbCrankshaft
- SelectTwoSites
- PerturbCrankshaftSmall
- PerturbDistanceAngleConnector
- AnalyzeBonds
- TrialGrowLinear
- PerturbPivot
- PerturbBranch
- SelectCrankshaftSmall
- PerturbParticlePivot
- PerturbSiteType
- SelectParticlePivot
- RadiusOfGyration
- TrialGrow
- SelectEndSegment
- SelectReptate
- TrialReptateUnopt
- TrialCrankshaftSmall
- TrialPivot
- TrialParticlePivot
- PerturbPositionSwap
- PerturbToAnchor
- TrialSwapSites
- EndToEndDistance
- PerturbConnector
- TrialReptate
- Tutorial
- FEASST plugin dependencies
- Shape
- Confinement
- Slab, cylindrical, spherical and mixed confinement
- Grand Canonical Flat Histogram Simulation of Lennard-Jones in a simple WCA porous network
- Grand Canonical Flat Histogram Simulation of TraPPE CO2 in ZIF8
- FEASST plugin dependencies
- API
- Charge
- Optimized Lennard-Jones
- Cluster
- Monte Carlo with rigid cluster moves
- FEASST plugin dependencies
- API
- TrialRemoveAVBDivalent
- ComputeMoveCluster
- ComputeGCA
- ComputeRemoveAVB
- TrialAddAVB
- TrialAddAVBDivalent
- TrialRotateCluster
- ComputeAVB4
- ComputeAddAVB
- TrialTranslateCluster
- EnergyMapAll
- EnergyMapAllCriteria
- ComputeAVB2
- TrialTransferAVBDivalent
- TrialRigidCluster
- TrialAVB2
- TrialTransferAVB
- EnergyMapNeighbor
- EnergyMapNeighborCriteria
- TrialRemoveAVB
- TrialAVB4
- SelectCluster
- CalculateCluster
- AnalyzeCluster
- PerturbPointReflect
- PerturbRotateCOM
- PerturbMoveAVB
- PerturbAddAVB
- ComputeRemoveAVBDivalent
- SelectParticleAVB
- ComputeAddAVBDivalent
- SelectParticleAVBDivalent
- Expanded Grand Canonical Ensemble
- Morph
- Beta expanded
- Prefetch
- Aniso
- Modify FEASST
- Gibbs
- Server
- Model Expanded
- FFTW
- NetCDF
- MPI