Loading...
Searching...
No Matches
pot::PotentialWrapper Class Reference

Type-erased wrapper around any potential that provides a force() interface. More...

#include <gpr/potentials/PotentialWrapper.h>

Public Types

using ForceFn
using ForceWithUncertaintyFn
using ForceBatchFn
using ForceBatchWithForceNoiseFn
 A batch with force noise and zero energy noise.
using ForceBatchWithUncertaintyFn
 Both optional noise arrays use the single-call RMS conventions.

Public Member Functions

 PotentialWrapper (ForceFn fn)
void force (long N, const double *R, const int *atomicNrs, double *F, double *U, double *energy_noise_rms, const double *box)
 Invoke the wrapped potential.
void forceWithUncertainty (long N, const double *R, const int *atomicNrs, double *F, double *U, double *energy_noise_rms, double *force_noise_rms, const double *box)
bool hasForceBatch () const noexcept
bool hasForceBatchWithUncertainty () const noexcept
void setForceBatch (ForceBatchFn fn)
void setForceBatch (std::nullptr_t)
void setForceBatch (ForceBatchWithForceNoiseFn fn)
void setForceBatchWithUncertainty (ForceBatchWithUncertaintyFn fn)
void forceBatch (long N, std::size_t B, const double *R, const int *atomicNrs, double *F, double *U, const double *box)
 Batched means; requires hasForceBatch().
void forceBatch (long N, std::size_t B, const double *R, const int *atomicNrs, double *F, double *U, double *V, const double *box)
 Batched evaluation with optional force noise.
void forceBatchWithUncertainty (long N, std::size_t B, const double *R, const int *atomicNrs, double *F, double *U, double *energy_noise, double *force_noise, const double *box)

Static Public Member Functions

static PotentialWrapper from_force_with_uncertainty (ForceWithUncertaintyFn fn)
static PotentialWrapper composeGeometryAndEnergyUncertainty (PotentialWrapper geometry, PotentialWrapper uncertainty)
 Compose geometry output with an independent energy-uncertainty source.
static PotentialWrapper routeEnergyUncertaintyToForceChannel (PotentialWrapper source)
 Route a legacy scalar uncertainty into the force-noise channel.
template<typename RgPot>
static PotentialWrapper from_rgpot (RgPot &pot)
 Factory: adapt an rgpot PotentialBase subclass.
template<typename RgPot>
static PotentialWrapper from_rgpot (std::shared_ptr< RgPot > pot)
 Factory: adapt and own an rgpot PotentialBase subclass.
static PotentialWrapper from_rgpot (std::shared_ptr< rgpot::PotentialBase > pot)
 C++-only helper: wrap a virtual rgpot::PotentialBase.

Detailed Description

Type-erased wrapper around any potential that provides a force() interface.

Accepts a std::function with the legacy EON force() signature, allowing any potential (EAM, Morse, rgpot, RPC, lambda) to be used without templates.

Definition at line 94 of file PotentialWrapper.h.

Member Typedef Documentation

◆ ForceBatchFn

Initial value:
std::function<void(
long N, std::size_t B, const double* R, const int* atomicNrs, double* F,
double* U, const double* box)>

Batched means: B same-composition systems, B * 3N coordinates and forces, B energies, and one shared box.

Definition at line 110 of file PotentialWrapper.h.

◆ ForceBatchWithForceNoiseFn

Initial value:
std::function<void(
long N, std::size_t B, const double* R, const int* atomicNrs, double* F,
double* U, double* V, const double* box)>

A batch with force noise and zero energy noise.

Definition at line 114 of file PotentialWrapper.h.

◆ ForceBatchWithUncertaintyFn

Initial value:
std::function<void(
long N, std::size_t B, const double* R, const int* atomicNrs, double* F,
double* U, double* energy_noise_rms, double* force_noise_rms,
const double* box)>

Both optional noise arrays use the single-call RMS conventions.

Definition at line 118 of file PotentialWrapper.h.

◆ ForceFn

Initial value:
std::function<void(
long N, const double* R, const int* atomicNrs, double* F, double* U,
double* energy_noise_rms, const double* box)>

The legacy force signature. The slot before the cell is the energy-noise RMS, a standard deviation in eV and not a variance; it is forwarded as the energy_noise_rms of ForceWithUncertaintyFn and there is no force-noise slot.

Definition at line 102 of file PotentialWrapper.h.

◆ ForceWithUncertaintyFn

Initial value:
std::function<void(
long N, const double* R, const int* atomicNrs, double* F, double* U,
double* energy_noise_rms, double* force_noise_rms, const double* box)>

Definition at line 105 of file PotentialWrapper.h.

Constructor & Destructor Documentation

◆ PotentialWrapper()

pot::PotentialWrapper::PotentialWrapper ( ForceFn fn)
inlineexplicit

Definition at line 123 of file PotentialWrapper.h.

124 {
125 if (!fn) {
126 throw std::invalid_argument(
127 "PotentialWrapper: force function must not be null");
128 }
129 m_force_with_uncertainty =
130 [fn = std::move(fn)](long N, const double* R, const int* atomicNrs,
131 double* F, double* U, double* energy_noise_rms,
132 double* force_noise_rms,
133 const double* box) mutable {
134 fn(N, R, atomicNrs, F, U, energy_noise_rms, box);
135 // This adapter has no force-noise channel. Publish the
136 // zero only after fn returns, so a throw leaves the
137 // caller buffer untouched.
138 if (force_noise_rms) *force_noise_rms = 0.0;
139 };
140 }

Member Function Documentation

◆ composeGeometryAndEnergyUncertainty()

PotentialWrapper pot::PotentialWrapper::composeGeometryAndEnergyUncertainty ( PotentialWrapper geometry,
PotentialWrapper uncertainty )
inlinestatic

Compose geometry output with an independent energy-uncertainty source.

Energy, forces, and force noise come from geometry. Energy noise is published from the second potential only after that call returns. The second potential is evaluated only when energy noise is requested; its energy and forces are discarded.

Definition at line 303 of file PotentialWrapper.h.

305 {
307 [geometry = std::move(geometry),
308 uncertainty = std::move(uncertainty)](
309 long N, const double* R, const int* atomicNrs, double* F,
310 double* U, double* energy_noise_rms, double* force_noise_rms,
311 const double* box) mutable {
312 // Geometry may report its own energy noise. Keep that off
313 // the caller pointer until the uncertainty source accepts
314 // its variance; a throw there must leave this channel.
315 double geometry_energy_noise = 0.0;
316 geometry.forceWithUncertainty(N, R, atomicNrs, F, U,
317 energy_noise_rms != nullptr
318 ? &geometry_energy_noise
319 : nullptr,
320 force_noise_rms, box);
321 if (!energy_noise_rms) return;
322
323 const std::size_t n_components =
324 N > 0 ? static_cast<std::size_t>(N) * 3 : 0;
325 std::vector<double> discarded_forces(n_components);
326 double discarded_energy = 0.0;
327 double source_energy_noise_rms = 0.0;
328 double discarded_force_noise_rms = 0.0;
329 uncertainty.forceWithUncertainty(
330 N, R, atomicNrs, discarded_forces.data(), &discarded_energy,
331 &source_energy_noise_rms, &discarded_force_noise_rms, box);
332 *energy_noise_rms = source_energy_noise_rms;
333 });
334 }
static PotentialWrapper from_force_with_uncertainty(ForceWithUncertaintyFn fn)

◆ force()

void pot::PotentialWrapper::force ( long N,
const double * R,
const int * atomicNrs,
double * F,
double * U,
double * energy_noise_rms,
const double * box )
inline

Invoke the wrapped potential.

Definition at line 145 of file PotentialWrapper.h.

147 {
148 forceWithUncertainty(N, R, atomicNrs, F, U, energy_noise_rms, nullptr,
149 box);
150 }
void forceWithUncertainty(long N, const double *R, const int *atomicNrs, double *F, double *U, double *energy_noise_rms, double *force_noise_rms, const double *box)

◆ forceBatch() [1/2]

void pot::PotentialWrapper::forceBatch ( long N,
std::size_t B,
const double * R,
const int * atomicNrs,
double * F,
double * U,
const double * box )
inline

Batched means; requires hasForceBatch().

Definition at line 217 of file PotentialWrapper.h.

220 {
221 const OracleEvaluationScope scope(static_cast<long>(B));
222 if (m_force_batch_with_uncertainty) {
223 m_force_batch_with_uncertainty(N, B, R, atomicNrs, F, U, nullptr,
224 nullptr, box);
225 } else if (m_force_batch) {
226 m_force_batch(N, B, R, atomicNrs, F, U, box);
227 } else {
228 throw std::logic_error(
229 "PotentialWrapper: no batch surface on this potential");
230 }
231 }

◆ forceBatch() [2/2]

void pot::PotentialWrapper::forceBatch ( long N,
std::size_t B,
const double * R,
const int * atomicNrs,
double * F,
double * U,
double * V,
const double * box )
inline

Batched evaluation with optional force noise.

Definition at line 234 of file PotentialWrapper.h.

237 {
238 if (!V) {
239 forceBatch(N, B, R, atomicNrs, F, U, box);
240 return;
241 }
242 forceBatchWithUncertainty(N, B, R, atomicNrs, F, U, nullptr, V, box);
243 }
void forceBatchWithUncertainty(long N, std::size_t B, const double *R, const int *atomicNrs, double *F, double *U, double *energy_noise, double *force_noise, const double *box)
void forceBatch(long N, std::size_t B, const double *R, const int *atomicNrs, double *F, double *U, const double *box)
Batched means; requires hasForceBatch().

◆ forceBatchWithUncertainty()

void pot::PotentialWrapper::forceBatchWithUncertainty ( long N,
std::size_t B,
const double * R,
const int * atomicNrs,
double * F,
double * U,
double * energy_noise,
double * force_noise,
const double * box )
inline

Preserve both noise channels, using single calls if the batch surface provides only means.

Definition at line 247 of file PotentialWrapper.h.

251 {
252 const OracleEvaluationScope scope(static_cast<long>(B));
253 if (m_force_batch_with_uncertainty) {
254 m_force_batch_with_uncertainty(N, B, R, atomicNrs, F, U,
255 energy_noise, force_noise, box);
256 return;
257 }
258 // No uncertainty batch: each image is its own call. Hold every
259 // image until the last call returns, so a failed check on a
260 // later image leaves the caller buffers untouched. A negative
261 // count casts 3*N to a huge size_t; reject it before any image
262 // is evaluated, as the native batch does.
263 if (N <= 0) {
264 throw std::invalid_argument(
265 "PotentialWrapper: n_atoms must be positive");
266 }
267 const auto stride = static_cast<std::size_t>(N) * 3;
268 const bool write_forces = F != nullptr && stride > 0;
269 const bool write_energy = U != nullptr;
270 const bool write_energy_noise = energy_noise != nullptr;
271 const bool write_force_noise = force_noise != nullptr;
272 std::vector<double> scratch_forces(write_forces ? B * stride : 0);
273 std::vector<double> scratch_energy(write_energy ? B : 0);
274 std::vector<double> scratch_energy_noise(write_energy_noise ? B : 0);
275 std::vector<double> scratch_force_noise(write_force_noise ? B : 0);
276 for (std::size_t b = 0; b < B; ++b) {
278 N, R + b * stride, atomicNrs,
279 write_forces ? scratch_forces.data() + b * stride : nullptr,
280 write_energy ? scratch_energy.data() + b : nullptr,
281 write_energy_noise ? scratch_energy_noise.data() + b : nullptr,
282 write_force_noise ? scratch_force_noise.data() + b : nullptr,
283 box);
284 }
285 if (write_forces && B > 0)
286 std::copy_n(scratch_forces.data(), scratch_forces.size(), F);
287 if (write_energy && B > 0) std::copy_n(scratch_energy.data(), B, U);
288 if (write_energy_noise && B > 0)
289 std::copy_n(scratch_energy_noise.data(), B, energy_noise);
290 if (write_force_noise && B > 0)
291 std::copy_n(scratch_force_noise.data(), B, force_noise);
292 }

◆ forceWithUncertainty()

void pot::PotentialWrapper::forceWithUncertainty ( long N,
const double * R,
const int * atomicNrs,
double * F,
double * U,
double * energy_noise_rms,
double * force_noise_rms,
const double * box )
inline

Definition at line 152 of file PotentialWrapper.h.

155 {
156 const OracleEvaluationScope scope(1);
157 m_force_with_uncertainty(N, R, atomicNrs, F, U, energy_noise_rms,
158 force_noise_rms, box);
159 }

◆ from_force_with_uncertainty()

PotentialWrapper pot::PotentialWrapper::from_force_with_uncertainty ( ForceWithUncertaintyFn fn)
inlinestatic

Definition at line 161 of file PotentialWrapper.h.

