Skip to content

Commit

Permalink
Merging with master
Browse files Browse the repository at this point in the history
  • Loading branch information
LouieVoit committed Aug 19, 2024
2 parents 7a00585 + 9705620 commit bffbfcc
Show file tree
Hide file tree
Showing 261 changed files with 17,088 additions and 13,539 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/ctest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ name: CTest
on:
push:
branches-ignore:
# If you want the CI to not run, call your branch work-in-progress by naming it `something-WIP`
# If you want the CI to not run, call your branch work-in-progress by naming it `something-WIP` or `something_WIP`
- '*-WIP'
- '*_WIP'
pull_request:
types: [review_requested, ready_for_review]
branches:
- master

Expand Down Expand Up @@ -46,7 +48,7 @@ jobs:
# (b) Check that Compiletest time is < 3m (otherwise modify compiletest)
# (c) Check that combined CMake and Build time is < 60s (Otherwise check CMake build system)
# (d) Check that runtime of each unit test is < 5000 ms (Otherwise modify or disable this test)
# (e) Check that average unit test runtime is < 750 ms (Otherwise optimize long-running unit tests)
# (e) Check that average unit test runtime is < 750 ms (Otherwise optimize long-running unit tests and/or check 'mpirun' set-up time)
# HOW NOT TO PROCEED IF YOU READ THESE LINES BECAUSE THE TIMEOUT WAS HIT:
# (z) increase timeout (unless total number of unit tests is > 500, then change to 20)
##################################################################
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/doxygen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ name: Doxygen Action
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

