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

Function checkAbsoluteValueGroup

test/cpp/test_SymmetryFunctionGroups.cpp:203–232  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

201}
202
203void checkAbsoluteValueGroup(Structure& s,
204 ElementMap& em,
205 size_t const type,
206 string const setupLine,
207 double const value)
208{
209 SymFnc* sf = setupSymmetryFunction(em, type, setupLine);
210
211 SymGrp* sfg = setupSymmetryFunctionGroup(em, *sf);
212
213 // Allocate symmetry function arrays.
214 s.atoms.at(0).numSymmetryFunctions = 1;
215 s.atoms.at(0).numSymmetryFunctionDerivatives = vector<size_t>(em.size(), 1);
216#ifndef NOSFCACHE
217 s.atoms.at(0).cacheSizePerElement = vector<size_t>(maxElements,
218 maxCacheSize);
219#endif
220 s.atoms.at(0).allocate(true);
221
222 // Calculate symmetry function for atom 0.
223 recalculateSymmetryFunctionGroup(s, s.atoms.at(0), *sfg);
224
225 BOOST_TEST_INFO(string("Symmetry function values, type ")
226 << type << "\n");
227 BOOST_REQUIRE_SMALL(s.atoms.at(0).G.at(0) - value, accuracy);
228
229 delete sf;
230
231 return;
232}
233
234BOOST_AUTO_TEST_SUITE(IntegrationTests)
235

Callers 1

Calls 5

sizeMethod · 0.80
setupSymmetryFunctionFunction · 0.70
allocateMethod · 0.45

Tested by

no test coverage detected