163 {
164 return PotentialWrapper(std::move(fn), RichForceTag{});
165 }

◆ from_rgpot() [1/3]

template<typename RgPot>
PotentialWrapper pot::PotentialWrapper::from_rgpot ( RgPot & pot)
inlinestatic

Factory: adapt an rgpot PotentialBase subclass.

Bridges rgpot's operator()(AtomMatrix, vector<int>, box) -> (energy, AtomMatrix) to the legacy force() signature.

Definition at line 367 of file PotentialWrapper.h.

368 {
369 return from_rgpot_caller(
370 [&pot](const rgpot::types::AtomMatrix& positions,
371 const std::vector<int>& atmtypes,
372 const std::array<std::array<double, 3>, 3>& cell) {
373 return pot(positions, atmtypes, cell);
374 });
375 }

◆ from_rgpot() [2/3]

template<typename RgPot>
PotentialWrapper pot::PotentialWrapper::from_rgpot ( std::shared_ptr< RgPot > pot)
inlinestatic

Factory: adapt and own an rgpot PotentialBase subclass.

Use this when the wrapper outlives the local scope that creates the rgpot instance.

Definition at line 384 of file PotentialWrapper.h.

385 {
386 if (!pot) {
387 throw std::invalid_argument(
388 "PotentialWrapper: rgpot shared pointer must not be null");
389 }
390 auto wrapper = from_rgpot_caller(
391 [pot](const rgpot::types::AtomMatrix& positions,
392 const std::vector<int>& atmtypes,
393 const std::array<std::array<double, 3>, 3>& cell) {
394 return (*pot)(positions, atmtypes, cell);
395 });
396 // Batch surface. An rgpot CRTP potential carries forceBatch (a
397 // per-system fallback in the base, a one-call kernel where the
398 // backend implements forceBatchImpl, e.g. the UMA band graph).
399 // Not everything reaching this template is one: the Python
400 // trampoline is a plain callable with the operator() signature
401 // and nothing else, so the member is checked rather than assumed.
402 if constexpr (requires(RgPot& p, rgpot::ForceBatch& b) {
403 p.forceBatch(b);
404 }) {
405 using Result = std::invoke_result_t<
406 RgPot&, const rgpot::types::AtomMatrix&,
407 const std::vector<int>&,
408 const std::array<std::array<double, 3>, 3>&>;
409 constexpr auto arity = std::tuple_size<std::decay_t<Result>>::value;
410 ForceBatchWithUncertaintyFn native_batch =
411 [pot = std::move(pot)](long N, std::size_t B, const double* R,
412 const int* atomicNrs, double* F,
413 double* U, double* energy_noise,
414 double* force_noise, const double* box) {
415 // A non-positive count would hand the caller force
416 // pointer to the backend, and a negative count casts
417 // to a huge size_t. Reject it before any call.
418 if (N <= 0) {
419 throw std::invalid_argument(
420 "PotentialWrapper: n_atoms must be positive");
421 }
422 // ForceInput carries const members: build in place.
423 // rgpot writes forces through ForceOut::F. Keep forces,
424 // energies, and both noise channels in scratch until
425 // every system's variance validates.
426 const std::size_t stride = static_cast<std::size_t>(N) * 3;
427 std::vector<double> scratch_forces(B * stride);
428 std::vector<rgpot::ForceInput> in;
429 std::vector<rgpot::ForceOut> out;
430 in.reserve(B);
431 out.reserve(B);
432 for (std::size_t b = 0; b < B; ++b) {
433 in.push_back(
434 rgpot::ForceInput{static_cast<std::size_t>(N),
435 R + b * 3 * N, atomicNrs, box});
436 out.emplace_back();
437 out.back().F = scratch_forces.data() + b * stride;
438 }
439 rgpot::ForceBatch batch{B, in.data(), out.data()};
440 pot->forceBatch(batch);
441 std::vector<double> energy_rms;
442 if (energy_noise != nullptr) {
443 energy_rms.resize(B);
444 for (std::size_t b = 0; b < B; ++b) {
445 if constexpr (arity >= 3)
446 energy_rms[b] =
447 energyVarianceToRms(out[b].variance);
448 else
449 energy_rms[b] = 0.0;
450 }
451 }
452 if (F != nullptr) {
453 std::copy_n(scratch_forces.data(),
454 scratch_forces.size(), F);
455 }
456 // A null energy pointer is left untouched, as the
457 // means-only fallback does.
458 if (U != nullptr) {
459 for (std::size_t b = 0; b < B; ++b)
460 U[b] = out[b].energy;
461 }
462 if (energy_noise != nullptr)
463 std::copy_n(energy_rms.data(), B, energy_noise);
464 if (force_noise != nullptr)
465 std::fill_n(force_noise, B, 0.0);
466 };
467 if constexpr (arity <= 3) {
468 // rgpot's third tuple value is ForceOut::variance, which
469 // the single-call adapter carries as energy noise.
470 wrapper.setForceBatchWithUncertainty(std::move(native_batch));
471 } else {
472 // One variance slot cannot represent two noise channels.
473 wrapper.setForceBatch([native_batch = std::move(native_batch)](
474 long N, std::size_t B,
475 const double* R, const int* atomicNrs,
476 double* F, double* U,
477 const double* box) {
478 native_batch(N, B, R, atomicNrs, F, U, nullptr, nullptr,
479 box);
480 });
481 }
482 } else {
483 // Walk the systems so the surface still answers. Leaving it
484 // unset would be legal -- hasForceBatch() models absence --
485 // but it would silently drop band batching for every
486 // Python-defined potential, and the caller wants the answer
487 // rather than a promise about how many calls produced it.
488 wrapper.m_force_batch = [pot = std::move(pot)](
489 long N, std::size_t B, const double* R,
490 const int* atomicNrs, double* F,
491 double* U, const double* box) {
492 // A negative count casts to a huge size_t and builds a
493 // bogus type range. Reject it before any call, as the
494 // native batch does.
495 if (N <= 0) {
496 throw std::invalid_argument(
497 "PotentialWrapper: n_atoms must be positive");
498 }
499 const auto n = static_cast<std::size_t>(N);
500 std::array<std::array<double, 3>, 3> cell{};
501 if (box != nullptr) {
502 for (std::size_t r = 0; r < 3; ++r)
503 for (std::size_t c = 0; c < 3; ++c)
504 cell[r][c] = box[r * 3 + c];
505 }
506 const std::vector<int> types(atomicNrs, atomicNrs + n);
507 // Compute every image before writing. A throw on a later
508 // image must leave the caller buffers untouched.
509 const std::size_t stride = 3 * n;
510 std::vector<double> scratch_energies(B);
511 std::vector<double> scratch_forces(B * stride);
512 for (std::size_t b = 0; b < B; ++b) {
513 rgpot::types::AtomMatrix pos(n, 3);
514 for (std::size_t a = 0; a < n; ++a)
515 for (std::size_t d = 0; d < 3; ++d)
516 pos(a, d) = R[b * 3 * n + a * 3 + d];
517 // std::get rather than a structured binding: the
518 // trampoline returns a wider tuple than
519 // PotentialBase does, and only the first two
520 // elements are wanted either way.
521 const auto result = (*pot)(pos, types, cell);
522 scratch_energies[b] = std::get<0>(result);
523 const auto& forces = std::get<1>(result);
524 if (stride == 0) continue;
525 for (std::size_t a = 0; a < n; ++a)
526 for (std::size_t d = 0; d < 3; ++d)
527 scratch_forces[b * stride + a * 3 + d] =
528 forces(a, d);
529 }
530 if (B > 0) {
531 // A null energy or force pointer is left untouched,
532 // as the native batch does.
533 if (U != nullptr)
534 std::copy_n(scratch_energies.data(), B, U);
535 if (F != nullptr && stride > 0)
536 std::copy_n(scratch_forces.data(),
537 scratch_forces.size(), F);
538 }
539 };
540 }
541 return wrapper;
542 }
std::function< void( long N, std::size_t B, const double *R, const int *atomicNrs, double *F, double *U, double *energy_noise_rms, double *force_noise_rms, const double *box)> ForceBatchWithUncertaintyFn
Both optional noise arrays use the single-call RMS conventions.
eon_relax_band_t eon_relax_surface_fn void eon_relax_outcome_t * out
double energyVarianceToRms(const double variance)

◆ from_rgpot() [3/3]

PotentialWrapper pot::PotentialWrapper::from_rgpot ( std::shared_ptr< rgpot::PotentialBase > pot)
static

C++-only helper: wrap a virtual rgpot::PotentialBase.

rgpot does not publish nanobind/pybind types, so Python cannot name this overload. C++ callers that already hold a PotentialBase use this (the caller does not need Potential.hpp in the same TU). Python from_rgpot accepts a bound PotentialBase via the nanobind trampoline, or a callable with the same operator() contract.

Definition at line 129 of file PotentialWrapper.cpp.

131{
132 if (!pot)
133 throw std::invalid_argument(
134 "PotentialWrapper: rgpot shared pointer must not be null");
135 return from_rgpot(std::make_shared<OwnedRgpot>(std::move(pot)));
136}
static PotentialWrapper from_rgpot(RgPot &pot)
Factory: adapt an rgpot PotentialBase subclass.

◆ hasForceBatch()

bool pot::PotentialWrapper::hasForceBatch ( ) const
inlinenodiscardnoexcept

True when the wrapped source can evaluate a same-composition batch in one call (rgpot forceBatch surface).

Definition at line 169 of file PotentialWrapper.h.

170 {
171 return static_cast<bool>(m_force_batch) ||
173 }
bool hasForceBatchWithUncertainty() const noexcept

◆ hasForceBatchWithUncertainty()

bool pot::PotentialWrapper::hasForceBatchWithUncertainty ( ) const
inlinenodiscardnoexcept

Definition at line 175 of file PotentialWrapper.h.

176 {
177 return static_cast<bool>(m_force_batch_with_uncertainty);
178 }

◆ routeEnergyUncertaintyToForceChannel()

PotentialWrapper pot::PotentialWrapper::routeEnergyUncertaintyToForceChannel ( PotentialWrapper source)
inlinestatic

Route a legacy scalar uncertainty into the force-noise channel.

This adapts sources whose three-value interface reports a force-scale diagnostic through the legacy energy-uncertainty slot.

Definition at line 342 of file PotentialWrapper.h.

344 {
346 [source = std::move(source)](
347 long N, const double* R, const int* atomicNrs, double* F,
348 double* U, double* energy_noise_rms, double* force_noise_rms,
349 const double* box) mutable {
350 double routed_force_noise_rms = 0.0;
351 double discarded_force_noise_rms = 0.0;
352 source.forceWithUncertainty(N, R, atomicNrs, F, U,
353 &routed_force_noise_rms,
354 &discarded_force_noise_rms, box);
355 if (energy_noise_rms) *energy_noise_rms = 0.0;
356 if (force_noise_rms) *force_noise_rms = routed_force_noise_rms;
357 });
358 }

◆ setForceBatch() [1/3]

void pot::PotentialWrapper::setForceBatch ( ForceBatchFn fn)
inline

Definition at line 180 of file PotentialWrapper.h.

181 {
182 m_force_batch = std::move(fn);
183 m_force_batch_with_uncertainty = {};
184 }

◆ setForceBatch() [2/3]

void pot::PotentialWrapper::setForceBatch ( ForceBatchWithForceNoiseFn fn)
inline

Definition at line 191 of file PotentialWrapper.h.

192 {
193 if (!fn) {
195 return;
196 }
198 [fn = std::move(fn)](long N, std::size_t B, const double* R,
199 const int* atomicNrs, double* F, double* U,
200 double* energy_noise, double* force_noise,
201 const double* box) {
202 fn(N, B, R, atomicNrs, F, U, force_noise, box);
203 // This adapter has no energy-noise channel. Zero it only
204 // after the batch returns so a throw leaves the caller
205 // buffer untouched.
206 if (energy_noise) std::fill_n(energy_noise, B, 0.0);
207 });
208 }
void setForceBatchWithUncertainty(ForceBatchWithUncertaintyFn fn)

◆ setForceBatch() [3/3]

void pot::PotentialWrapper::setForceBatch ( std::nullptr_t )
inline

Definition at line 186 of file PotentialWrapper.h.

187 {
189 }
std::function< void( long N, std::size_t B, const double *R, const int *atomicNrs, double *F, double *U, const double *box)> ForceBatchFn
void setForceBatch(ForceBatchFn fn)

◆ setForceBatchWithUncertainty()

void pot::PotentialWrapper::setForceBatchWithUncertainty ( ForceBatchWithUncertaintyFn fn)
inline

Definition at line 210 of file PotentialWrapper.h.

211 {
212 m_force_batch_with_uncertainty = std::move(fn);
213 m_force_batch = {};
214 }

The documentation for this class was generated from the following files: