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

Single Unit Test #35

Closed
wants to merge 4 commits into from
Closed

Single Unit Test #35

wants to merge 4 commits into from

Conversation

frobnitzem
Copy link
Contributor

This test for neighboring atoms in a lattice seems to not work.
Using:

./unit_test/LatNbrs sc 1.5 1.5001

gives

Atoms: 1000 1000
Energy = -0.000347342
Lattice Energy = -1.92202 per atom

Increasing the cutoff gives larger magnitude energies, but never as large as -1.9.

Perhaps its in the way the init() function is being used here, but I've been over it several times and it appears to be working.

Copy link
Member

@streeve streeve left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I let this sit so long. There are a lot of nice improvements here, so it will be great to get them merged in.

I've added a unit test PR which tries to reuse as much of the infrastructure in the main Cabana library as possible. I think it will be easiest to remove this unit test for now, merge in master and get these improvements in, then focus on the energy unit test separately.

In the mean time I did make sure to test locally and the different lattices seem to be built correctly. Let me know what you think

Also, looks like the CI is failing on clang-format.

src/input.cpp Show resolved Hide resolved
src/input.h Outdated Show resolved Hide resolved
src/cabanamd.cpp Show resolved Hide resolved
unit_test/CMakeLists.txt Outdated Show resolved Hide resolved
src/cabanamd.cpp Outdated Show resolved Hide resolved
@frobnitzem
Copy link
Contributor Author

I was thinking about the energy computation mismatch and realized it might be giving answers I didn't expect if the Lennard-Jones energy is shifted at the cutoff. I'll try and resolve this over the weekend.

@frobnitzem
Copy link
Contributor Author

It looks like the new src/cabanamd.h gets inheritance backward, since class CbnMD : public CabanaMD, where the CabanaMD contains top-level callable methods and commandline garbage.

class CabanaMD
{
  public:
    int nsteps;

    virtual void init( InputCL cl ) = 0;
    virtual void run() = 0;

    virtual void dump_binary( int ) = 0;
    virtual void check_correctness( int ) = 0;
};

Usually, top-level stuff calls into a library that does not deal with I/O unless absolutely necessary. I'd rather not transfer the ctor/dtor over to CbnMD.

@frobnitzem frobnitzem closed this Apr 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants