Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes to mamico plugin after mamico refactor #293

Open
wants to merge 114 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 104 commits
Commits
Show all changes
114 commits
Select commit Hold shift + click to select a range
766e562
small ancient bug fix
amartyads Mar 15, 2023
a64a78e
initial utils added
amartyads Mar 24, 2023
ecb6245
added const, finished methods
amartyads Mar 24, 2023
e772fc4
rename
amartyads Mar 24, 2023
4bd1be4
moved functions to utils
amartyads Mar 27, 2023
34250ae
more utils
amartyads Mar 28, 2023
02b49d6
files moved
amartyads Apr 2, 2023
59efed3
additional util
amartyads Apr 2, 2023
319be03
files moved back
amartyads Apr 2, 2023
b58a033
xml reading done
amartyads Apr 2, 2023
4d1a3d2
boundary condition initial skeleton
amartyads Apr 3, 2023
9266f87
reflecting boundary done, untested
amartyads Apr 4, 2023
837250f
outflow done, not tested
amartyads Apr 4, 2023
61d6e91
working wall detection, wrong paths (halos)
amartyads Apr 4, 2023
383495f
removed debug, tested for 8x8
amartyads Apr 5, 2023
a78a2f4
halo removal PoC
amartyads Apr 15, 2023
c765df4
cleanup. modern arrays
amartyads Apr 17, 2023
2ae6831
bugfix
amartyads May 15, 2023
1e251a7
better names, changed responsibilities of classes
amartyads May 25, 2023
d972360
added timer
amartyads May 25, 2023
16b7d75
more outputs
amartyads May 26, 2023
8c55679
bugfix, code working here
amartyads May 26, 2023
f7b958d
renames and moves
amartyads Jun 1, 2023
53b23f6
halo conversion
amartyads Jun 2, 2023
8d24d76
Normal domain decomp tested, bugfixed
amartyads Jul 19, 2023
bcfa6a9
Merge branch 'master' into reflective-boundaries
amartyads Jul 19, 2023
35695bd
comments, update to all-options
amartyads Jul 19, 2023
2efb5b4
option from previous PR
amartyads Jul 19, 2023
fbecbde
some renames
amartyads Jul 19, 2023
2c94932
added verlet skin to halo check region
amartyads Aug 16, 2023
eb964bd
cleanup
amartyads Aug 16, 2023
75dcb81
Merge branch 'master' into reflective-boundaries
amartyads Sep 8, 2023
03256bc
Merge branch 'master' into reflective-boundaries
amartyads Sep 27, 2023
31e1e48
do not enter loops if no non-periodic boundary
amartyads Sep 27, 2023
233c02d
boundary files should compile in serial
amartyads Feb 19, 2024
8523df8
added to comment
amartyads Feb 20, 2024
0b89f6e
change to how fpic is enabled
amartyads Feb 21, 2024
663745b
bugfix
amartyads Feb 21, 2024
eae1b8b
merge with master
amartyads Feb 23, 2024
6032ae4
log namespacing
amartyads Feb 23, 2024
9235c87
changes to names to make plugin work, documentation, clangformat
amartyads Feb 26, 2024
a396b71
full plugin now optionally compiled
amartyads Feb 26, 2024
4256464
Apply Fabio's suggestions from code review
amartyads Feb 26, 2024
5bf619a
move halo removal location
amartyads Mar 19, 2024
1b8adfb
bugfix, clearer function name
amartyads Mar 20, 2024
f4592dc
add check for overlappingp2p
amartyads Mar 20, 2024
15e3b7d
Merge branch 'master' into reflective-boundaries
amartyads May 29, 2024
b2815fe
Merge branch 'master' into mamico-postrefactor-fix
amartyads Aug 9, 2024
e098a25
comments by Christoph, static codecheck pass
amartyads Aug 9, 2024
70a8495
Merge branch 'mamico-postrefactor-fix' into reflective-boundaries
amartyads Aug 9, 2024
53a9b47
removed simulation::exit
amartyads Aug 9, 2024
39a3a83
clangformat
amartyads Aug 9, 2024
7d25c51
clangformat
amartyads Aug 9, 2024
5bc422d
move enums, remove files, clangformat
amartyads Sep 2, 2024
eac7657
some documentation in boundaryutils
amartyads Sep 2, 2024
b1b0c0b
no use of globsim object in boundary, fix for lost particles
amartyads Sep 4, 2024
6359485
renames, documentation
amartyads Sep 4, 2024
6f7632a
clangformat
amartyads Sep 4, 2024
0b732bd
Merge branch 'master' into mamico-postrefactor-fix
amartyads Sep 10, 2024
552d79f
Merge branch 'master' into reflective-boundaries
amartyads Sep 10, 2024
c79562d
newlines for static code checker
amartyads Sep 10, 2024
57fc6fd
removed unused code that dealt with halo cells
amartyads Sep 11, 2024
3caeec9
pass molecule by reference
amartyads Sep 11, 2024
e292e8f
Apply suggestions from code review
amartyads Sep 11, 2024
c20a668
replace PERIODIC in more places, documentation
amartyads Sep 11, 2024
b133acb
better variable names
amartyads Sep 11, 2024
fe0dca7
removed skin from halo buffer
amartyads Sep 11, 2024
2b1d448
more documentation
amartyads Sep 11, 2024
147d826
added equality check for floats
amartyads Sep 11, 2024
407998a
compile errors fixed
amartyads Sep 11, 2024
463799c
Apply suggestions from code review
amartyads Sep 12, 2024
6b7edb0
typo
amartyads Sep 13, 2024
9a6084f
chnage function name to be more clear
amartyads Sep 13, 2024
3c165c5
re-update variable name
amartyads Sep 13, 2024
fba5ec3
Apply suggestions from code review
amartyads Sep 13, 2024
87894c4
reverting formatting, some screwup
amartyads Sep 13, 2024
c3b3d48
fix for map iteration
amartyads Sep 13, 2024
b36c902
Apply suggestions from code review
amartyads Sep 13, 2024
0b430a9
Apply suggestions from code review
amartyads Sep 13, 2024
fcfc0bc
adjustments to simulation.cpp (xml reading, errors, logging)
amartyads Sep 13, 2024
f35c631
Merge branch 'reflective-boundaries' of https://github.com/ls1mardyn/…
amartyads Sep 13, 2024
158b0ab
removed permissibleDimensionsString, formatting break, compiling
amartyads Sep 13, 2024
59f3463
style copied from suggestions
amartyads Sep 13, 2024
c06cde2
remove std::tie, add comment on outflow
amartyads Sep 16, 2024
e849d34
Apply suggestions from code review
amartyads Sep 16, 2024
fc81653
moved boundary init, lambda, remove std::array setRegions
amartyads Sep 17, 2024
4593083
consts, removed molecule deref
amartyads Sep 17, 2024
541a9f2
moved math to math.h, fixed array conversions
amartyads Sep 17, 2024
dfd5c57
rename get_halo_L, buffers now c++ arrays
amartyads Sep 17, 2024
9cad8d9
renames ls1dim to ls1dimindex
amartyads Sep 17, 2024
a8ee7a1
renamed "buffer", moved more math
amartyads Sep 18, 2024
1ab950b
split utils file (separation of concerns)
amartyads Sep 18, 2024
10de6cb
new clangformat
amartyads Sep 19, 2024
f0a1c32
documentation, clangformat (new)
amartyads Sep 19, 2024
b311f23
better error messages, format and docstring plugin
amartyads Sep 19, 2024
e625661
removed unised vars, clangformat
amartyads Sep 19, 2024
c958368
Merge branch 'mamico-postrefactor-fix' into reflective-boundaries
amartyads Sep 19, 2024
76d5191
Add const to getters and add some doc
HomesGH Sep 20, 2024
e38f4c7
Apply suggestions from review to ResultWriter.cpp
HomesGH Sep 20, 2024
741885f
Minor fixes regarding const in Domain
HomesGH Sep 20, 2024
570edce
align switch cases
amartyads Sep 20, 2024
8b6a5f6
bugfix
amartyads Sep 23, 2024
2db952e
some more documentation
amartyads Sep 23, 2024
c0c5581
bugfix, particles actually being reflected now
amartyads Oct 22, 2024
125c3b6
Merge pull request #339 from ls1mardyn/reflective-boundaries
amartyads Oct 29, 2024
ce1066d
Merge branch 'master' into mamico-postrefactor-fix
amartyads Oct 29, 2024
ed42fac
static codechecker, MARDYN_EXIT
amartyads Oct 29, 2024
393f26a
Update src/utils/Math.h
amartyads Nov 26, 2024
c6cd280
suggestions from code review
amartyads Nov 26, 2024
53589b1
Merge branch 'mamico-postrefactor-fix' of https://github.com/ls1mardy…
amartyads Nov 26, 2024
ad6cbac
rename variable
amartyads Nov 26, 2024
b553971
Apply suggestions from code review
amartyads Nov 28, 2024
2363140
Apply suggestions from code review
amartyads Nov 28, 2024
c0c7aae
Apply suggestions from code review
amartyads Nov 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 9 additions & 12 deletions cmake/modules/mamico.cmake
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
option(MAMICO_COUPLING "Couple with MaMiCo" OFF)
if (MAMICO_COUPLING)
message(STATUS "MaMiCo coupling enabled. ls1 mardyn will compile as library. No executable will be created.")
set(MAMICO_COMPILE_DEFINITIONS MAMICO_COUPLING MDDim3)
option(MAMICO_ENABLE_FPIC "Enable -fPIC flag for MaMiCo python bindings" OFF)
set(MAMICO_SRC_DIR CACHE PATH "Root directory of the MaMiCo codebase")
message(STATUS "MaMiCo coupling enabled. ls1 mardyn will compile as library. No executable will be created.")
set(MAMICO_COMPILE_DEFINITIONS MAMICO_COUPLING MDDim3)
option(MAMICO_ENABLE_FPIC "Enable -fPIC flag for MaMiCo python bindings" OFF)
set(MAMICO_SRC_DIR CACHE PATH "Root directory of the MaMiCo codebase")
if(NOT MAMICO_SRC_DIR)
message(FATAL_ERROR "MaMiCo source directory not specified.")
endif()
if(ENABLE_MPI)
set(MAMICO_MPI_DEFINITIONS MDCoupledParallel TarchParallel)
endif()
if(MAMICO_ENABLE_FPIC)
set(MAMICO_COMPILE_OPTIONS "${MAMICO_COMPILE_OPTIONS} -fPIC")
endif()
message(FATAL_ERROR "MaMiCo source directory not specified.")
endif()
if(ENABLE_MPI)
set(MAMICO_MPI_DEFINITIONS MDCoupledParallel TarchParallel)
endif()
else()
message(STATUS "MaMiCo coupling disabled.")
endif()
amartyads marked this conversation as resolved.
Show resolved Hide resolved
11 changes: 10 additions & 1 deletion examples/all-options.xml
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@
</basis>
<origin> <x>0.0</x> <y>0.0</y> <z>0.0</z> </origin>
</generator>

</phasespacepoint>
</ensemble>

Expand All @@ -196,6 +195,16 @@
<overlappingCollectives>False</overlappingCollectives> <!-- true if overlapping collectives should be used, false otherwise. REQUIRES MPI>=3! -->
<overlappingStartAtStep>5</overlappingStartAtStep> <!-- Start overlapping at given step (default: 5), only relevant if overlappingCollectives==True -->
<overlappingP2P>False</overlappingP2P> <!-- Defines whether to use overlapping p2p communication or not. Default: False -->
<!-- Select the boundary type for each dimension. Available options are reflecting/reflective, outflow and periodic (default).
particles interacting with a periodic boundary for a certain axis are copied over to the corresponding subdomain, as usual
particles interacting with a reflecting boundary for a certain axis have their velocities reversed for that axis
particles interacting with an outflow boundary with any axis get deleted, irrespective of the other boundary conditions
-->
<boundaries>
<x>reflective</x>
<y>outflow</y>
amartyads marked this conversation as resolved.
Show resolved Hide resolved
<z>periodic</z>
</boundaries>
</parallelisation>
<parallelisation type="StaticIrregDomainDecomposition">
<!-- Provide weights that determine the relative widths of each subdomain
Expand Down
76 changes: 76 additions & 0 deletions examples/simple-boundary-test/ls1config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<?xml version="1.0" encoding="UTF-8"?>
<mardyn version="20100525">
<refunits type="SI">
<length unit="nm">0.34</length>
<mass unit="u">39.948</mass>
<energy unit="K">120</energy>
</refunits>
<simulation type="MD">
<integrator type="Leapfrog">
<timestep unit="reduced">0.005</timestep>
</integrator>
<run>
<currenttime>0</currenttime>
<equilibration><steps>0</steps></equilibration>
<production>
<steps>800</steps>
</production>
</run>
<ensemble type="NVT">
<temperature unit="reduced">1.1</temperature>
<domain type="box">
<lx>10</lx>
<ly>10</ly>
<lz>10</lz>
</domain>
<components>
<moleculetype id="1" name="Arbitrary">
<site type="LJ126" id="1" >
<coords> <x>0.0</x> <y>0.0</y> <z>0.0</z> </coords>
<mass>1.0</mass>
<sigma>1.0</sigma>
<epsilon>1.0</epsilon>
<shifted>true</shifted>
</site>
</moleculetype>
</components>
<phasespacepoint>
<file type="ASCII">simple_checkpoint.inp</file>
</phasespacepoint>
</ensemble>
<algorithm>
<parallelisation type="DomainDecomposition">
<!--<updateFrequency> 10000 </updateFrequency>
<loadBalancer type="none">

</loadBalancer>-->
<!--<MPIGridDims> <x>2</x><y>2</y> <z>2</z> </MPIGridDims>-->
<boundaries> <x>reflective</x><y>outflow</y><z>reflective</z> </boundaries>
</parallelisation>
<datastructure type="AutoPas">
</datastructure>
<cutoffs type="CenterOfMass">
<radiusLJ unit="reduced">2.2</radiusLJ>
</cutoffs>
<electrostatic type="ReactionField">
<epsilon>1.0e+10</epsilon>
</electrostatic>
</algorithm>
<output>
<outputplugin name="VTKMoleculeWriter">
<outputprefix>vtkOutput</outputprefix>
<writefrequency>1</writefrequency>
</ouputplugin>
<outputplugin name="Adios2Writer">
<outputfile>particles.bp</outputfile>
<adios2enginetype>BP4</adios2enginetype>
<writefrequency>1</writefrequency>
</outputplugin>
<!--<outputplugin name="CheckpointWriter">
<type>ASCII</type>
<writefrequency>1</writefrequency>
<outputprefix>cp_binary</outputprefix>
</outputplugin>-->
</output>
</simulation>
</mardyn>
21 changes: 21 additions & 0 deletions examples/simple-boundary-test/simple_checkpoint.inp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
mardyn trunk 20120726
currentTime 0
Length 10 10 10
Temperature 1.1
NumberOfComponents 1
1 0 0 0 0
0 0 0 1 1 1 0
0 0 0
1e+10
NumberOfMolecules 10
MoleculeFormat IRV
0 7.5 5 5 -3 0 0
1 2.5 5 5 0 0 0
2 2.5 7.5 5 0 0 0
3 2.5 2.5 5 0 0 0
4 2.5 5 2.5 0 0 0
5 2.5 5 7.5 0 0 0
6 2.5 7.5 7.5 0 0 0
7 2.5 7.5 2.5 0 0 0
8 2.5 2.5 7.5 0 0 0.69
9 2.5 2.5 2.5 0 -1.1 -1
10 changes: 6 additions & 4 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ if(NOT ENABLE_UNIT_TESTS)
list(FILTER MY_SRC EXCLUDE REGEX "/tests/")
endif()

