-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
git-svn-id: https://scm.projects.hlrs.de/svn/ls1/MarDyn/trunk@6285 a63bd714-7e14-4b5e-94e7-302c8c8ff188
- Loading branch information
Showing
5 changed files
with
117 additions
and
17 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
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,52 @@ | ||
// | ||
// Created by kruegener on 5/31/2018. | ||
// | ||
|
||
#include "COMalignerTest.h" | ||
#include "plugins/COMaligner.h" | ||
#include "parallel/DomainDecomposition.h" | ||
#include "particleContainer/ParticleContainer.h" | ||
#include "particleContainer/LinkedCells.h" | ||
|
||
TEST_SUITE_REGISTRATION(COMalignerTest); | ||
|
||
COMalignerTest::COMalignerTest() {} | ||
|
||
COMalignerTest::~COMalignerTest() {} | ||
|
||
void COMalignerTest::testCOMalign() { | ||
|
||
_domainDecomposition = new DomainDecomposition(); | ||
|
||
const char* filename = "1clj-regular-2x2x2-offset.inp"; | ||
double cutoff = 1.5; | ||
ParticleContainer* container = initializeFromFile(ParticleContainerFactory::LinkedCell, filename, cutoff); | ||
ParticleContainer* oldContainer = initializeFromFile(ParticleContainerFactory::LinkedCell, filename, cutoff); | ||
|
||
COMaligner* plugin = new COMaligner(); | ||
|
||
plugin->init(container, _domainDecomposition, _domain); | ||
plugin->beforeForces(container, _domainDecomposition, 1); | ||
|
||
// TEST MASS | ||
double m = plugin->_mass; | ||
ASSERT_EQUAL_MSG("Mass does not match number of particles", double(container->getNumberOfParticles()), m); | ||
|
||
// TEST MOTION | ||
ASSERT_EQUAL_MSG("x motion is wrong", -.5, plugin->_motion[0]); | ||
ASSERT_EQUAL_MSG("y motion is wrong", -.5, plugin->_motion[1]); | ||
ASSERT_EQUAL_MSG("z motion is wrong", -.5, plugin->_motion[2]); | ||
|
||
// TEST IF MOTION WAS APPLIED | ||
ParticleIterator newPos = container->iterator(); | ||
ParticleIterator oldPos = oldContainer->iterator(); | ||
while(newPos.hasNext()){ | ||
for(int d = 0; d < 3; d++){ | ||
ASSERT_EQUAL_MSG("Motion has not been properly applied" ,oldPos->r(d) - .5, newPos->r(d)); | ||
} | ||
newPos.next(); | ||
oldPos.next(); | ||
} | ||
|
||
delete _domainDecomposition; | ||
} |
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,28 @@ | ||
// | ||
// Created by kruegener on 5/31/2018. | ||
// | ||
|
||
|
||
#ifndef DCOMALIGNERTEST_H | ||
#define DCOMALIGNERTEST_H | ||
|
||
//#include "utils/Testing.h" | ||
#include "utils/TestWithSimulationSetup.h" | ||
|
||
class COMalignerTest : public utils::TestWithSimulationSetup { | ||
|
||
TEST_SUITE(COMalignerTest); | ||
TEST_METHOD(testCOMalign); | ||
TEST_SUITE_END; | ||
|
||
public: | ||
|
||
COMalignerTest(); | ||
|
||
virtual ~COMalignerTest(); | ||
|
||
void testCOMalign(); | ||
|
||
}; | ||
|
||
#endif //DCOMALIGNERTEST_H |
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,21 @@ | ||
mardyn trunk 20090721 | ||
currentTime 0.00 | ||
#rho 0.001893 | ||
# Vmax 0.006831 | ||
Temperature 0.700000 | ||
Length 3.0000 3.0000 3.0000 | ||
NumberOfComponents 1 | ||
1 0 0 0 0 | ||
0 0 0 1 1 1 1 0 | ||
0 0 0 | ||
1e+10 | ||
NumberOfMolecules 8 | ||
MoleculeFormat ICRV | ||
1 1 1.500000 1.500000 1.500000 0.0 0.0 0.0 | ||
2 1 2.500000 1.500000 1.500000 0.0 0.0 0.0 | ||
3 1 1.500000 2.500000 1.500000 0.0 0.0 0.0 | ||
4 1 2.500000 2.500000 1.500000 0.0 0.0 0.0 | ||
5 1 1.500000 1.500000 2.500000 0.0 0.0 0.0 | ||
6 1 2.500000 1.500000 2.500000 0.0 0.0 0.0 | ||
7 1 1.500000 2.500000 2.500000 0.0 0.0 0.0 | ||
8 1 2.500000 2.500000 2.500000 0.0 0.0 0.0 |