-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
63 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#include "LorentzBerthelot.h" | ||
|
||
#include <ostream> | ||
|
||
#include "MixingRuleBase.h" | ||
#include "utils/Logger.h" | ||
#include "utils/xmlfileUnits.h" | ||
|
||
void LorentzBerthelotMixingRule::readXML(const XMLfileUnits& xmlconfig) { | ||
MixingRuleBase::readXML(xmlconfig); | ||
double eta, xi; | ||
xmlconfig.getNodeValue("eta", eta); | ||
xmlconfig.getNodeValue("xi", xi); | ||
_parameters = {eta, xi}; | ||
Log::global_log->info() << "Mixing coefficients for components " | ||
<< this->getCid1()+1 << " + " << this->getCid2()+1 // +1 due to internal cid | ||
<< ": (eta, xi) = (" << _parameters.at(0) | ||
<< ", " << _parameters.at(1) << ")" << std::endl; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#include "MixingRuleBase.h" | ||
|
||
#include <ostream> | ||
|
||
#include "utils/Logger.h" | ||
#include "utils/mardyn_assert.h" | ||
#include "utils/xmlfileUnits.h" | ||
|
||
void MixingRuleBase::readXML(const XMLfileUnits& xmlconfig) { | ||
int cid1; | ||
int cid2; | ||
xmlconfig.getNodeValue("@cid1", cid1); | ||
xmlconfig.getNodeValue("@cid2", cid2); | ||
|
||
if (cid1 == cid2) { | ||
Log::global_log->error() << "Mixing rules: cid1 and cid2 must not be the same but are both " << cid1 << std::endl; | ||
mardyn_exit(1); | ||
} else if ((cid1 <= 0) or (cid2 <= 0)) { | ||
Log::global_log->error() << "Mixing rules: cid1 and cid2 must be greater than zero" << std::endl; | ||
mardyn_exit(1); | ||
} else if (cid1 > cid2) { | ||
// Symmetry for mixing rules is assumed | ||
// cid1 must be less than cid2 | ||
_cid1 = cid2 - 1; // component id - 1 to convert to internal format starting with 0 | ||
_cid2 = cid1 - 1; | ||
} else { | ||
_cid1 = cid1 - 1; | ||
_cid2 = cid2 - 1; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters