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

Method test_boundaries

test/python/test_CutoffFunction.py:128–148  ·  view source on GitHub ↗
(self, c1, cf_type)

Source from the content-addressed store, hash-verified

126class Test_fdf:
127 @pytest.mark.parametrize("cf_type", cutoff_function_types)
128 def test_boundaries(self, c1, cf_type):
129 c1.setCutoffType(cf_type)
130
131 f, df = c1.fdf(0.0)
132 if cf_type not in [CutoffFunction.CT_TANHU]:
133 assert f == pytest.approx(1.0), (
134 "Wrong cutoff function value.")
135 if cf_type not in [CutoffFunction.CT_TANHU, CutoffFunction.CT_TANH]:
136 assert df == pytest.approx(0.0), (
137 "Wrong cutoff derivative value.")
138
139 f, df = c1.fdf(cutoff_radius * cutoff_parameter)
140 if cf_type not in [CutoffFunction.CT_TANHU, CutoffFunction.CT_TANH]:
141 assert f == pytest.approx(1.0), (
142 "Wrong cutoff function value.")
143
144 f, df = c1.fdf(cutoff_radius)
145 assert f == pytest.approx(0.0), (
146 "Wrong cutoff function value.")
147 assert df == pytest.approx(0.0), (
148 "Wrong cutoff derivative value.")
149 @pytest.mark.parametrize("cf_type, cf_value, cf_dvalue",
150 zip(cutoff_function_types,
151 cutoff_function_values,

Callers

nothing calls this directly

Calls 2

setCutoffTypeMethod · 0.80
fdfMethod · 0.45

Tested by

no test coverage detected