### start Source: https://manual.gromacs.org/2025.3/doxygen/html-full/classgmx_1_1internal_1_1OptionSectionImpl-members.xhtml Initializes the option section, performing any necessary setup. ```APIDOC ## start ### Description Initializes the option section. ``` -------------------------------- ### Get Kernel Setup Source: https://manual.gromacs.org/2025.3/doxygen/html-lib/namespacegmx.xhtml Returns the kernel setup based on benchmark options. ```cpp static NbnxmKernelSetup getKernelSetup (const NbnxmKernelBenchOptions &options) ``` -------------------------------- ### elementSetup Source: https://manual.gromacs.org/2025.3/doxygen/html-full/classgmx_1_1MttkElement.xhtml Performs any necessary setup for the MttkElement before the simulation starts. This implementation indicates no specific setup is required. ```APIDOC ## elementSetup ### Description Performs setup for the MttkElement. This implementation requires no specific setup. ### Method `void elementSetup()` ``` -------------------------------- ### setup Source: https://manual.gromacs.org/2025.3/doxygen/html-full/classgmx_1_1StatePropagatorData.xhtml Performs the initial setup for the associated Element. ```APIDOC ## setup ### Description Initial set up for the associated element. ### Signature `void setup()` ``` -------------------------------- ### Example Test Parameterization and Naming Setup Source: https://manual.gromacs.org/2025.3/doxygen/html-lib/naming_8h.xhtml Demonstrates the setup for parameterized tests using `std::tuple` and custom naming functors. It includes defining test parameters, a test fixture, and the naming functors for both test cases and reference data filenames. ```cpp //! Enumeration used as an element of the test parameter tuple enum class : int Flavor { A, B, C, Count }; EnumerationArray sc_flavorName = { "A", "B", "C" }; //! The test-parameter tuple std::tuple TestParameters; //! Parameterized test fixture class ExampleTest : public ::testing::TestWithParam { }; //! Functor containing tuple for naming each test case const NameOfTestFromTuple sc_testNamer{ std::make_tuple(PrefixFormatter{"i_"}, useString, sc_flavorName, doubleToString) }; // Extra functor for further customizing the filename used for the // reference data, particularly useful when some parameters should // not influence the name of the file. See below for details. // This example makes reference-data filenames like // Combinations_ExampleTest_i_0_foo_3_1416.xml const RefDataFilenameMaker sc_refDataFilenameMaker { std::make_tuple(PrefixFormatter{"i_"}, useString, toEmptyString, // ignores the Flavor doubleToString) }; ``` -------------------------------- ### Setup Source: https://manual.gromacs.org/2025.3/doxygen/html-lib/functions_func_0x73.xhtml Performs setup operations for various components like HaloExchange, DomainCommForward, and ListedForces. ```APIDOC ## setup() ### Description Performs setup operations for the component. ### Method Not applicable (C++ method) ### Endpoint Not applicable (C++ method) ### Parameters None explicitly documented in this context. ### Request Example Not applicable (C++ method) ### Response This function is associated with `gmx::HaloExchange`, `gmx::DomainCommForward`, and `ListedForces`. ### Response Example Not applicable (C++ method) ``` -------------------------------- ### elementSetup Source: https://manual.gromacs.org/2025.3/doxygen/html-full/classgmx_1_1StatePropagatorData_1_1Element.xhtml Performs setup operations for the element, such as backing up starting velocities. ```APIDOC ## elementSetup ### Description Performs setup operations for the element, including backing up starting velocities. This method is part of the `ISimulatorElement` interface. ### Method `void elementSetup()` ``` -------------------------------- ### elementSetup() Source: https://manual.gromacs.org/2025.3/doxygen/html-full/classgmx_1_1CompositeSimulatorElement-members.xhtml Performs setup operations for the simulator element. This method is called once before the simulation starts. ```APIDOC ## elementSetup() ### Description Performs setup operations for the simulator element. This method is called once before the simulation starts. ### Method `virtual` ### Endpoint `elementSetup()` ``` -------------------------------- ### Check Kernel Setup Source: https://manual.gromacs.org/2025.3/doxygen/html-lib/namespacegmx.xhtml Checks the kernel setup. Returns an optional string with error information if setup fails. ```cpp static std::optional< std::string > checkKernelSetup (const NbnxmKernelBenchOptions &options) ``` -------------------------------- ### Start Source Source: https://manual.gromacs.org/2025.3/doxygen/html-full/classgmx_1_1SelectionFileOptionStorage.xhtml Starts adding values from a new source for the option. ```APIDOC ## startSource() ### Description Starts adding values from a new source for the option. ``` -------------------------------- ### NeighborSearchSignaller::setup Source: https://manual.gromacs.org/2025.3/doxygen/html-full/classgmx_1_1NeighborSearchSignaller.xhtml Placeholder method for setup, does nothing at setup time. ```APIDOC ## void gmx::NeighborSearchSignaller::setup() ### Description Do nothing at setup time. ### Method void ### Implements gmx::ISignaller ``` -------------------------------- ### Install Build Tools Source: https://manual.gromacs.org/2025.3/gmxapi/userguide/install.html Install the necessary Python build tools before creating a source archive. ```bash pip install --upgrade setuptools build ``` -------------------------------- ### setupAndRunInstance Source: https://manual.gromacs.org/2025.3/doxygen/html-full/namespacegmx.xhtml Sets up and runs the requested benchmark instance and prints the results. ```APIDOC ## setupAndRunInstance ### Description Sets up and runs the requested benchmark instance and prints the results. ### Signature static void | setupAndRunInstance (const BenchmarkSystem &system, const NbnxmKernelBenchOptions &options, const bool doWarmup) ``` -------------------------------- ### Template C++ Example Source: https://manual.gromacs.org/2025.3/doxygen/html-full/examples.xhtml A basic C++ template file for Gromacs examples. This serves as a starting point for developing new examples. ```cpp // This is a template file for GROMACS examples. // It is not intended to be compiled or run directly. // Use it as a starting point for your own examples. #include int main() { // TODO: Add your example code here std::cout << "Hello, GROMACS example!" << std::endl; return 0; } ``` -------------------------------- ### Setup and Run Benchmark Instance Source: https://manual.gromacs.org/2025.3/doxygen/html-lib/namespacegmx.xhtml Sets up and runs the requested benchmark instance and prints the results. ```cpp static void setupAndRunInstance (const BenchmarkSystem &system, const NbnxmKernelBenchOptions &options, const bool doWarmup) ``` -------------------------------- ### getKernelSetup Source: https://manual.gromacs.org/2025.3/doxygen/html-user/namespacegmx.xhtml Returns the kernel setup configuration. This function retrieves the current setup for NBNxM kernels based on provided options. ```APIDOC ## getKernelSetup ### Description Returns the kernel setup configuration. This function retrieves the current setup for NBNxM kernels based on provided options. ### Signature `static NbnxmKernelSetup getKernelSetup(const NbnxmKernelBenchOptions &options)` ``` -------------------------------- ### setup() Source: https://manual.gromacs.org/2025.3/doxygen/html-user/functions_func_0x73.xhtml Sets up domain communication or halo exchange. ```APIDOC ## setup() ### Description Sets up domain communication or halo exchange. ### Method N/A ### Endpoint N/A ### Parameters N/A ### Request Example N/A ### Response #### Success Response Initializes the communication or exchange mechanism. ### Response Example N/A ``` -------------------------------- ### gmx::setupAndRunInstance Source: https://manual.gromacs.org/2025.3/doxygen/html-full/bench__setup_8cpp.xhtml Sets up and runs the requested benchmark instance, then prints the results. This function orchestrates the execution and reporting of a single benchmark run. ```APIDOC ## gmx::setupAndRunInstance ### Description Sets up and runs the requested benchmark instance and prints the results. ### Signature static void gmx::setupAndRunInstance(const BenchmarkSystem &system, const NbnxmKernelBenchOptions &options, const bool doWarmup) ### Parameters * **system** (const BenchmarkSystem &) - The benchmark system configuration. * **options** (const NbnxmKernelBenchOptions &) - The benchmark options for the instance. * **doWarmup** (const bool) - Flag to indicate if a warmup run should be performed. ``` -------------------------------- ### Notify Callbacks During MD Run Setup Source: https://manual.gromacs.org/2025.3/doxygen/html-full/page_mdmodules.xhtml Trigger notifications for subscribed callbacks during the setup phase of an MD run, for example, within Mdrunner. ```C++ YourCallbackSignature argument(); mdModules_.notifier().notifier_.notify(argument); ``` -------------------------------- ### elementSetup Source: https://manual.gromacs.org/2025.3/doxygen/html-full/classgmx_1_1CheckpointHelper.xhtml Placeholder method for element setup. The CheckpointHelper does not require any specific setup actions when it is initialized as part of the simulator loop. ```APIDOC ## void gmx::CheckpointHelper::elementSetup() ### Description No element setup needed. ``` -------------------------------- ### Get DD Grid Setup Source: https://manual.gromacs.org/2025.3/doxygen/html-full/domdec__setup_8cpp.xhtml Determines the domain decomposition (DD) grid setup. It can either implement user-specified settings or estimate optimal parameters like PME ranks, cell setup, and initial ddbox. ```cpp DDGridSetup getDDGridSetup( const gmx::MDLogger& _mdlog_, DDRole _ddRole_, MPI_Comm _communicator_, int _numRanksRequested_, const gmx::DomdecOptions& _options_, const DDSettings& _ddSettings_, const DDSystemInfo& _systemInfo_, real _cellSizeLimit_, const gmx_mtop_t& _mtop_, const t_inputrec& _ir_, const gmx::SeparatePmeRanksPermitted& _separatePmeRanksPermitted_, const matrix _box_, gmx::ArrayRef< const gmx::RVec > _xGlobal_, gmx_ddbox_t* _ddbox_ ); ``` -------------------------------- ### Initialize Input Options Source: https://manual.gromacs.org/2025.3/doxygen/html-full/page_analysistemplate.xhtml Sets up tool description, output file name option, selection options, and a cutoff value option. It also indicates the requirement for topology information. ```cpp void MyAnalysisTool::initOptions(gmx::IOptionsContainer& options) { // Set description text for the tool options.description("A template for trajectory analysis tools."); // Declare an option for the output file name options.addOption(gmx::FileNameOption("o", "output.dat", "Output file name")); // Declare options for setting selections options.addOption(selectionOption_); // Declare an option to set a cutoff value, with a default options.addOption(gmx::DoubleOption("cutoff", &cutoff_, "Cutoff distance")); // Indicate that the tool requires topology information (for demonstration) options.requireTopology(true); } ``` -------------------------------- ### getKernelSetup Source: https://manual.gromacs.org/2025.3/doxygen/html-full/namespacegmx.xhtml Returns the kernel setup based on provided benchmark options. ```APIDOC ## getKernelSetup ### Description Returns the kernel setup. ### Signature static NbnxmKernelSetup | getKernelSetup (const NbnxmKernelBenchOptions &options) ``` -------------------------------- ### Start mdrun with external MPI Source: https://manual.gromacs.org/2025.3/user-guide/mdrun-performance.html Starts mdrun using an external MPI implementation, launching a specified number of ranks and allowing hardware/MPI setup to determine OpenMP threads. ```bash mpirun -np 2 gmx_mpi mdrun ``` -------------------------------- ### Typical Usage of CommandLineModuleManager Source: https://manual.gromacs.org/2025.3/doxygen/html-full/classgmx_1_1CommandLineModuleManager.xhtml Demonstrates the typical setup and execution flow for a CommandLineModuleManager, including initialization, module registration, and running the manager. ```cpp #include int main(int argc, char *argv[]) { gmx::CommandLineProgramContext &programContext = gmx::initForCommandLine(&argc, &argv); try { gmx::CommandLineModuleManager manager("gmx", &programContext); // int rc = manager.run(argc, argv); gmx::finalizeForCommandLine(); return rc; } catch (const std::exception &ex) { gmx::printFatalErrorMessage(stderr, ex); return gmx::processExceptionAtExitForCommandLine(ex); } } ``` -------------------------------- ### elementSetup() Source: https://manual.gromacs.org/2025.3/doxygen/html-full/classgmx_1_1AndersenTemperatureCoupling-members.xhtml Performs setup operations for the simulation element. This method is called once before the simulation starts to prepare the element. ```APIDOC ## elementSetup() ### Description Performs setup operations for the simulation element. This method is called once before the simulation starts to prepare the element. ### Method `override` ``` -------------------------------- ### setup Source: https://manual.gromacs.org/2025.3/doxygen/html-full/classgmx_1_1DomDecHelper.xhtml Performs the initial domain decomposition partitioning. ```APIDOC ## setup ### Description The initial domain decomposition partitioning. ### Method void ``` -------------------------------- ### handleRestart Source: https://manual.gromacs.org/2025.3/doxygen/html-user/namespacegmx.xhtml Handles the startup of mdrun, particularly concerning checkpoint files (-cpi) and appending (-append). It determines the starting behavior and returns a log file pointer. ```APIDOC ## handleRestart ### Description Handle startup of mdrun, particularly regarding -cpi and -append. ### Signature std::tuple< StartingBehavior, LogFilePtr > handleRestart(bool isSimulationMain, MPI_Comm communicator, const gmx_multisim_t *ms, AppendingBehavior appendingBehavior, int nfile, t_filenm fnm[]) ``` -------------------------------- ### setup Source: https://manual.gromacs.org/2025.3/doxygen/html-full/functions_func_0x73.xhtml Sets up various components. Applies to StatePropagatorData, LastStepSignaller, DomainCommForward, HaloExchange, ListedForces, DomDecHelper, ISignaller, PmeLoadBalanceHelper, NeighborSearchSignaller, LoggingSignaller, and TrajectorySignaller. ```APIDOC ## setup() ### Description Sets up various components. ### Applies to gmx::StatePropagatorData, gmx::LastStepSignaller, gmx::DomainCommForward, gmx::HaloExchange, ListedForces, gmx::DomDecHelper, gmx::ISignaller, gmx::PmeLoadBalanceHelper, gmx::NeighborSearchSignaller, gmx::LoggingSignaller, gmx::TrajectorySignaller, gmx::EnergySignaller ``` -------------------------------- ### checkInputConsistencyInterval Source: https://manual.gromacs.org/2025.3/doxygen/html-full/namespacegmx.xhtml Checks if the starting configuration is consistent with the specified interval. This function is likely used to validate simulation setup parameters related to intervals. ```APIDOC ## checkInputConsistencyInterval ### Description Check if the starting configuration is consistent with the given interval. ### Signature `static void checkInputConsistencyInterval(const AwhParams &awhParams, WarningHandler *wi)` ``` -------------------------------- ### setup Source: https://manual.gromacs.org/2025.3/doxygen/html-full/classgmx_1_1HaloExchange-members.xhtml Sets up the HaloExchange object for a new simulation step. ```APIDOC ## setup(gmx_domdec_t *dd, t_state *localState, const gmx_ddbox_t &ddbox, t_forcerec *fr, const bool cellsChanged) ### Description Configures the HaloExchange object for the current simulation step. This function is called to prepare for communication based on domain decomposition, local state, box dimensions, and force records. ### Method `setup` ### Parameters #### Path Parameters - **dd** (gmx_domdec_t *) - Required - Pointer to the domain decomposition structure. - **localState** (t_state *) - Required - Pointer to the local state of the simulation. - **ddbox** (const gmx_ddbox_t &) - Required - Constant reference to the domain decomposition box structure. - **fr** (t_forcerec *) - Required - Pointer to the force record structure. - **cellsChanged** (const bool) - Required - Boolean indicating if the simulation cells have changed. ``` -------------------------------- ### GROMACS Index File Example (ndx) Source: https://manual.gromacs.org/2025.3/reference-manual/file-formats.html Defines user-definable sets of atoms for GROMACS analysis and preprocessing. Atom numbering starts at 1. ```text [ Oxygen ] 1 4 7 [ Hydrogen ] 2 3 5 6 8 9 ``` -------------------------------- ### Start mdrun on Two Nodes with Shared GPU (Alternative) Source: https://manual.gromacs.org/2025.3/user-guide/mdrun-performance.html Starts gmx mdrun on two nodes using eight total ranks, each with three OpenMP threads. All four ranks on a node share GPU with ID 0. Performance may vary compared to other setups. ```bash mpirun -np 8 gmx_mpi mdrun -ntomp 3 -gputasks 0000 ``` -------------------------------- ### MTS Setup and Requirements Source: https://manual.gromacs.org/2025.3/doxygen/html-user/namespacegmx.xhtml Functions related to setting up and validating Multi-Time-Stepping (MTS) levels and requirements. ```APIDOC ## setupMtsLevels ### Description Sets up and returns the MTS levels and checks requirements of MTS. ### Signature ```cpp std::vector setupMtsLevels(const GromppMtsOpts &mtsOpts, std::vector *errorMessages) ``` ## haveValidMtsSetup ### Description Returns whether MTS is used and its setup is internally valid. ### Signature ```cpp bool haveValidMtsSetup(const t_inputrec &ir) ``` ## checkMtsRequirements ### Description Checks whether the MTS requirements on other algorithms and output frequencies are met. ### Signature ```cpp std::vector checkMtsRequirements(const t_inputrec &ir) ``` ## forceGroupMtsLevel ### Description Returns the MTS level at which a force group is to be computed. ### Signature ```cpp static int forceGroupMtsLevel(ArrayRef mtsLevels, const MtsForceGroups mtsForceGroup) ``` ``` -------------------------------- ### Setup Nbnxm for Benchmark Instance Source: https://manual.gromacs.org/2025.3/doxygen/html-lib/namespacegmx.xhtml Sets up and returns a Nbnxm object for the given benchmark options and system. ```cpp static std::unique_ptr< nonbonded_verlet_t > setupNbnxmForBenchInstance (const NbnxmKernelBenchOptions &options, const BenchmarkSystem &system) ``` -------------------------------- ### gmx make_ndx -twin option example Source: https://manual.gromacs.org/2025.3/onlinehelp/gmx-make_ndx.html The -twin switch duplicates all index groups with an offset of -natoms, which is useful for Computational Electrophysiology double-layer membrane setups. ```bash gmx make_ndx -f conf.gro -o index.ndx -twin -natoms 10000 ``` -------------------------------- ### Get Number of Grids Function Source: https://manual.gromacs.org/2025.3/doxygen/html-full/gridset_8cpp.xhtml A static function within the GridSet class that returns the total number of search grids based on the provided domain setup. ```cpp static int | gmx::numGrids (const GridSet::DomainSetup &domainSetup) ``` -------------------------------- ### InstallationPrefixInfo Source: https://manual.gromacs.org/2025.3/doxygen/html-full/structgmx_1_1InstallationPrefixInfo.xhtml Initializes the InstallationPrefixInfo structure with the provided path and a boolean indicating if it's a source layout. ```APIDOC ## InstallationPrefixInfo ### Description Initializes the structure with given values. ### Parameters * **path** (std::filesystem::path) - Description of the installation prefix path. * **bSource** (bool) - Indicates if the path points to a source tree-like layout. ``` -------------------------------- ### Get gmxapi Version using pkg_resources Source: https://manual.gromacs.org/2025.3/gmxapi/userguide/pythonreference.html Access the installed gmxapi package version using the pkg_resources module. This is a common way to retrieve package versions in Python. ```python import pkg_resources print(pkg_resources.get_distribution('gmxapi').version) ``` -------------------------------- ### setup_edi Source: https://manual.gromacs.org/2025.3/doxygen/html-full/namespaceanonymous__namespace_02edsam_8cpp_03.xhtml Sets up essential dynamics work parameters. ```APIDOC ## setup_edi ### Description Set up essential dynamics work parameters. ### Signature void setup_edi (t_edpar *edi) ### Parameters * **edi** (t_edpar *) - Essential dynamics parameters structure to set up. ``` -------------------------------- ### setup Source: https://manual.gromacs.org/2025.3/doxygen/html-user/classgmx_1_1HaloExchange-members.xhtml Sets up the HaloExchange object for a simulation run. ```APIDOC ## setup(gmx_domdec_t *dd, t_state *localState, const gmx_ddbox_t &ddbox, t_forcerec *fr, const bool cellsChanged) ### Description Sets up the HaloExchange object with necessary simulation parameters. This method configures the halo exchange for the current simulation state. ### Method `setup` ### Parameters #### Path Parameters - **dd** (gmx_domdec_t *) - Pointer to the domain decomposition structure. - **localState** (t_state *) - Pointer to the local state of the simulation. - **ddbox** (const gmx_ddbox_t &) - The domain decomposition box information. - **fr** (t_forcerec *) - Pointer to the force record. - **cellsChanged** (const bool) - Flag indicating if the simulation cells have changed. ``` -------------------------------- ### Accessing Custom Data in analyzeFrame Source: https://manual.gromacs.org/2025.3/doxygen/html-user/page_analysistemplate.xhtml In analyzeFrame, custom data structures (if used) can be accessed via a static_cast for shorthand. This example shows how to get data from a custom structure. ```cpp const auto& data = static_cast(pdata)->data(); ``` -------------------------------- ### chooseStartingBehavior Source: https://manual.gromacs.org/2025.3/doxygen/html-full/namespacegmx_1_1anonymous__namespace_02handlerestart_8cpp_03.xhtml Determines the appropriate starting behavior for a Gromacs simulation based on appending behavior and existing files. It handles cases where different simulations in a multi-simulation setup might have different restart conditions. ```APIDOC ## chooseStartingBehavior ### Description Choose the starting behaviour for this simulation. This routine cannot print tons of data, since it is called before the log file is opened. Note that different simulations in a multi-simulation can return values that depend on whether the respective checkpoint files are found (and other files found, when appending), and so can differ between multi-simulations. It is the caller's responsibility to detect this and react accordingly. ### Signature StartingBehaviorHandler chooseStartingBehavior(const AppendingBehavior appendingBehavior, const int nfile, t_filenm fnm[]) ``` -------------------------------- ### StringOption Constructors and Basic Configuration Source: https://manual.gromacs.org/2025.3/doxygen/html-user/classgmx_1_1StringOption.xhtml Demonstrates the initialization of a StringOption and setting basic properties like description and requirement. ```APIDOC ## StringOption(const char *name) ### Description Initializes an option with the given name. ### Method Constructor ### Parameters * **name** (const char *) - The name of the option. ## StringOption::description ### Description Sets a description for the option. ### Method Setter ### Parameters * **descr** (const char *) - The description string for the option. ## StringOption::required ### Description Requires the option to be specified explicitly. ### Method Setter ### Parameters * **bRequired** (bool) - If true, the option is required. Defaults to true. ``` -------------------------------- ### Configuring GROMACS with CMake Command-Line Options Source: https://manual.gromacs.org/2025.3/install-guide/index.html Specify build options directly on the CMake command line using the -D flag. This example configures GROMACS for CUDA GPUs, MPI, and a custom installation prefix. ```bash cmake .. -DGMX_GPU=CUDA -DGMX_MPI=ON \ -DCMAKE_INSTALL_PREFIX=/home/marydoe/programs ``` -------------------------------- ### Typical Usage of CommandLineModuleManager Source: https://manual.gromacs.org/2025.3/doxygen/html-lib/classgmx_1_1CommandLineModuleManager.xhtml Demonstrates the typical setup and execution flow for a command-line application using CommandLineModuleManager. This includes initialization, module registration (commented out), running the manager, and exception handling. ```cpp #include int main(int argc, char *argv[]) { gmx::CommandLineProgramContext &programContext = gmx::initForCommandLine(&argc, &argv); try { gmx::CommandLineModuleManager manager("gmx", &programContext); // int rc = manager.run(argc, argv); gmx::finalizeForCommandLine(); return rc; } catch (const std::exception &ex) { gmx::printFatalErrorMessage(stderr, ex); return gmx::processExceptionAtExitForCommandLine(ex); } } ``` -------------------------------- ### nbnxmKernelSimd (EwaldAnalytical, LorentzBerthelot, PotShift, VdwCutoffCheck::Yes) Source: https://manual.gromacs.org/2025.3/doxygen/html-user/namespacegmx.xhtml This overload computes analytical Ewald Coulomb interactions with Lorentz-Berthelot LJ combination rules, potential shifting, and a Van der Waals cutoff check. This configuration is for specific simulation setups. ```APIDOC ## nbnxmKernelSimd < KernelLayout::r2xMM, KernelCoulombType::EwaldAnalytical, VdwCutoffCheck::Yes, LJCombinationRule::LorentzBerthelot, InteractionModifiers::PotShift, LJEwald::None, EnergyOutput::GroupPairs > ### Description This function computes non-bonded interactions using a SIMD-optimized kernel. It is specialized for analytical Ewald Coulomb interactions, a cutoff check for Van der Waals forces, Lorentz-Berthelot combination rules for LJ potentials, and applies a potential shift. ### Parameters - **nbl** (const NbnxnPairlistCpu *): Pointer to the non-bonded pairlist structure. - **nbat** (const nbnxn_atomdata_t *): Pointer to the atom data for non-bonded interactions. - **ic** (const interaction_const_t *): Pointer to interaction constants. - **shift_vec** (const rvec *): Vector for potential shifting. - **out** (nbxn_atomdata_output_t *): Output structure for interaction data. ``` -------------------------------- ### Typical Usage of TextTableFormatter Source: https://manual.gromacs.org/2025.3/doxygen/html-full/classgmx_1_1TextTableFormatter.xhtml Demonstrates the basic setup and usage of TextTableFormatter to add columns, add text to columns, and format a row. This example shows a simple row with text that fits within the defined column widths. ```cpp #include #include #include // Assuming gmx::TextTableFormatter is available // For demonstration purposes, we'll use a placeholder if not directly available in this context. // Placeholder for the actual class if not in scope for a standalone example namespace gmx { class TextTableFormatter { public: TextTableFormatter() {} void addColumn(const char* title, int width, bool bWrap) {} void clear() {} void addColumnLine(int index, const std::string& text) {} void setColumnFirstLineOffset(int index, int firstLine) {} std::string formatRow() { return ""; } // Placeholder return }; } int main() { gmx::TextTableFormatter formatter; formatter.addColumn("Name", 10, false); formatter.addColumn("Type", 10, false); formatter.addColumn("Description", 50, true); formatter.clear(); formatter.addColumnLine(0, "name"); formatter.addColumnLine(1, "type"); formatter.addColumnLine(2, "Description for name"); printf("%s", formatter.formatRow().c_str()); return 0; } ``` -------------------------------- ### SetUp Source: https://manual.gromacs.org/2025.3/doxygen/html-full/functions_func_0x73.xhtml Sets up the test environment for Shake. Applies to ShakeTest. ```APIDOC ## SetUp() ### Description Sets up the test environment for Shake. ### Applies to gmx::test::anonymous_namespace{shake.cpp}::ShakeTest ``` -------------------------------- ### Interpolating a Specific Function's Derivative Source: https://manual.gromacs.org/2025.3/doxygen/html-full/classgmx_1_1QuadraticSplineTable.xhtml Interpolate the derivative of a specific function within a multi-function table. This example shows how to get the derivative of the second function (index 1) from a table containing three functions in total. ```cpp double x = 0.5; // The point at which to evaluate the derivative double der; // Interpolate the derivative of the second function (index 1) from a table with 3 functions total. // table.evaluateDerivative(x, &output_derivative_pointer); table.evaluateDerivative<3, 1>(x, &der); ``` -------------------------------- ### setup Source: https://manual.gromacs.org/2025.3/doxygen/html-full/classgmx_1_1PmeLoadBalanceHelper.xhtml Initializes the PME load balancing object before simulation steps. ```APIDOC ## void setup () ### Description Initializes the load balancing object. ### Method void ``` -------------------------------- ### elementSetup Source: https://manual.gromacs.org/2025.3/doxygen/html-full/classgmx_1_1ComputeGlobalsElement.xhtml Performs the initial setup for the element, which includes the first call to compute_globals. ```APIDOC ## elementSetup() ### Description Element setup - first call to compute_globals. ### Method override ``` -------------------------------- ### Get Base PME GPU Spline Parameter Index Source: https://manual.gromacs.org/2025.3/doxygen/html-full/pme__gpu__calculate__splines__sycl_8h.xhtml Calculates the base index for PME GPU spline parameter buffers. This function is a prerequisite for getSplineParamIndex() and is used to determine the starting point for accessing spline parameters within a sub-group. ```cpp template static int getSplineParamIndexBase( int _subGroupIndex_, int _atomSubGroupIndex_ ) ``` -------------------------------- ### setupNbnxmForBenchInstance Source: https://manual.gromacs.org/2025.3/doxygen/html-full/namespacegmx.xhtml Sets up and returns a Nbnxm object for the given benchmark options and system. ```APIDOC ## setupNbnxmForBenchInstance ### Description Sets up and returns a Nbnxm object for the given benchmark options and system. ### Signature static std::unique_ptr < nonbonded_verlet_t > | setupNbnxmForBenchInstance (const NbnxmKernelBenchOptions &options, const BenchmarkSystem &system) ``` -------------------------------- ### TextTableFormatter with Text Wrapping and Line Offset Source: https://manual.gromacs.org/2025.3/doxygen/html-full/classgmx_1_1TextTableFormatter.xhtml Illustrates how TextTableFormatter handles text that might overflow columns by using text wrapping and how to control the starting line for column output using setColumnFirstLineOffset. This example shows a row with a long name that requires careful formatting. ```cpp #include #include #include // Assuming gmx::TextTableFormatter is available // For demonstration purposes, we'll use a placeholder if not directly available in this context. // Placeholder for the actual class if not in scope for a standalone example namespace gmx { class TextTableFormatter { public: TextTableFormatter() {} void addColumn(const char* title, int width, bool bWrap) {} void clear() {} void addColumnLine(int index, const std::string& text) {} void setColumnFirstLineOffset(int index, int firstLine) {} std::string formatRow() { return ""; } // Placeholder return }; } int main() { gmx::TextTableFormatter formatter; formatter.addColumn("Name", 10, false); formatter.addColumn("Type", 10, false); formatter.addColumn("Description", 50, true); formatter.clear(); formatter.addColumnLine(0, "averylongname"); formatter.addColumnLine(1, "type"); formatter.setColumnFirstLineOffset(1, 1); formatter.addColumnLine(2, "Description for name"); printf("%s", formatter.formatRow().c_str()); // format other rows by repeating the above code return 0; } ``` -------------------------------- ### Install gmxapi with Verbose Output Source: https://manual.gromacs.org/2025.3/gmxapi/userguide/install.html Install gmxapi, specifying the GROMACS installation path and enabling verbose output to help diagnose installation issues. ```bash gmxapi_ROOT=/Users/eric/gromacs pip install --verbose gmxapi ``` -------------------------------- ### Setting Up Input Options Source: https://manual.gromacs.org/2025.3/doxygen/html-user/page_analysistemplate.xhtml Configures tool-specific options, including output file, selections, and cutoff values. Requires topology information. ```cpp void MyAnalysisTool::initOptions(gmx::TrajectoryAnalysisSettings &settings) { settings.setToolBoxDescription("My custom trajectory analysis tool."); // Option for output file name settings.addOption("o", "output", "Output file name", &outputFileName_); // Options for selections settings.addOption(selectionOption_, "sel", "Selection for analysis"); // Option for cutoff value, with default from constructor settings.addOption("c", "cutoff", "Cutoff distance", &cutoff_, gmx::IOptionsContainer::Optional); // Indicate that topology is required (for demonstration) settings.forceRequiresTopology(); } ``` -------------------------------- ### Install gmxapi from a downloaded source archive Source: https://manual.gromacs.org/2025.3/gmxapi/userguide/install.html Download the gmxapi source distribution archive and then install it from the local file. This method is useful for installing specific versions or when direct PyPI installation is not preferred. ```bash pip download gmxapi pip install gmxapi-.tar.gz ``` -------------------------------- ### elementSetup Source: https://manual.gromacs.org/2025.3/doxygen/html-full/classgmx_1_1PullElement.xhtml Performs initial setup for the PullElement. ```APIDOC ## elementSetup ### Description Sets the initial annealing temperature. This method is part of the ISimulatorElement interface. ### Method void ``` -------------------------------- ### Set Start Time Source: https://manual.gromacs.org/2025.3/doxygen/html-lib/functions_func_0x73.xhtml Sets the start time for a simulation or analysis. This function is part of a utility for setting the start time. ```APIDOC ## SetStartTime() ### Description Sets the start time for the simulation or analysis. ### Method Not applicable (C++ method) ### Endpoint Not applicable (C++ method) ### Parameters None explicitly documented in this context. ### Request Example Not applicable (C++ method) ### Response This function is part of the `gmx::SetStartTime` utility. ### Response Example Not applicable (C++ method) ``` -------------------------------- ### Setup and Run Simple Simulation with gmxapi Source: https://manual.gromacs.org/2025.3/gmxapi/userguide/usage.html Sets up a simulation using a TPR file and prepares it for execution. The simulation is triggered explicitly by calling .run(). ```python import gmxapi as gmx simulation_input = gmx.read_tpr(tpr_filename) md = gmx.mdrun(simulation_input) ``` -------------------------------- ### Perform Offline gmxapi Installation Source: https://manual.gromacs.org/2025.3/gmxapi/userguide/install.html Install gmxapi using pre-downloaded wheel files from a local directory, ensuring no internet connection is required during installation. ```bash # Later, install. pip install --no-index --find-links=DIR DIR/gmxapi*whl ``` -------------------------------- ### start() Source: https://manual.gromacs.org/2025.3/doxygen/html-user/functions_func_0x73.xhtml Initiates a process, such as histogram settings initialization or a simulation cycle. ```APIDOC ## start() ### Description Initiates a process, such as histogram settings initialization or a simulation cycle. ### Method N/A ### Endpoint N/A ### Parameters N/A ### Request Example N/A ### Response #### Success Response Begins the execution of the specified process. ### Response Example N/A ``` -------------------------------- ### setupForceOutputs Source: https://manual.gromacs.org/2025.3/doxygen/html-full/namespacegmx.xhtml Set up the different force buffers; also does clearing. ```APIDOC ## setupForceOutputs ### Description Set up the different force buffers; also does clearing. ### Method static ForceOutputs ### Endpoint setupForceOutputs ``` -------------------------------- ### Specify GROMACS Installation Path Source: https://manual.gromacs.org/2025.3/gmxapi/userguide/install.html When GROMACS is not sourced via GMXRC, set the gmxapi_ROOT environment variable to point to the GROMACS installation directory before installing gmxapi. ```bash gmxapi_ROOT=/path/to/gromacs pip install . ``` -------------------------------- ### kernelSetup Source: https://manual.gromacs.org/2025.3/doxygen/html-lib/functions_func_0x6b.xhtml Initializes the kernel setup for nonbonded Verlet interactions. ```APIDOC ## kernelSetup ### Description Initializes the kernel setup for nonbonded Verlet interactions. ### Method (Not specified in source) ### Endpoint (Not specified in source) ### Parameters (No parameters specified in source) ### Response #### Success Response - **gmx::nonbonded_verlet_t**: The type returned by the kernel setup function. #### Response Example (No response example specified in source) ``` -------------------------------- ### Install gmxapi Python Package Source: https://manual.gromacs.org/2025.3/gmxapi/userguide/install.html Sources the GROMACS environment script and then installs the gmxapi Python package from PyPI. This command assumes GROMACS is installed in `/path/to/gromacs`. ```bash . /path/to/gromacs/bin/GMXRC pip install --no-cache-dir gmxapi ``` -------------------------------- ### checkKernelSetup Source: https://manual.gromacs.org/2025.3/doxygen/html-full/namespacegmx.xhtml Checks the kernel setup based on provided benchmark options. ```APIDOC ## checkKernelSetup ### Description Checks the kernel setup. ### Signature static std::optional< std::string > | checkKernelSetup (const NbnxmKernelBenchOptions &options) ``` -------------------------------- ### gmx::SelectionPosition::refId Source: https://manual.gromacs.org/2025.3/doxygen/html-user/classgmx_1_1SelectionPosition.xhtml Returns the reference ID for this position. For dynamic selections, this ID helps associate positions across frames. After compilation, these IDs are sequentially numbered starting from zero. In each frame, the ID reflects the position's location in the original array. If SelectionOption::dynamicMask() is set, positions not in the current selection get an ID of -1; otherwise, they are removed. Default values are zero-based. ```APIDOC ## gmx::SelectionPosition::refId ### Description Returns the reference ID for this position. For dynamic selections, this ID helps associate positions across frames. After compilation, these IDs are sequentially numbered starting from zero. In each frame, the ID reflects the position's location in the original array. If SelectionOption::dynamicMask() is set, positions not in the current selection get an ID of -1; otherwise, they are removed. Default values are zero-based. ### Method const ### Return Value int - The reference ID of the position. ``` -------------------------------- ### Kernel Setup Access Source: https://manual.gromacs.org/2025.3/doxygen/html-lib/structgmx_1_1nonbonded__verlet__t.xhtml Provides access to the kernel setup configuration. ```APIDOC ## Kernel Setup Access ### `const NbnxmKernelSetup &kernelSetup() const` **Description**: Return the kernel setup. ``` -------------------------------- ### BenchmarkSystem() Source: https://manual.gromacs.org/2025.3/doxygen/html-user/functions_func_0x62.xhtml Initializes the benchmarking system. ```APIDOC ## BenchmarkSystem() ### Description Initializes the benchmarking system. ### Method N/A ### Endpoint N/A ### Parameters N/A ### Request Example N/A ### Response N/A ### Response Example N/A ``` -------------------------------- ### Example Usage of makeSimulationInput Source: https://manual.gromacs.org/2025.3/doxygen/html-full/group__module__mdrun.xhtml Demonstrates how to prepare LegacyMdrunOptions, create a SimulationInputHandle using makeSimulationInput, and add it to a SimulationInputBuilder. This function is not yet part of the public API and is subject to change. ```cpp // After preparing a LegacyMdrunOptions and calling handleRestart()... SimulationInputBuilder builder; auto simulationInputHandle = makeSimulationInput(options, &builder); // In addition to MdrunnerBuilder::addFiles(), mdrunnerBuilder.addInput(simulationInputHandle.get()); ``` -------------------------------- ### Start Set Source: https://manual.gromacs.org/2025.3/doxygen/html-full/classgmx_1_1SelectionFileOptionStorage.xhtml Starts adding a new set of values for the option. ```APIDOC ## startSet() ### Description Starts adding a new set of values for the option. ``` -------------------------------- ### QMMMSimulationParameterSetup Methods Source: https://manual.gromacs.org/2025.3/doxygen/html-full/classgmx_1_1anonymous__namespace_02qmmm_8cpp_03_1_1QMMMSimulationParameterSetup.xhtml Provides access to methods for managing QMMM simulation parameters, including setting and retrieving atom sets, periodic boundary conditions, and logger instances. ```APIDOC ## Class: gmx::anonymous_namespace{qmmm.cpp}::QMMMSimulationParameterSetup ### Description Helper class that holds simulation data and callback functions for simulation setup time notifications. ### Public Member Functions #### `void setLocalQMAtomSet(const LocalAtomSet &localAtomSet)` Set the local atom set for the QM atoms. #### `void setLocalMMAtomSet(const LocalAtomSet &localAtomSet)` Set the local atom set for the MM atoms. #### `const LocalAtomSet& localQMAtomSet() const` Return local atom set for QM atoms. * **Exceptions**: `InternalError` if local atom set is not set. #### `const LocalAtomSet& localMMAtomSet() const` Return local atom set for MM atoms. * **Exceptions**: `InternalError` if local atom set is not set. #### `void setPeriodicBoundaryConditionType(const PbcType &pbc)` Set the periodic boundary condition via MdModuleNotifier. #### `PbcType periodicBoundaryConditionType()` Get the periodic boundary conditions. #### `void setLogger(const MDLogger &logger)` Set the logger for QMMM during mdrun. #### `const MDLogger& logger() const` Get the logger instance. ``` -------------------------------- ### start Source: https://manual.gromacs.org/2025.3/doxygen/html-full/classgmx_1_1OptionsAssigner.xhtml Starts the process of assigning values. This method does not throw any exceptions. ```APIDOC ## start ### Description Starts assigning values. ### Does Not Throw ```