# if mpi is not enabled, remove the uneeded source files
# if mpi is not enabled, remove the unneeded source files
if(NOT ENABLE_MPI)
# duplicate the list
set(MY_SRC_BACK ${MY_SRC})
# exclude everything from parallel
list(FILTER MY_SRC EXCLUDE REGEX "/parallel/")

# but include DomainDecompBase* and LoadCalc*
# but include DomainDecompBase*, LoadCalc* and Boundary utilities
list(FILTER MY_SRC_BACK INCLUDE REGEX "/parallel/")
list(FILTER MY_SRC_BACK INCLUDE REGEX "DomainDecompBase|LoadCalc|Zonal|ForceHelper")
list(FILTER MY_SRC_BACK INCLUDE REGEX "boundaries/|DomainDecompBase|LoadCalc|Zonal|ForceHelper")
amartyads marked this conversation as resolved.
Show resolved Hide resolved
list(APPEND MY_SRC ${MY_SRC_BACK})
else()
if(NOT ENABLE_ALLLBL)
Expand Down Expand Up @@ -54,7 +54,9 @@ if (MAMICO_COUPLING)
TARGET_COMPILE_DEFINITIONS(MarDyn PUBLIC
${MAMICO_COMPILE_DEFINITIONS} ${MAMICO_MPI_DEFINITIONS}
)
TARGET_COMPILE_OPTIONS(MarDyn PUBLIC ${MAMICO_COMPILE_OPTIONS})
if(MAMICO_ENABLE_FPIC)
SET_PROPERTY(TARGET MarDyn PROPERTY POSITION_INDEPENDENT_CODE ON)
endif()
else()
ADD_EXECUTABLE(MarDyn
${MY_SRC}
Expand Down
18 changes: 9 additions & 9 deletions src/Domain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,9 @@ double Domain::getGlobalPressure()
return globalTemperature * _globalRho + _globalRho * getAverageGlobalVirial()/3.;
}

double Domain::getAverageGlobalVirial() { return _globalVirial/_globalNumMolecules; }
double Domain::getAverageGlobalVirial() const { return _globalVirial/_globalNumMolecules; }

double Domain::getAverageGlobalUpot() { return getGlobalUpot()/_globalNumMolecules; }
double Domain::getAverageGlobalUpot() const { return getGlobalUpot()/_globalNumMolecules; }
double Domain::getGlobalUpot() const { return _globalUpot; }

Comp2Param& Domain::getComp2Params(){
Expand Down Expand Up @@ -791,9 +791,9 @@ void Domain::updateMaxMoleculeID(ParticleContainer* particleContainer, DomainDec
#endif
}

double Domain::getglobalRho(){ return _globalRho;}
double Domain::getglobalRho() const { return _globalRho;}

void Domain::setglobalRho(double grho){ _globalRho = grho;}
void Domain::setglobalRho(double grho) { _globalRho = grho;}

unsigned long Domain::getglobalRotDOF()
{
Expand Down Expand Up @@ -832,10 +832,10 @@ double Domain::cv()

//! methods implemented by Stefan Becker <[email protected]>
// the following two methods are used by the MmspdWriter (writing the output file in a format used by MegaMol)
double Domain::getSigma(unsigned cid, unsigned nthSigma){
double Domain::getSigma(unsigned cid, unsigned nthSigma) const {
return _simulation.getEnsemble()->getComponent(cid)->getSigma(nthSigma);
}
unsigned Domain::getNumberOfComponents(){
unsigned Domain::getNumberOfComponents() const {
return _simulation.getEnsemble()->getComponents()->size();
}

Expand Down Expand Up @@ -863,10 +863,10 @@ void Domain::submitDU(unsigned /*cid*/, double DU, double* r)

void Domain::setLocalUpotCompSpecific(double UpotCspec){_localUpotCspecif = UpotCspec;}

double Domain::getLocalUpotCompSpecific(){return _localUpotCspecif;}
double Domain::getLocalUpotCompSpecific() const {return _localUpotCspecif;}


double Domain::getAverageGlobalUpotCSpec() {
double Domain::getAverageGlobalUpotCSpec() const {
Log::global_log->debug() << "number of fluid molecules = " << getNumFluidMolecules() << "\n";
return _globalUpotCspecif / getNumFluidMolecules();
}
Expand All @@ -876,7 +876,7 @@ void Domain::setNumFluidComponents(unsigned nc){_numFluidComponent = nc;}

unsigned Domain::getNumFluidComponents(){return _numFluidComponent;}

unsigned long Domain::getNumFluidMolecules(){
unsigned long Domain::getNumFluidMolecules() const {
unsigned long numFluidMolecules = 0;
for(unsigned i = 0; i < _numFluidComponent; i++){
Component& ci=*(global_simulation->getEnsemble()->getComponent(i));
Expand Down
26 changes: 14 additions & 12 deletions src/Domain.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ class Domain {
unsigned getNumFluidComponents();

//! @brief get the fluid and fluid-solid potential of the local process
double getLocalUpotCompSpecific();
double getLocalUpotCompSpecific() const;

//! @brief set the virial of the local process
void setLocalVirial(double Virial);
Expand Down Expand Up @@ -214,28 +214,30 @@ class Domain {
//!
//! Before this method is called, it has to be sure that the
//! global potential has been calculated (method calculateGlobalValues)
double getAverageGlobalUpot();
double getAverageGlobalUpot() const;
double getGlobalUpot() const;

//! by Stefan Becker: return the average global potential of the fluid-fluid and fluid-solid interaction (but NOT solid-solid interaction)
double getAverageGlobalUpotCSpec();
double getAverageGlobalUpotCSpec() const;

//! @brief get the global kinetic energy
//!
//! Before this method is called, it has to be sure that the
//! global energies has been calculated (method calculateGlobalValues)
double getGlobalUkinTrans() { return 0.5*_globalsummv2; }
double getGlobalUkinRot() { return 0.5*_globalsumIw2; }
//! Before this method is called, the user has to be sure that the
//! global energy (rot and trans) has been calculated via calculateGlobalValues()
//! Since variables _globalsummv2 and _globalsumIw2 store the sum of m_i*(v_i^2).
//! Therefore, the constant factor 0.5 has to be applied to yield the kinetic energies
double getGlobalUkinTrans() const { return 0.5*_globalsummv2; }
double getGlobalUkinRot() const { return 0.5*_globalsumIw2; }

//! by Stefan Becker: determine and return the totel number of fluid molecules
//! this method assumes all molecules with a component-ID less than _numFluidComponent to be fluid molecules
unsigned long getNumFluidMolecules();
unsigned long getNumFluidMolecules() const;

//! @brief get the global average virial per particle
//!
//! Before this method is called, it has to be sure that the
//! global virial has been calculated (method calculateGlobalValues)
double getAverageGlobalVirial();
double getAverageGlobalVirial() const;

//! @brief sets _localSummv2 to the given value
void setLocalSummv2(double summv2, int thermostat);
Expand All @@ -250,7 +252,7 @@ class Domain {
}

//! @brief get globalRho
double getglobalRho();
double getglobalRho() const;

//! @brief set globalRho
void setglobalRho(double grho);
Expand Down Expand Up @@ -386,9 +388,9 @@ class Domain {
// by Stefan Becker <[email protected]>
/* method returning the sigma parameter of a component
=> needed in the output of the MmspdWriter (specifying the particles' radii in a movie) */
double getSigma(unsigned cid, unsigned nthSigma);
double getSigma(unsigned cid, unsigned nthSigma) const;
// needed for the MmspdWriter (MegaMol)
unsigned getNumberOfComponents();
unsigned getNumberOfComponents() const;

void setUpotCorr(double upotcorr){ _UpotCorr = upotcorr; }
void setVirialCorr(double virialcorr){ _VirialCorr = virialcorr; }
Expand Down
Loading