Skip to content

Commit

Permalink
Make ASCIIReader read header work with new mixing rules format
Browse files Browse the repository at this point in the history
  • Loading branch information
HomesGH committed Jul 26, 2024
1 parent 15c3d9c commit 4f5b49f
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
21 changes: 20 additions & 1 deletion src/io/ASCIIReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
#include "ensemble/EnsembleBase.h"
#include "Simulation.h"
#include "molecules/Molecule.h"
#include "molecules/mixingrules/MixingRuleBase.h"
#include "molecules/mixingrules/LorentzBerthelot.h"

#ifdef ENABLE_MPI
#include "parallel/ParticleData.h"
Expand Down Expand Up @@ -207,7 +209,24 @@ void ASCIIReader::readPhaseSpaceHeader(Domain* domain, double timestep) {
}
#endif

// Mixing coefficients have to be set via the config xml
// Mixing coefficients
for(unsigned int cidi = 0; cidi < numcomponents-1; cidi++) {
for(unsigned int cidj = cidi + 1; cidj <= numcomponents-1; cidj++) {
double xi, eta;
_phaseSpaceHeaderFileStream >> xi >> eta;
#ifndef NDEBUG
Log::global_log->debug() << "Mixing: " << cidi+1 << " + " << cidj+1
<< " : xi=" << xi << " eta=" << eta << std::endl;
#endif
// Only LB mixing rule is supported for now
LorentzBerthelotMixingRule* mixingrule = new LorentzBerthelotMixingRule();
mixingrule->setCid1(cidi);
mixingrule->setCid2(cidj);
mixingrule->setEta(eta);
mixingrule->setXi(xi);
_simulation.getEnsemble()->setMixingrule(mixingrule);
}
}

// read in global factor \epsilon_{RF}
// FIXME: Maybe this should go better to a seperate token?!
Expand Down
1 change: 1 addition & 0 deletions test_input/VectorizationMultiComponentMultiPotentials.inp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ mardyn trunk 20120726
1.43042933 -0.983266012 0 0.001008 0.52
-1.43042933 -0.983266012 0 0.001008 0.52
0.00219467882 0.00412499417 0.00631967299
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1e+10
NumberOfMolecules 250
MoleculeFormat ICRVQD
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ mardyn trunk 20120726
1.43042933 -0.983266012 0 0.001008 0.52
-1.43042933 -0.983266012 0 0.001008 0.52
0.00219467882 0.00412499417 0.00631967299
1 1
1e+10
NumberOfMolecules 50
MoleculeFormat ICRVQD
Expand Down

0 comments on commit 4f5b49f

Please sign in to comment.