# Abort running jobs if a new one is triggered
concurrency:
Expand Down Expand Up @@ -47,6 +45,7 @@ jobs:
make -j2 testmamico
ctest
make coverage
mkdir -p ../docs/html # In case Doxygen did not run
mv coverage ../docs/html/coverage
- name: Deploy
Expand Down
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,12 @@ coupling/scenario/kvs-lbmpy/*.ini
*.dot
docs/
*.checkpoint
.vscode/launch.json
*.ova
*.bp.tar.gz
*.bp
*.txt
/runcouette
/runkvs
/runkvs
# Symbolic link to LAMMPS source files
/lammps
115 changes: 85 additions & 30 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ if(BUILD_WITH_MPI)
find_package(MPI REQUIRED)
endif()

if(BUILD_WITH_ADIOS2)
if(NOT "${MD_SIM}" STREQUAL "LS1_MARDYN" AND BUILD_WITH_ADIOS2) #ls1 can come bundled with own adios2, hence finding adios2 later for ls1
enable_language(C)
find_package(ADIOS2 REQUIRED)
endif()
Expand Down Expand Up @@ -138,8 +138,27 @@ endif()

if("${MD_SIM}" STREQUAL "LS1_MARDYN")
set(LS1_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ls1" CACHE PATH "ls1 source directory")
set(LS1_BUILD_DIR_NAME "build" CACHE STRING "ls1 build directory name")
load_cache(${LS1_SRC_DIR}/${LS1_BUILD_DIR_NAME} READ_WITH_PREFIX LS1_CACHE_ ENABLE_AUTOPAS ENABLE_MPI PRECISION ENABLE_VTK ENABLE_ADIOS2 CMAKE_BUILD_TYPE)
set(LS1_BUILD_DIR_NAMES "build-seq;build-par;build" CACHE STRING "ls1 build directory names. First one working is used")
list(LENGTH LS1_BUILD_DIR_NAMES NUM_BUILD_DIRS)
# we have to use the last one anyway (no other options left in list), so skip that check
MATH(EXPR NUM_BUILD_DIRS "${NUM_BUILD_DIRS}-1")
set(BUILD_CANDIDATE_IDX 0)
list(GET LS1_BUILD_DIR_NAMES ${BUILD_CANDIDATE_IDX} LS1_BUILD_DIR_NAME)
while(BUILD_CANDIDATE_IDX LESS NUM_BUILD_DIRS)
# check if this build dir works
if(EXISTS "${LS1_SRC_DIR}/${LS1_BUILD_DIR_NAME}")
load_cache(${LS1_SRC_DIR}/${LS1_BUILD_DIR_NAME} READ_WITH_PREFIX CANDIDATE_CACHE_ ENABLE_MPI PRECISION)
endif()
if(CANDIDATE_CACHE_PRECISION AND (CANDIDATE_CACHE_ENABLE_MPI STREQUAL BUILD_WITH_MPI))
# this candidate build dir seems good, stop searching and try it
break()
endif()
# this candidate build dir does not work, try next one in list
MATH(EXPR BUILD_CANDIDATE_IDX "${BUILD_CANDIDATE_IDX}+1")
list(GET LS1_BUILD_DIR_NAMES ${BUILD_CANDIDATE_IDX} LS1_BUILD_DIR_NAME)
endwhile()
message(STATUS ">> ls1 build directory used: " ${LS1_SRC_DIR}/${LS1_BUILD_DIR_NAME})
load_cache(${LS1_SRC_DIR}/${LS1_BUILD_DIR_NAME} READ_WITH_PREFIX LS1_CACHE_ ENABLE_AUTOPAS ENABLE_MPI PRECISION ENABLE_VTK ENABLE_ADIOS2 FIND_PACKAGE_ADIOS2 CMAKE_BUILD_TYPE)
if(NOT LS1_CACHE_PRECISION)
message(FATAL_ERROR "Could not read the ls1 build cache. Please ensure the path to the ls1 root folder and the name of the build folder are correct.")
endif()
Expand All @@ -166,9 +185,25 @@ if("${MD_SIM}" STREQUAL "LS1_MARDYN")
message(FATAL_ERROR "xerces-c lib not found. Disable VTK support, if you do not need it.")
endif()
endif()
if(BUILD_WITH_ADIOS2 AND NOT LS1_CACHE_ENABLE_ADIOS2)
message(FATAL_ERROR "Please rebuild ls1 with ENABLE_ADIOS2 turned on, if adios2 is needed, else turn BUILD_WITH_ADIOS2 off")
endif()
if(LS1_CACHE_ENABLE_ADIOS2)
enable_language(C)
find_package(ADIOS2 REQUIRED)
if(NOT BUILD_WITH_ADIOS2)
message(WARNING "ls1 built with adios2, but BUILD_WITH_ADIOS2 not enabled by MaMiCo!\nProceeding with adios2 enabled only for ls1")
endif()
if(LS1_CACHE_FIND_PACKAGE_ADIOS2)
enable_language(C)
find_package(ADIOS2 REQUIRED)
message(STATUS "Using adios2 available in environment for ls1")
else()
enable_language(C)
find_package(ADIOS2 REQUIRED PATHS ${LS1_SRC_DIR}/${LS1_BUILD_DIR_NAME}/_deps/adios2fetch-build NO_DEFAULT_PATH)
message(STATUS "Using adios2 fetched by ls1")
if(BUILD_WITH_ADIOS2)
message(WARNING "Both ls1 and MaMiCo will use adios2. Double check the library versions/paths!")
endif()
endif()
endif()
message(STATUS ">> ls1 found and initialized")
endif()
Expand Down Expand Up @@ -293,6 +328,12 @@ set_target_properties(multi-simplemd PROPERTIES CXX_STANDARD 17)
# MaMiCo interface
#
add_library(mamico INTERFACE)
if(BUILD_WITH_MPI)
option(USE_COLLECTIVE_MPI "Use broadcast/reduce between MD instances, default is OFF." OFF)
if(USE_COLLECTIVE_MPI)
target_compile_definitions(mamico INTERFACE USE_COLLECTIVE_MPI)
endif()
endif()
if(BUILD_WITH_EIGEN)
target_compile_definitions(mamico INTERFACE BUILD_WITH_EIGEN)
target_link_libraries(mamico INTERFACE Eigen3::Eigen)
Expand All @@ -301,9 +342,12 @@ if(BUILD_WITH_ADIOS2)
target_compile_definitions(mamico INTERFACE BUILD_WITH_ADIOS2)
endif()
target_compile_definitions(mamico INTERFACE ${MD_SIM} MDDim3)
target_compile_options(mamico INTERFACE -Wall -Wno-unknown-warning-option -Wno-unknown-pragmas -Wfatal-errors -Wno-reorder)
target_compile_options(mamico INTERFACE -Wall -Wno-unknown-warning-option -Wno-unknown-pragmas -Wfatal-errors)
if("${MD_SIM}" STREQUAL "LS1_MARDYN") #to be removed when ls1 updates to use the latest autopas
target_compile_options(mamico INTERFACE -Wno-reorder)
endif()
if(BUILD_WITH_MPI)
target_compile_definitions(mamico INTERFACE MDCoupledParallel TarchParallel MPICH_IGNORE_CXX_SEEK ENABLE_POST_MULTI_INSTANCE_FILTERING)
target_compile_definitions(mamico INTERFACE MDCoupledParallel TarchParallel MPICH_IGNORE_CXX_SEEK)
target_compile_options(mamico INTERFACE -Werror -Wno-int-in-bool-context)
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "FujitsuClang")
target_compile_options(mamico INTERFACE -Wno-uninitialized)
Expand All @@ -330,7 +374,7 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "Fu
endif()
# we always link against libsimplemd, even if ${MD_SIM} not SIMPLE_MD, so that we can use the simpleMD configuration
target_link_libraries(mamico INTERFACE libsimplemd)
if("${MD_SIM}" STREQUAL "LAMMPS_MD")
if("${MD_SIM}" STREQUAL "LAMMPS_MD" OR "${MD_SIM}" STREQUAL "LAMMPS_DPD")
target_link_libraries(mamico INTERFACE ${LAMMPS_LINK_LIBRARIES})
target_include_directories(mamico INTERFACE ${LAMMPS_INCLUDE_DIRS})
#target_compile_options(mamico INTERFACE ${LAMMPS_CFLAGS_OTHER})
Expand Down Expand Up @@ -374,13 +418,17 @@ elseif("${MD_SIM}" STREQUAL "LS1_MARDYN")
target_link_libraries(mamico INTERFACE adios2::adios2)
endif()
endif()
if(ENABLE_COVERAGE)
target_compile_options(mamico INTERFACE --coverage)
target_link_libraries(mamico INTERFACE gcov)
endif()

if(CMAKE_BUILD_TYPE STREQUAL "DebugMD")
target_compile_definitions(mamico INTERFACE MDCoupledDebug TarchDebug NLM_DEBUG DEBUG_FILTER_PIPELINE)
target_compile_definitions(mamico INTERFACE MDCoupledDebug MDCoupledError TarchDebug NLM_DEBUG DEBUG_FILTER_PIPELINE)
target_compile_options(mamico INTERFACE -Og -g3)
elseif(CMAKE_BUILD_TYPE STREQUAL "Debug")
if (NOT ENABLE_COVERAGE)
target_compile_definitions(mamico INTERFACE MDCoupledDebug TarchDebug NLM_DEBUG DEBUG_FILTER_PIPELINE PINT_DEBUG)
target_compile_definitions(mamico INTERFACE MDCoupledDebug MDCoupledError TarchDebug NLM_DEBUG DEBUG_FILTER_PIPELINE PINT_DEBUG)
endif()
target_compile_options(mamico INTERFACE -Og -g3)
elseif(CMAKE_BUILD_TYPE STREQUAL "DebugOptimized")
Expand Down Expand Up @@ -423,7 +471,7 @@ if("${MD_SIM}" STREQUAL "LAMMPS_MD")
${MAMICO_SOURCES}
"tarch/tinyxml2/tinyxml2.cpp"
"tarch/utils/RandomNumberService.cpp"
"coupling/test/integration/main_lammps.cpp"
"test/integration/main_lammps.cpp"
)
add_executable(test_lammps ${TEST_LAMMPS_SOURCES})
set_target_properties(test_lammps PROPERTIES CXX_STANDARD 17)
Expand Down Expand Up @@ -467,13 +515,12 @@ set(CLANGFORMAT_SOURCES
"tarch/la/Matrix.h"
"tarch/TarchDefinitions.h"
"coupling/services/MultiMDCellService.h"
"coupling/services/MacroscopicCellServiceMacroOnly.h"
"coupling/services/MacroscopicCellService.cpph"
"coupling/services/MacroscopicCellTraversalWrappers.cpph"
"coupling/services/MacroscopicCellService.h"
"coupling/services/CouplingCellServiceDummy.h"
"coupling/services/CouplingCellService.cpph"
"coupling/services/CouplingCellTraversalWrappers.cpph"
"coupling/services/CouplingCellService.h"
"coupling/ErrorEstimation.h"
"coupling/ParticleInsertion.h"
"coupling/IndexConversionMD2Macro.cpph"
"coupling/SetGivenVelocity4MomentumInsertion.h"
"coupling/MomentumController.h"
"coupling/filtering/FilterPipeline.cpph"
Expand Down Expand Up @@ -513,7 +560,7 @@ set(CLANGFORMAT_SOURCES
"coupling/python-binding/mamico.cpp"
"coupling/python-binding/conversion.h"
"coupling/NoParticleInsertion.h"
"coupling/MacroscopicCellPlotter.h"
"coupling/CouplingCellPlotter.h"
"coupling/NoMomentumInsertion.h"
"coupling/cell-mappings/ComputeKineticEnergyMapping.h"
"coupling/cell-mappings/MoleculeExtractor.h"
Expand All @@ -532,7 +579,6 @@ set(CLANGFORMAT_SOURCES
"coupling/cell-mappings/NieVelocityImpositionMapping.h"
"coupling/cell-mappings/ZhouBoundaryForce.h"
"coupling/ZhouBoundaryForceController.h"
"coupling/IndexConversionMD2Macro.h"
"coupling/indexing/CellIndex.cpph"
"coupling/indexing/IndexingService.cpp"
"coupling/indexing/Operations.h"
Expand All @@ -551,12 +597,10 @@ set(CLANGFORMAT_SOURCES
"coupling/sendrecv/SendReceiveBuffer.cpph"
"coupling/sendrecv/FromMacro2MD.cpph"
"coupling/sendrecv/FromMD2Macro.h"
"coupling/IndexConversion.cpph"
"coupling/UsherParticleInsertion.cpph"
"coupling/NoBoundaryForce.h"
"coupling/CouplingMDDefinitions.h"
"coupling/AdditiveMomentumInsertion.h"
"coupling/IndexConversion.h"
"coupling/transferstrategies/AveragingTransferStrategy.h"
"coupling/transferstrategies/TransferStrategy4NieCoupling.h"
"coupling/transferstrategies/TransferStrategy4SchwarzCoupling.h"
Expand All @@ -569,9 +613,9 @@ set(CLANGFORMAT_SOURCES
"coupling/paralleltopology/ZYXTopology.h"
"coupling/paralleltopology/XYZTopology.h"
"coupling/paralleltopology/ParallelTopologyFactory.h"
"coupling/datastructures/MacroscopicCells.h"
"coupling/datastructures/MacroscopicCell.h"
"coupling/datastructures/MacroscopicCells.cpph"
"coupling/datastructures/CellContainer.h"
"coupling/datastructures/FlexibleCellContainer.h"
"coupling/datastructures/CouplingCell.h"
"coupling/datastructures/Molecule.h"
"coupling/MultiMDMediator.h"
"coupling/configurations/ParticleInsertionConfiguration.h"
Expand All @@ -581,9 +625,9 @@ set(CLANGFORMAT_SOURCES
"coupling/configurations/MaMiCoConfiguration.cpph"
"coupling/configurations/MomentumInsertionConfiguration.h"
"coupling/configurations/ParallelTopologyConfiguration.h"
"coupling/configurations/MacroscopicCellConfiguration.h"
"coupling/configurations/CouplingCellConfiguration.h"
"coupling/configurations/ParticleInsertionConfiguration.cpp"
"coupling/configurations/MacroscopicCellConfiguration.cpph"
"coupling/configurations/CouplingCellConfiguration.cpph"
"coupling/configurations/MaMiCoConfiguration.h"
"coupling/configurations/ThermostatConfiguration.h"
"coupling/configurations/TimeIntegrationConfiguration.h"
Expand All @@ -595,6 +639,11 @@ set(CLANGFORMAT_SOURCES
"coupling/interface/impl/SimpleMD/SimpleMDMoleculeIterator.h"
"coupling/interface/impl/SimpleMD/SimpleMDSolverInterface.h"
"coupling/interface/impl/SimpleMD/SimpleMDMolecule.h"
"coupling/interface/impl/ls1/LS1MDSolverInterface.h"
"coupling/interface/impl/ls1/LS1MoleculeIterator.h"
"coupling/interface/impl/ls1/LS1StaticCommData.h"
"coupling/interface/impl/ls1/LS1Molecule.h"
"coupling/interface/impl/ls1/LS1RegionWrapper.h"
"coupling/interface/impl/macroscopictestsolvers/TestMacroscopicSolverInterface.h"
"coupling/interface/impl/macroscopictestsolvers/TestMacroscopicSolver.h"
"coupling/interface/impl/macroscopictestsolvers/MacroscopicSolverFactory.h"
Expand All @@ -607,7 +656,6 @@ set(CLANGFORMAT_SOURCES
"coupling/interface/MDSolverInterface.h"
"coupling/interface/PintableMacroSolver.h"
"coupling/KineticEnergyController.h"
"coupling/solvers/FiniteDifferenceSolver.h"
"coupling/solvers/FDCouetteSolver.h"
"coupling/solvers/IcoFoamInterface.h"
"coupling/solvers/LBCouetteSolver.h"
Expand Down Expand Up @@ -642,13 +690,22 @@ set(CLANGFORMAT_SOURCES
"test/unit/coupling/solvers/LBCouetteSolverStateTest.cpp"
"test/unit/coupling/solvers/PintableLBCouetteSolverTest.cpp"
"test/unit/getTestNames.cpp"
"test/unit/coupling/InstanceHandlingTest.cpp"
"test/unit/coupling/indexing/OperationsTest.cpp"
"test/unit/coupling/indexing/CellIndexTest.cpp"
"test/unit/coupling/indexing/IndexingServiceTest.cpp"
"test/unit/coupling/interface/impl/SimpleMD/SimpleMDMoleculeTest.cpp"
"test/unit/coupling/interface/impl/ls1/LS1MDSolverInterfaceTest.cpp"
"test/unit/coupling/interface/impl/ls1/LS1MoleculeIteratorTest.cpp"
"test/unit/coupling/interface/impl/ls1/LS1MoleculeTest.cpp"
"test/unit/coupling/interface/impl/ls1/LS1RegionWrapperTest.cpp"
"test/unit/coupling/interface/impl/ls1/LS1StaticCommDataTest.cpp"
"test/unit/coupling/datastructures/LinkedCellContainerTest.cpp"
"test/unit/coupling/datastructures/FlexibleCellContainerTest.cpp"
"test/unit/coupling/datastructures/CellContainerTest.cpp"
"coupling/scenario/CouetteScenario.h"
"coupling/scenario/main_couette.cpp"
"coupling/scenario/Scenario.h"
"coupling/MPIIndexConversion.h"
"coupling/InstanceHandling.h"
"coupling/MomentumInsertion.h"
"simplemd/services/ExternalForceService.cpp"
Expand Down Expand Up @@ -769,9 +826,6 @@ target_link_libraries(benchmarks PRIVATE mamico)
# Coverage
#
if(ENABLE_COVERAGE)
target_compile_options(mamico INTERFACE -O0 --coverage)
target_link_libraries(mamico INTERFACE gcov)

# find required tools
find_program(LCOV lcov REQUIRED)
find_program(GENHTML genhtml REQUIRED)
Expand All @@ -798,6 +852,7 @@ if (BUILD_TESTING)
file(GLOB_RECURSE TEST_SOURCES_MD "test/unit/coupling/interface/impl/SimpleMD/*Test.cpp")
elseif("${MD_SIM}" STREQUAL "LS1_MARDYN")
file(GLOB_RECURSE TEST_SOURCES_MD "test/unit/coupling/interface/impl/ls1/*Test.cpp")
list(FILTER TEST_SOURCES_TOP EXCLUDE REGEX "test/unit/coupling/InstanceHandlingTest.cpp")
elseif("${MD_SIM}" STREQUAL "LAMMPS_MD" OR "${MD_SIM}" STREQUAL "LAMMPS_DPD")
file(GLOB_RECURSE TEST_SOURCES_MD "test/unit/coupling/interface/impl/LAMMPS/*Test.cpp")
else()
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Optional dependencies are:
* [OpenFOAM](https://develop.openfoam.com/Development/openfoam/blob/develop/doc/Build.md), for coupling to CFD simulations with OpenFOAM.
* [preCICE](https://precice.org/), for coupling with other solvers using the preCICE coupling library.
* [ls1-MarDyn](https://www.ls1-mardyn.de/home.html), for coupling to MD simulations with ls1.
* [LAMMPS](https://lammps.org/), for coupling to MD simulations with LAMMPS.
* [LCOV](https://github.com/linux-test-project/lcov) and [gcc](https://gcc.gnu.org/), for test code coverage analysis.

## Build instructions
Expand Down Expand Up @@ -50,6 +51,11 @@ Optional dependencies are:

* Make MaMiCo as normal, choosing LS1_MARDYN as your MD library.

### Additional instructions to build with LAMMPS
1. [Download the LAMMPS source code](https://docs.lammps.org/Install_git.html), [build it using CMake](https://docs.lammps.org/Build_cmake.html) with the option `-DBUILD_SHARED_LIBS=ON`, and install it using `make install`.
2. Make LAMMPS available through pgk-config with `export PKG_CONFIG_PATH=/home/$(whoami)/.local/lib/pkgconfig`.
3. Create a symbolic link to the LAMMPS header files in the MaMiCo root folder using `ln -s <path to LAMMPS>/src <path to MaMiCo>/lammps`

## Input file construction and first runs
* The build instructions have created an executable of the standard Couette flow test case, the file is called 'couette'. It expects an XML configuration file named 'couette.xml' in the current working directory.
* An example simulation configuration file can be found [here](https://github.com/HSU-HPC/MaMiCo/blob/master/examples/couette.xml.template), other template input files are in the [examples](https://github.com/HSU-HPC/MaMiCo/blob/master/examples) folder as well.
Expand Down
21 changes: 10 additions & 11 deletions coupling/AdditiveMomentumInsertion.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "coupling/MomentumInsertion.h"
#include "coupling/cell-mappings/ComputeMassMapping.h"
#include "coupling/cell-mappings/SetMomentumMapping.h"
#include "coupling/datastructures/MacroscopicCell.h"
#include "coupling/datastructures/CouplingCell.h"
#include "tarch/la/Vector.h"

/** @brief everything necessary for coupling operations, is defined in here */
Expand All @@ -17,10 +17,10 @@ template <class LinkedCell, unsigned int dim> class AdditiveMomentumInsertion;
}

/** This class allows to add momentum to molecules. In each MD timestep, it
* takes a respective fraction from the momentum buffer of a macroscopic cell
* and adds this momentum to the molecules of the macroscopic cell.
* takes a respective fraction from the momentum buffer of a coupling cell
* and adds this momentum to the molecules of the coupling cell.
* @brief used to manipulate the momentum/velocity of the molecules contained
* in a macroscopic cell.
* in a coupling cell.
* @tparam LinkedCell the LinkedCell class is given by the implementation of
* linked cells in the molecular dynamics simulation
* @tparam dim the integer dim refers to the spacial dimension of the
Expand All @@ -43,17 +43,16 @@ template <class LinkedCell, unsigned int dim> class coupling::AdditiveMomentumIn
/** returns 1 since momentum shall be inserted in every time step
* @brief returns the interval of time steps for momentum insertion
* @returns 1 */
virtual unsigned int getTimeIntervalPerMomentumInsertion() const { return 1; }
unsigned int getTimeIntervalPerMomentumInsertion() const override { return 1; }

/** inserts the momentum of the macroscopic cell and distributes it over all
/** inserts the momentum of the coupling cell and distributes it over all
* molecules. This method does not conserve the kinetic energy of the
* respective macroscopic cell. To conserve the energy as well, see the
* respective coupling cell. To conserve the energy as well, see the
* description of MomentumController on details how to do that.
* @brief inserts momentum to the cell
* @param cell macroscopic cell to insert momentum to
* @param currentMacroscopicCellIndex macroscopic cell index of the cell */
virtual void insertMomentum(coupling::datastructures::MacroscopicCellWithLinkedCells<LinkedCell, dim>& cell,
const unsigned int& currentMacroscopicCellIndex) const {
* @param cell coupling cell to insert momentum to
* @param idx coupling cell index of the cell */
void insertMomentum(coupling::datastructures::CouplingCellWithLinkedCells<LinkedCell, dim>& cell, I02 idx) const override {
const unsigned int timeIntervalMomentumInsertion = getTimeIntervalPerMomentumInsertion();
// determine fraction of momentum that is to be inserted in this frame
double fraction = 1.0 / ((_numberMDTimestepsPerCouplingCycle / timeIntervalMomentumInsertion) +
Expand Down
Loading

0 comments on commit bffbfcc

Please sign in to comment.