### Typical CommandLineParser Usage Source: https://manual.gromacs.org/2026.1/doxygen/html-full/classgmx_1_1CommandLineParser.xhtml Demonstrates the basic setup and usage of the CommandLineParser. Ensure to include the necessary header and handle potential errors. ```cpp #include gmx::Options options("name", "description"); // Fill up options gmx::CommandLineParser(&options).parse(&argc, argv); options.finish(); ``` -------------------------------- ### Notify Callbacks During Setup Source: https://manual.gromacs.org/2026.1/doxygen/html-full/page_mdmodules.xhtml During setup, for example within Mdrunner, you can trigger notifications by calling the appropriate callback function with the required argument. This example demonstrates how to notify a callback. ```C++ YourCallbackSignature argument(); mdModules_.notifier().notifier_.notify(argument); ``` -------------------------------- ### Get Domain Decomposition Grid Setup Source: https://manual.gromacs.org/2026.1/doxygen/html-full/domdec__setup_8cpp.xhtml Determines the DD grid setup. ```APIDOC ## getDDGridSetup ### Description Determines the DD grid setup. ### Method DDGridSetup ### Parameters - **mdlog** (const gmx::MDLogger &) - MD logger object. - **ddRole** (DDRole) - DD role. - **mpiComm** (const gmx::MpiComm &) - MPI communicator. - **numRanksRequested** (const int) - Number of ranks requested. - **options** (const DomdecOptions &) - Domain decomposition options. - **ddSettings** (const DDSettings &) - DD settings. - **systemInfo** (const DDSystemInfo &) - System information. - **cellSizeLimit** (const real) - Cell size limit. - **mtop** (const gmx_mtop_t &) - Topology information. - **ir** (const t_inputrec &) - Input record. - **separatePmeRanksPermitted** (const gmx::SeparatePmeRanksPermitted &) - Permitted separate PME ranks. - **box** (const matrix) - Simulation box dimensions. - **xGlobal** (gmx::ArrayRef< const gmx::RVec >) - Global coordinates. - **ddbox** (gmx_ddbox_t *) - Output domain decomposition box information. ``` -------------------------------- ### File: bench_setup.h Source: https://manual.gromacs.org/2026.1/doxygen/html-full/dir_6cc3f6633093836886a4ce2735dc640b.xhtml Declares functions for setting up kernel benchmarks. ```APIDOC ## File: bench_setup.h ### Description This file declares functions for setting up kernel benchmarks. ### Method N/A ### Endpoint N/A ### Parameters N/A ### Request Example N/A ### Response N/A ``` -------------------------------- ### Get Library File Finder Source: https://manual.gromacs.org/2026.1/doxygen/html-full/futil_8h.xhtml Gets a finder object used for locating data files within the GROMACS installation's share/top/ directory. ```cpp #include const DataFileFinder & gmx::getLibraryFileFinder (); ``` -------------------------------- ### Function Documentation: setupGpuDevicePeerAccess Source: https://manual.gromacs.org/2026.1/doxygen/html-lib/gpu__utils_8h.xhtml Documentation for the setupGpuDevicePeerAccess function. ```APIDOC ## Function Documentation ### void setupGpuDevicePeerAccess (gmx::ArrayRef< const int > gpuIdsToUse, const gmx::MDLogger &mdlog) Enable peer access between GPUs where supported. ### Parameters - **gpuIdsToUse** (gmx::ArrayRef< const int >) - Required - List of GPU IDs in use - **mdlog** (const gmx::MDLogger &) - Required - Logger object ``` -------------------------------- ### File: bench_setup.cpp Source: https://manual.gromacs.org/2026.1/doxygen/html-full/dir_6cc3f6633093836886a4ce2735dc640b.xhtml Defines functions for setting up kernel benchmarks. ```APIDOC ## File: bench_setup.cpp ### Description This file defines functions for setting up kernel benchmarks. ### Method N/A ### Endpoint N/A ### Parameters N/A ### Request Example N/A ### Response N/A ``` -------------------------------- ### Template C++ Example Source: https://manual.gromacs.org/2026.1/doxygen/html-user/examples.xhtml A basic C++ template file for Gromacs examples. This serves as a starting point for developing new simulation scripts or analysis tools. ```cpp #include int main() { std::cout << "Hello, Gromacs!\n"; return 0; } ``` -------------------------------- ### Get CMake Installation Stages Source: https://manual.gromacs.org/2026.1/dev-manual/gitlab-ci.html Retrieves the stages necessary for requested CMake versions. An intermediate build stage is created for each CMake version, installed into '/usr/local/cmake-{version}'. ```python scripted_gmx_docker_builds.get_cmake_stages(_*_ , _input_args : Namespace_, _base : str_) ``` -------------------------------- ### Set up Python virtual environment Source: https://manual.gromacs.org/2026.1/gmxapi/userguide/install.html Creates a virtual environment and installs essential build tools and MPI support. ```bash python3 -m venv $HOME/myvenv . $HOME/myvenv/bin/activate python -m ensurepip --default-pip pip install --upgrade pip setuptools wheel pip install mpi4py ``` -------------------------------- ### Setup Simple Simulation with gmxapi Source: https://manual.gromacs.org/2026.1/gmxapi/userguide/usage.html Use gmxapi.read_tpr to load simulation input and gmxapi.mdrun to set up the simulation. Execution is not triggered immediately. ```python import gmxapi as gmx simulation_input = gmx.read_tpr(tpr_filename) md = gmx.mdrun(simulation_input) ``` -------------------------------- ### Get Number of Grids Source: https://manual.gromacs.org/2026.1/doxygen/html-full/namespacegmx.xhtml Returns the number of search grids based on the domain setup. ```cpp static int | numGrids (const GridSet::DomainSetup &domainSetup) ``` -------------------------------- ### void prepareTest(const char *filename) Source: https://manual.gromacs.org/2026.1/doxygen/html-full/classgmx_1_1test_1_1SetPrecisionUnSupportedFiles.xhtml Sets up the test case before running by specifying the output file name. ```APIDOC ## void prepareTest(const char *filename) ### Description Sets up the test case before running. This method is used to specify the output file name to determine the file type for the test. ### Parameters #### Path Parameters - **filename** (const char *) - Required - Name of the output file used to specify file type. ``` -------------------------------- ### Get GROMACS configuration Source: https://manual.gromacs.org/2026.1/gmxapi/userguide/pythonreference.html Retrieves a read-only dictionary proxy containing information about the GROMACS installation used to configure the package. ```python gmxapi.utility.config() ``` -------------------------------- ### gmx::H5md::setupFromExistingFile Source: https://manual.gromacs.org/2026.1/doxygen/html-lib/classgmx_1_1H5md-members.xhtml Sets up the H5md object to read from an existing file. ```APIDOC ## setupFromExistingFile ### Description Sets up the H5md object to read from an existing file. ### Method void setupFromExistingFile() ``` -------------------------------- ### Get DD Grid Setup Cell Size Limit Source: https://manual.gromacs.org/2026.1/doxygen/html-full/domdec__setup_8cpp.xhtml Returns the minimum cell size (in nm) required for DD. ```APIDOC ## getDDGridSetupCellSizeLimit ### Description Return the minimum cell size (in nm) required for DD. ### Method real ### Parameters - **mdlog** (const gmx::MDLogger &) - MD logger object. - **bDynLoadBal** (const bool) - Dynamic load balancing flag. - **dlb_scale** (const real) - Dynamic load balancing scale. - **ir** (const t_inputrec &) - Input record. - **systemInfoCellSizeLimit** (real) - System info cell size limit. - **numRanksRequested** (int) - Number of ranks requested. ``` -------------------------------- ### Implement main() using runAsMainCMain Source: https://manual.gromacs.org/2026.1/doxygen/html-full/classgmx_1_1CommandLineModuleManager.xhtml Demonstrates how to wrap a custom main function using runAsMainCMain to handle common command-line options and startup tasks. ```cpp int my_main(int argc, char *argv[]) { // <...> } int main(int argc, char *argv[]) { return gmx::CommandLineModuleManager::runAsMainCMain(argc, argv, &my_main); } ``` -------------------------------- ### Get Number of Search Grids Source: https://manual.gromacs.org/2026.1/doxygen/html-full/gridset_8cpp.xhtml Returns the number of search grids based on the provided domain setup. This function is part of the GridSet utility. ```c++ static int | gmx::numGrids (const GridSet::DomainSetup &domainSetup) ``` -------------------------------- ### void initSettingsNoNice Source: https://manual.gromacs.org/2026.1/doxygen/html-full/namespaceanonymous__namespace_02mdrun__main_8cpp_03.xhtml Initializes a command line module with a default nice level of zero. ```APIDOC ## void initSettingsNoNice(gmx::CommandLineModuleSettings *settings) ### Description Initializes a module that defaults to nice level zero. ### Parameters #### Request Body - **settings** (gmx::CommandLineModuleSettings*) - Required - Pointer to the command line module settings object. ``` -------------------------------- ### Get Torch Support Description Source: https://manual.gromacs.org/2026.1/doxygen/html-full/applied__forces_2nnpot_2binary__information_8h.xhtml Call this function to retrieve a string describing the Torch support in the currently running binary. No specific setup or imports are required beyond standard C++. ```cpp std::string gmx::torchDescription () ``` -------------------------------- ### Implement OptionsVisitor for Iterating Options Source: https://manual.gromacs.org/2026.1/doxygen/html-full/classgmx_1_1OptionsIterator.xhtml Implement the gmx::OptionsVisitor interface to iterate through sections and options within a Gromacs Options object. This example shows how to recursively visit all sections and options starting from a given section. ```cpp #include class Visitor : public gmx::OptionsVisitor { public: virtual void visitSection(const OptionSectionInfo §ion) { OptionsIterator iterator(section); iterator.acceptSections(this); iterator.acceptOptions(this); } virtual void visitOption(const OptionInfo &option) { // Do something. } } Visitor().visitSection(options.rootSection()); ``` -------------------------------- ### Typical CommandLineModuleManager Usage Source: https://manual.gromacs.org/2026.1/doxygen/html-full/classgmx_1_1CommandLineModuleManager.xhtml Demonstrates the standard setup and execution flow for the CommandLineModuleManager. Ensure all necessary modules are registered before calling run. ```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); } } ``` -------------------------------- ### Specify GROMACS installation path Source: https://manual.gromacs.org/2026.1/gmxapi/userguide/install.html Use the gmxapi_ROOT environment variable to point the installer to a valid GROMACS installation directory. ```bash gmxapi_ROOT=/Users/eric/gromacs pip install --verbose gmxapi ``` -------------------------------- ### Set Help Text Example Source: https://manual.gromacs.org/2026.1/doxygen/html-full/classgmx_1_1ICommandLineOptionsModuleSettings.xhtml Demonstrates how to define a string array and pass it to the setHelpText method. ```cpp const char *const desc[] = { "This is the description", "for the options" }; settings->setHelpText(desc); ``` -------------------------------- ### Setup H5MD File from Input Source: https://manual.gromacs.org/2026.1/doxygen/html-lib/namespacegmx.xhtml Configures an H5MD file using topology and input record data. Requires an H5MD file handle, topology, and input record. ```cpp void | setupFileFromInput (H5md *h5md, const gmx_mtop_t &topology, const t_inputrec &inputRecord) ``` -------------------------------- ### Install gmxapi via environment variable Source: https://manual.gromacs.org/2026.1/gmxapi/userguide/install.html Use the gmxapi_ROOT environment variable to specify the GROMACS installation path during pip installation. ```bash gmxapi_ROOT=/path/to/gromacs pip install --no-cache-dir gmxapi ``` -------------------------------- ### Install mpi4py Source: https://manual.gromacs.org/2026.1/gmxapi/userguide/install.html Install mpi4py using the system MPI compiler. ```bash MPICC=`which mpicc` pip install --no-cache-dir --upgrade mpi4py ``` -------------------------------- ### ListedForces::setup Source: https://manual.gromacs.org/2026.1/doxygen/html-full/classListedForces.xhtml Sets up the listed interactions and thread parallelization. It copies interaction definitions and configures parameters based on input. ```APIDOC ## void ListedForces::setup ### Description Copy the listed interactions from `idef` and set up the thread parallelization. ### Method void ### Endpoint N/A (Member function) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (void) This function does not return a value. #### Response Example None ``` -------------------------------- ### Install Build Dependencies Source: https://manual.gromacs.org/2026.1/gmxapi/userguide/install.html Install cmake and pybind11 required for building gmxapi. ```bash pip install --upgrade cmake pybind11 ``` -------------------------------- ### setup Source: https://manual.gromacs.org/2026.1/doxygen/html-user/classgmx_1_1HaloExchange.xhtml Sets up the halo communication. This method should be called after any (re)partitioning of the simulation domain. ```APIDOC ## void setup(gmx_domdec_t *dd, t_state *localState, const gmx_ddbox_t &ddbox, t_forcerec *fr, bool cellsChanged) ### Description Sets up the halo communication. This method should be called after any (re)partitioning of the simulation domain. ### 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** (bool) - Indicates if the simulation cells have changed. ``` -------------------------------- ### Verify GROMACS installation Source: https://manual.gromacs.org/2026.1/user-guide/getting-started.html Check the installed version of GROMACS or troubleshoot command availability. ```bash gmx -version ``` ```bash gmx: command not found. ``` -------------------------------- ### Force Output Setup Source: https://manual.gromacs.org/2026.1/doxygen/html-user/namespacegmx.xhtml Initializes force buffers and handles clearing operations. ```C static ForceOutputs setupForceOutputs (ForceHelperBuffers *forceHelperBuffers, ArrayRefWithPadding< RVec > force, const DomainLifetimeWorkload &domainWork, const StepWorkload &stepWork, const bool havePpDomainDecomposition, gmx_wallcycle *wcycle) ``` -------------------------------- ### Install gmxapi package Source: https://manual.gromacs.org/2026.1/gmxapi/userguide/install.html Sources the GROMACS environment script and installs the gmxapi package. ```bash . /path/to/gromacs/bin/GMXRC pip install --no-cache-dir gmxapi ``` -------------------------------- ### void writeHelp(const HelpWriterContext &context) Source: https://manual.gromacs.org/2026.1/doxygen/html-full/classgmx_1_1anonymous__namespace_02selhelp_8cpp_03_1_1KeywordsHelpTopic.xhtml Prints the help text for the selection keywords topic to the provided context. ```APIDOC ## void writeHelp(const HelpWriterContext &context) ### Description Prints the help text for the KeywordsHelpTopic to the specified HelpWriterContext. ### Parameters #### Path Parameters - **context** (HelpWriterContext) - Required - The context object used for writing the help output. ### Exceptions - **std::bad_alloc** - Thrown if the system is out of memory. - **FileIOError** - Thrown on any I/O error during the writing process. ``` -------------------------------- ### Installation Path Discovery Source: https://manual.gromacs.org/2026.1/doxygen/html-full/group__module__commandline.xhtml Functions for finding GROMACS installation paths and related information. ```APIDOC ## gmx::anonymous_namespace{cmdlineprogramcontext.cpp}::isAcceptableLibraryPath ### Description Returns whether a given path contains files from `share/top/`. ### Method N/A (Function) ### Endpoint N/A ### Parameters - **path** (const std::filesystem::path&) - Input - The path to check. ### Response bool - True if the path is acceptable, false otherwise. ``` ```APIDOC ## gmx::anonymous_namespace{cmdlineprogramcontext.cpp}::isAcceptableLibraryPathPrefix ### Description Returns whether a given path prefix contains files from `share/top/`. ### Method N/A (Function) ### Endpoint N/A ### Parameters - **path** (const std::filesystem::path&) - Input - The path prefix to check. ### Response bool - True if the path prefix is acceptable, false otherwise. ``` ```APIDOC ## gmx::anonymous_namespace{cmdlineprogramcontext.cpp}::findFallbackInstallationPrefixPath ### Description Returns a fallback installation prefix path. ### Method N/A (Function) ### Endpoint N/A ### Parameters None ### Response std::filesystem::path - The fallback installation prefix path. ``` ```APIDOC ## gmx::anonymous_namespace{cmdlineprogramcontext.cpp}::findInstallationPrefixPath ### Description Generic function to find data files based on the path of the binary. ### Method N/A (Function) ### Endpoint N/A ### Parameters - **binaryPath** (const std::filesystem::path&) - Input - The path to the binary. - **bSourceLayout** (bool*) - Output - Pointer to a boolean indicating if it's a source layout. ### Response std::filesystem::path - The installation prefix path. ``` -------------------------------- ### gmx::H5md::setupFileFromInput Source: https://manual.gromacs.org/2026.1/doxygen/html-lib/classgmx_1_1H5md.xhtml Sets up the HDF5 file using provided topology and input record data. ```APIDOC ## POST /h5md/setupFileFromInput ### Description Set up the file from input data. ### Method POST ### Endpoint /h5md/setupFileFromInput ### Parameters #### Request Body - **topology** (const gmx_mtop_t &) - Required - Topology data of system. - **inputRecord** (const t_inputrec &) - Required - Simulation parameters. ### Request Example ```json { "topology": {}, "inputRecord": {} } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the success of the setup operation. #### Response Example ```json { "status": "success" } ``` ``` -------------------------------- ### frameStarted Source: https://manual.gromacs.org/2026.1/doxygen/html-user/classgmx_1_1AnalysisDataModuleSerial.xhtml Called at the start of each data frame. Receives header information for the frame that is starting. ```APIDOC ## void gmx::AnalysisDataModuleSerial::frameStarted(const AnalysisDataFrameHeader & _frame_) ### Description Called at the start of each data frame. Receives header information for the frame that is starting. ### Method void ### Parameters - **_frame_** (const AnalysisDataFrameHeader &) - Required - Header information for the frame that is starting. ### Exceptions - unspecified: Can throw any exception required by the implementing class to report errors. ``` -------------------------------- ### start Source: https://manual.gromacs.org/2026.1/doxygen/html-full/classgmx_1_1internal_1_1OptionSectionImpl.xhtml Called when entering the section. It calls AbstractOptionStorage::startSource() for all options. ```APIDOC ## start ### Description Called when entering the section. Calls AbstractOptionStorage::startSource() for all options. ### Method `void gmx::internal::OptionSectionImpl::start()` ### Endpoint N/A (Member function) ### Parameters None ### Request Example N/A ### Response None (void function). ``` -------------------------------- ### Function: isTransformationPullSetup Source: https://manual.gromacs.org/2026.1/doxygen/html-full/namespacegmx_1_1test_1_1anonymous__namespace_02pull_8cpp_03.xhtml Checks if a given pull setup name corresponds to a transformation pull setup. ```APIDOC ## Function: isTransformationPullSetup ### Description Determines if the provided pull setup name is a transformation pull setup. ### Parameters - **pullSetupName** (const std::string &) - Required - The name of the pull setup to check. ### Response - **bool** - Returns true if the setup is a transformation pull setup, false otherwise. ``` -------------------------------- ### Setup Force Outputs Source: https://manual.gromacs.org/2026.1/doxygen/html-full/namespacegmx.xhtml Sets up different force buffers and performs clearing. This is essential for managing force data during simulations. ```cpp static ForceOutputs | setupForceOutputs (ForceHelperBuffers *forceHelperBuffers, ArrayRefWithPadding< RVec > force, const DomainLifetimeWorkload &domainWork, const StepWorkload &stepWork, const bool havePpDomainDecomposition, gmx_wallcycle *wcycle) ``` -------------------------------- ### HelpWriterContext::writeOptionListStart Source: https://manual.gromacs.org/2026.1/doxygen/html-full/classgmx_1_1HelpWriterContext.xhtml Starts writing a list of options. ```APIDOC ## void gmx::HelpWriterContext::writeOptionListStart() const ### Description Starts writing a list of options. Prints any necessary headers for a list of options formatted with writeOptionItem(). ### Method void ### Endpoint N/A (Member Function) ### Parameters N/A ### Request Example N/A ### Response #### Success Response (void) N/A #### Response Example N/A ### Exceptions N/A ``` -------------------------------- ### Domain Decomposition Grid Setup Source: https://manual.gromacs.org/2026.1/doxygen/html-full/domdec__setup_8cpp.xhtml Function to determine the Domain Decomposition (DD) grid setup. ```APIDOC ## getDDGridSetup ### Description Determines the DD grid setup. Either implements settings required by the user, or otherwise chooses estimated optimal number of separate PME ranks and DD grid cell setup, DD cell size limits, and the initial ddbox. ### Method (Implicitly a setup function, likely internal) ### Endpoint N/A (Internal function) ### Parameters - **_mdlog_** (const gmx::MDLogger &) - Description not specified - **_ddRole_** (DDRole) - Description not specified - **_mpiComm_** (const gmx::MpiComm &) - Description not specified - **_numRanksRequested_** (int) - Description not specified - **_options_** (const gmx::DomdecOptions &) - Description not specified - **_ddSettings_** (const DDSettings &) - Description not specified - **_systemInfo_** (const DDSystemInfo &) - Description not specified - **_cellSizeLimit_** (real) - Description not specified - **_mtop_** (const gmx_mtop_t &) - Description not specified - **_ir_** (const t_inputrec &) - Description not specified - **_separatePmeRanksPermitted_** (const gmx::SeparatePmeRanksPermitted &) - Description not specified - **_box_** (const matrix) - Description not specified - **_xGlobal_** (gmx::ArrayRef< const gmx::RVec >) - Description not specified - **_ddbox_** (gmx_ddbox_t *) - Description not specified ### Response #### Success Response (DDGridSetup) - **Return Value** (DDGridSetup) - The determined DD grid setup. ### Response Example (No example provided) ``` -------------------------------- ### Include Headers for Benchmark System Setup Source: https://manual.gromacs.org/2026.1/doxygen/html-full/bench__system_8h.xhtml Includes necessary headers for setting up a benchmark system in C++. Ensure these headers are available in your project. ```cpp #include #include #include #include #include "gromacs/mdtypes/forcerec.h" #include "gromacs/utility/listoflists.h" #include "gromacs/utility/real.h" #include "gromacs/utility/vectypes.h" ``` -------------------------------- ### Install gmxapi from GROMACS source Source: https://manual.gromacs.org/2026.1/gmxapi/userguide/install.html Build and install the gmxapi package directly from the GROMACS source repository. ```bash cd python_packaging/gmxapi pip install -r requirements.txt pip install . ``` -------------------------------- ### gmx::H5md::setupFromExistingFile Source: https://manual.gromacs.org/2026.1/doxygen/html-lib/classgmx_1_1H5md.xhtml Sets up the HDF5 file by scanning for existing trajectory data, primarily in the /particles/system group. ```APIDOC ## POST /h5md/setupFromExistingFile ### Description Set up from an existing file. Scans for trajectory data available in the /particles/system group of the HDF5 file. For trajectories written by GROMACS this group contains data for all atoms in the simulated system. ### Method POST ### Endpoint /h5md/setupFromExistingFile ### Note Ignores trajectory data in other subgroups of /particles. ### Response #### Success Response (200) - **status** (string) - Indicates the success of the setup operation. #### Response Example ```json { "status": "success" } ``` ``` -------------------------------- ### VelocityScalingTemperatureCoupling Setup Source: https://manual.gromacs.org/2026.1/doxygen/html-full/classgmx_1_1VelocityScalingTemperatureCoupling.xhtml Performs sanity checks at setup time for the VelocityScalingTemperatureCoupling element. This is an override of the ISimulatorElement interface. ```c++ void elementSetup () override ``` -------------------------------- ### Install gmxapi Source: https://manual.gromacs.org/2026.1/gmxapi/userguide/install.html Commands to install the latest gmxapi release, including options for source distribution and pre-release versions. ```bash # Get the latest official release. pip install --no-cache-dir gmxapi ``` ```bash pip download gmxapi pip install gmxapi-.tar.gz ``` ```bash # Get the latest version, including pre-release versions. pip install --no-cache-dir --pre gmxapi ``` -------------------------------- ### ListedForces Setup Function Source: https://manual.gromacs.org/2026.1/doxygen/html-full/classListedForces.xhtml Copies listed interactions and sets up thread parallelization. Requires interaction definitions, number of atoms, GPU usage flag, and restraint indices. ```cpp void | setup (const InteractionDefinitions &domainIdef, int numAtomsForce, bool useGpu, gmx::ArrayRef< const unsigned short > restraintComIndices) ``` -------------------------------- ### Install pybind11 dependency Source: https://manual.gromacs.org/2026.1/gmxapi/userguide/install.html Install the pybind11 package manually if the build process fails due to missing build-time dependencies. ```bash pip install --upgrade pybind11 ``` -------------------------------- ### Setup H5md File from Input Source: https://manual.gromacs.org/2026.1/doxygen/html-user/namespacegmx.xhtml Sets up an H5md file from topology and input record data. Used for initializing trajectory files. ```cpp setupFileFromInput (H5md *h5md, const gmx_mtop_t &topology, const t_inputrec &inputRecord) ``` -------------------------------- ### POST /gmx/writeCommandLineHelpCMain Source: https://manual.gromacs.org/2026.1/doxygen/html-lib/group__module__commandline.xhtml Helper to implement help documentation for C-like main functions. ```APIDOC ## POST /gmx/writeCommandLineHelpCMain ### Description Helper to implement ICommandLineModule::writeHelp() with a C-like main() function. ### Parameters #### Request Body - **context** (const CommandLineHelpContext &) - Required - Context object for writing help. - **name** (const char *) - Required - Name of the module. - **mainFunction** (int(*)(int argc, char *argv[])) - Required - C-like main function pointer. ``` -------------------------------- ### Build and install gmxapi offline Source: https://manual.gromacs.org/2026.1/gmxapi/userguide/install.html Download wheels or source distributions with dependencies to a directory for later installation in an offline environment. ```bash # Remove any locally cached (previously built) wheels. pip cache remove gmxapi # Download gmxapi and dependencies from pypi. pip wheel --wheel-dir DIR gmxapi # or, using package source from the GROMACS repository cd python_packaging/gmxapi pip wheel --wheel-dir DIR . # Later, install. pip install --no-index --find-links=DIR DIR/gmxapi*whl ``` ```bash # if in the GROMACS source repository cd python_packaging/gmxapi # or download and expand the archive pip download --destination-directory DIR gmxapi tar xf DIR/gmxapi* cd gmxapi* # Pre-fetch dependencies to DIR pip download --destination-directory DIR . # Build and install from the source directory. pip install --no-index --find-links=DIR . ``` -------------------------------- ### Method: startSet Source: https://manual.gromacs.org/2026.1/doxygen/html-full/classgmx_1_1AbstractOptionStorage.xhtml Documentation for the startSet method which manages the transition between option value sources. ```APIDOC ## startSet ### Description Starts adding values from a new source for the option. This marks the current value of the option as a default value, causing the next call to startSet() to clear it, allowing values from the new source to overwrite old values. ### Exceptions This method does not throw. ``` -------------------------------- ### gmx_fft_destroy Source: https://manual.gromacs.org/2026.1/doxygen/html-full/fft_8h.xhtml Releases an FFT setup structure and all allocated memory. This function should be called after all transforms using a specific setup have been completed. ```APIDOC ## gmx_fft_destroy ### Description Release an FFT setup structure. Destroy setup and release all allocated memory. ### Method void ### Endpoint gmx_fft_destroy(gmx_fft_t _setup_) ### Parameters #### Path Parameters - **setup** (gmx_fft_t) - Setup returned from gmx_fft_init_1d(), or one of the other initializers. ``` -------------------------------- ### void gmx::init(int *argc, char ***argv) Source: https://manual.gromacs.org/2026.1/doxygen/html-full/init_8cpp.xhtml Initializes the GROMACS library environment. ```APIDOC ## void gmx::init(int *argc, char ***argv) ### Description Initializes the GROMACS library. This function should be called at the start of the application. ### Parameters #### Path Parameters - **argc** (int*) - Required - Pointer to the number of command-line arguments. - **argv** (char***) - Required - Pointer to the array of command-line argument strings. ``` -------------------------------- ### gmx::MDModules::subscribeToSimulationSetupNotifications Source: https://manual.gromacs.org/2026.1/doxygen/html-full/classgmx_1_1MDModules.xhtml Subscribes MDModules to simulation setup notifications, allowing callbacks during the setup phase after options are assigned. ```APIDOC ## void gmx::MDModules::subscribeToSimulationSetupNotifications ### Description Subscribe MDModules to simulation setup notifications. Allows MDModules to subscribe to notifications that are called back during the set up of an MD simulation, after the options were assigned to the modules. ### Method void ### Endpoint N/A (Member function) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ``` -------------------------------- ### gmx::HaloExchange::setup Source: https://manual.gromacs.org/2026.1/doxygen/html-lib/classgmx_1_1HaloExchange-members.xhtml Sets up the halo exchange mechanism. ```APIDOC ## gmx::HaloExchange::setup ### Description Sets up the halo exchange mechanism for parallel simulations. This method configures the exchange based on domain decomposition and simulation state. ### Method (Not specified, likely a member function call) ### Parameters * **dd** (gmx_domdec_t *) - Pointer to the domain decomposition structure. * **localState** (t_state *) - Pointer to the local simulation state. * **ddbox** (const gmx_ddbox_t &) - The domain decomposition box information. * **fr** (t_forcerec *) - Pointer to the force record. * **cellsChanged** (bool) - Flag indicating if the simulation cells have changed. ``` -------------------------------- ### Start Frames Analysis Source: https://manual.gromacs.org/2026.1/doxygen/html-full/group__module__trajectoryanalysis.xhtml Starts the analysis of frames for various trajectory analysis modules. This function is necessary for threaded parallelization. ```APIDOC ## TrajectoryAnalysisModuleDataPointer gmx::analysismodules::anonymous_namespace{pairdist.cpp}::PairDistance::startFrames ### Description Starts the analysis of frames. ### Method override virtual ### Parameters - **opt** (const AnalysisDataParallelOptions &) - in - Parallel options - **selections** (const SelectionCollection &) - in - Frame-local selection collection object. ### Returns Data structure for thread-local data. This function is necessary only for threaded parallelization. It is called once for each thread and should initialize a class that contains any required frame-local data in the returned value. The default implementation creates a basic data structure that holds thread-local data handles for all data objects registered with registerAnalysisDataset(), as well as the thread-local selection collection. These can be accessed in analyzeFrame() using the methods in TrajectoryAnalysisModuleData. If other thread-local data is needed, this function should be overridden and it should create an instance of a class derived from TrajectoryAnalysisModuleData. ### See Also - TrajectoryAnalysisModuleData Reimplemented from gmx::TrajectoryAnalysisModule. ``` ```APIDOC ## TrajectoryAnalysisModuleDataPointer gmx::analysismodules::anonymous_namespace{rdf.cpp}::Rdf::startFrames ### Description Starts the analysis of frames. ### Method override virtual ### Parameters - **opt** (const AnalysisDataParallelOptions &) - in - Parallel options - **selections** (const SelectionCollection &) - in - Frame-local selection collection object. ### Returns Data structure for thread-local data. This function is necessary only for threaded parallelization. It is called once for each thread and should initialize a class that contains any required frame-local data in the returned value. The default implementation creates a basic data structure that holds thread-local data handles for all data objects registered with registerAnalysisDataset(), as well as the thread-local selection collection. These can be accessed in analyzeFrame() using the methods in TrajectoryAnalysisModuleData. If other thread-local data is needed, this function should be overridden and it should create an instance of a class derived from TrajectoryAnalysisModuleData. ### See Also - TrajectoryAnalysisModuleData Reimplemented from gmx::TrajectoryAnalysisModule. ``` ```APIDOC ## TrajectoryAnalysisModuleDataPointer gmx::analysismodules::anonymous_namespace{sasa.cpp}::Sasa::startFrames ### Description Starts the analysis of frames. ### Method override virtual ### Parameters - **opt** (const AnalysisDataParallelOptions &) - in - Parallel options - **selections** (const SelectionCollection &) - in - Frame-local selection collection object. ### Returns Data structure for thread-local data. This function is necessary only for threaded parallelization. It is called once for each thread and should initialize a class that contains any required frame-local data in the returned value. The default implementation creates a basic data structure that holds thread-local data handles for all data objects registered with registerAnalysisDataset(), as well as the thread-local selection collection. These can be accessed in analyzeFrame() using the methods in TrajectoryAnalysisModuleData. If other thread-local data is needed, this function should be overridden and it should create an instance of a class derived from TrajectoryAnalysisModuleData. ### See Also - TrajectoryAnalysisModuleData Reimplemented from gmx::TrajectoryAnalysisModule. ``` -------------------------------- ### gmx::H5md::setupFromExistingFileForAppending Source: https://manual.gromacs.org/2026.1/doxygen/html-lib/classgmx_1_1H5md-members.xhtml Sets up the H5md object for appending data to an existing file. ```APIDOC ## setupFromExistingFileForAppending ### Description Sets up the H5md object for appending data to an existing file. ### Method void setupFromExistingFileForAppending(int64_t restartingFromStep, int64_t numParticles) ### Parameters #### Path Parameters - **restartingFromStep** (int64_t) - Required - The step number to restart from. - **numParticles** (int64_t) - Required - The number of particles in the system. ``` -------------------------------- ### Start GPU Profiler (CUDA) Source: https://manual.gromacs.org/2026.1/doxygen/html-full/gpu__utils__hip_8cpp.xhtml Starts the GPU profiler for CUDA when mdrun is being profiled. This is controlled by the NVPROF_ID environment variable. ```cpp void startGpuProfiler () ``` -------------------------------- ### Gro File Format Example Source: https://manual.gromacs.org/2026.1/doxygen/html-full/programs_2mdrun_2tests_2pull__rotation_8cpp.xhtml Example of a .gro file format for atomic positions, used in mdrun rotation tests. ```gro 4 1AR AR 1 1.500 1.500 3.200 2AR AR 2 3.900 5.800 3.500 3AR AR 3 4.700 6.200 2.100 4AR AR 4 5.500 4.000 6.600 8.000 8.000 8.000 ``` -------------------------------- ### QMMMSimulationParameterSetup Class Methods Source: https://manual.gromacs.org/2026.1/doxygen/html-full/classgmx_1_1anonymous__namespace_02qmmm_8cpp_03_1_1QMMMSimulationParameterSetup.xhtml Methods for configuring and retrieving QM/MM simulation parameters. ```APIDOC ## QMMMSimulationParameterSetup Methods ### Description Provides methods to set and retrieve configuration parameters for QM/MM simulations, such as local atom sets, logger instances, and MPI communicators. ### Methods - **setLocalQMAtomSet(const LocalAtomSet &localAtomSet)**: Sets the local atom set for QM atoms. - **setLocalMMAtomSet(const LocalAtomSet &localAtomSet)**: Sets the local atom set for MM atoms. - **localQMAtomSet()**: Returns the local atom set for QM atoms. Throws InternalError if not set. - **localMMAtomSet()**: Returns the local atom set for MM atoms. Throws InternalError if not set. - **setPeriodicBoundaryConditionType(const PbcType &pbc)**: Sets the periodic boundary condition. - **periodicBoundaryConditionType()**: Returns the current periodic boundary condition type. - **setLogger(const MDLogger &logger)**: Sets the logger for QMMM during mdrun. - **logger()**: Returns the current logger instance. - **setMpiComm(const MpiComm &mpiComm)**: Sets the MPI communicator for QMMM during mdrun startup. - **mpiComm()**: Returns the current MPI communicator. ``` -------------------------------- ### Simulation Setup Notifier Source: https://manual.gromacs.org/2026.1/doxygen/html-full/structgmx_1_1MDModulesNotifiers.xhtml Handles subscribing and calling callbacks during simulation setup. It provides modules with various simulation parameters and data. ```APIDOC ## SimulationSetupNotifier ### Description Handles subscribing and calling callbacks during simulation setup. Provides modules with the internal data they wrote to .tpr files, allows adding atom indices to local atom sets, provides starting behavior, logging class, topology, enables reporting energy output preferences, disabling PME ranks, provides PBC type, time-step, ensemble temperature, communicator, multisim data, plain pairlist ranges, input filenames, direct provider, and Plumed input filename. ### Template Parameters - **KeyValueTreeObject&** (type) - Provides modules with the internal data they wrote to .tpr files. - **LocalAtomSetManager*** (type) - Enables modules to add atom indices to local atom sets to be managed. - **StartingBehavior&** (type) - Provides modules with the starting behavior of the simulation. - **MDLogger&** (type) - Allows MdModule to use standard logging class for messages output. - **gmx_mtop_t&** (type) - Provides the topology of the system to the modules. - **MDModulesEnergyOutputToDensityFittingRequestChecker*** (type) - Enables modules to report if they want to write their energy output to the density fitting field in the energy files. - **MDModulesEnergyOutputToQMMMRequestChecker*** (type) - Enables QMMM module to report if it wants to write its energy output to the "Quantum En." field in the energy files. - **MDModulesEnergyOutputToNNPotRequestChecker*** (type) - Enables NNPot module to report if it wants to write its energy output to the "NN Potential" field in the energy files. - **SeparatePmeRanksPermitted*** (type) - Enables modules to report if they want to disable dedicated PME ranks. - **PbcType&** (type) - Provides modules with the periodic boundary condition type that is used during the simulation. - **SimulationTimeStep&** (type) - Provides modules with the simulation time-step that allows them to interconvert between step and time information. - **EnsembleTemperature&** (type) - Provides modules with the (eventual) constant ensemble temperature. - **MpiComm&** (type) - Provides a communicator to the modules during simulation setup. - **gmx_multisim_t*** (type) - Provides access to multisim data. - **PlainPairlistRanges*** (type) - Provides access to plain pairlist ranges. - **MdRunInputFilename** (type) - Provides the input filename for the MD run. - **EdrOutputFilename** (type) - Provides the output filename for the EDR file. - **MDModulesDirectProvider*** (type) - Provides direct access to simulation data. - **PlumedInputFilename** (type) - Provides the Plumed input filename. ``` -------------------------------- ### Constructor: gmx::BenchmarkSystem Source: https://manual.gromacs.org/2026.1/doxygen/html-full/structgmx_1_1BenchmarkSystem.xhtml Initializes a new benchmark system by stacking cubic boxes of water molecules. ```APIDOC ## Constructor gmx::BenchmarkSystem ### Description Generates a benchmark system of size multiplicationFactor times the base size by stacking cubic boxes of 1000 water molecules with 3000 atoms total. ### Parameters #### Path Parameters - **multiplicationFactor** (int) - Required - Should be a power of 2, is checked. - **outputFile** (const std::string &) - Required - The name of the csv file to write benchmark results. ``` -------------------------------- ### Notify Start of Each Data Frame Source: https://manual.gromacs.org/2026.1/doxygen/html-full/classgmx_1_1AnalysisDataSimpleHistogramModule.xhtml Callback function called at the start of each data frame. It receives header information for the current frame. ```cpp void frameStarted(const AnalysisDataFrameHeader &header) override ``` -------------------------------- ### setupMTop Function Source: https://manual.gromacs.org/2026.1/doxygen/html-full/namespacegmx_1_1test_1_1anonymous__namespace_02massrepartitioning_8cpp_03.xhtml Documentation for the setupMTop function within the Gromacs library. ```APIDOC ## void setupMTop (gmx_mtop_t *mtop, ArrayRef< const real > masses, ArrayRef< const int > bonds) ### Description Initializes the molecular topology structure (mtop) using provided masses and bond information. ### Method N/A (Function Signature) ### Endpoint N/A (Internal Function) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (void) This function does not return a value; it modifies the `mtop` structure in place. #### Response Example None ``` -------------------------------- ### AnalysisDataHandle::startFrame Source: https://manual.gromacs.org/2026.1/doxygen/html-full/classgmx_1_1AnalysisDataHandle.xhtml Starts data recording for a new frame, optionally including an x-value and its error. Each frame index should be started exactly once. ```APIDOC ## void gmx::AnalysisDataHandle::startFrame(size_t _index_, real _x_, real _dx_ = `0.0`) ### Description Start data for a new frame. ### Method void ### Endpoint N/A (Member Function) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters - **index** (size_t) - Required - Zero-based index for the frame to start. - **x** (real) - Required - x value for the frame. - **dx** (real) - Optional - Error in x for the frame if applicable. Defaults to `0.0`. ### Request Example ```json { "index": 0, "x": 10.5, "dx": 0.1 } ``` ### Response #### Success Response None #### Response Example ``` // No direct response body for this function ``` ### Exceptions - **unspecified**: Any exception thrown by attached data modules in IAnalysisDataModule::frameStarted(). ``` -------------------------------- ### Run Single Module with Custom Settings Source: https://manual.gromacs.org/2026.1/doxygen/html-full/classgmx_1_1CommandLineModuleManager.xhtml Implements a main() method that runs a given function with custom settings. It additionally calls a settings function to initialize CommandLineModuleSettings, allowing for custom configurations like a different default nice level. ```cpp int gmx::CommandLineModuleManager::runAsMainCMainWithSettings(int _argc_, char *_argv_[], CMainFunction _mainFunction_, InitSettingsFunction _settingsFunction_) ``` -------------------------------- ### init Source: https://manual.gromacs.org/2026.1/doxygen/html-full/classgmx_1_1CommandLineHelpModule.xhtml Initializes the module and provides settings for the runner. This method is currently not called when writing the help. ```APIDOC ## void gmx::CommandLineHelpModule::init ### Description Initializes the module and provides settings for the runner. This will be called before run(), and can be used to adjust initialization that the runner does. This method is currently not called when writing the help. ### Method void ### Endpoint N/A (Member Function) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) None #### Response Example None ### Exceptions None explicitly mentioned, but may throw exceptions as per ICommandLineModule implementation. ```