MCPcopy Create free account
hub / github.com/CompPhysVienna/n2p2 / checkAbsoluteValue

Function checkAbsoluteValue

test/cpp/test_SymmetryFunctions.cpp:162–190  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

160}
161
162void checkAbsoluteValue(Structure& s,
163 ElementMap& em,
164 size_t const type,
165 string const setupLine,
166 double const value)
167{
168 SymFnc* sf = setupSymmetryFunction(em, type, setupLine);
169
170 // Allocate symmetry function arrays.
171 s.atoms.at(0).numSymmetryFunctions = 1;
172 s.atoms.at(0).numSymmetryFunctionDerivatives = vector<size_t>(em.size(), 1);
173#ifndef NOSFCACHE
174 s.atoms.at(0).cacheSizePerElement = vector<size_t>(maxElements,
175 maxCacheSize);
176#endif
177 s.atoms.at(0).allocate(true);
178
179 // Calculate symmetry function for atom 0.
180 recalculateSymmetryFunction(s, s.atoms.at(0), *sf);
181
182 BOOST_TEST_INFO(string("Symmetry function values, type ")
183 << type << "\n");
184// cerr << strpr("%24.16E\n", s.atoms.at(0).G.at(0));
185 BOOST_REQUIRE_SMALL(s.atoms.at(0).G.at(0) - value, accuracy);
186
187 delete sf;
188
189 return;
190}
191
192BOOST_AUTO_TEST_SUITE(IntegrationTests)
193

Callers 1

Calls 4

sizeMethod · 0.80
setupSymmetryFunctionFunction · 0.70
allocateMethod · 0.45

Tested by

no test coverage detected