SHiP Field Service
Framework-agnostic C++20 library exposing SHiP magnetic field maps.
Loading...
Searching...
No Matches
FieldMap.h File Reference
#include "SHiP/FieldService/IFieldSource.h"
#include <array>
#include <cstddef>
#include <cstdint>
#include <memory>
#include <string>
#include <vector>
Include dependency graph for FieldMap.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  SHiP::FieldMapGrid
 Equidistant Cartesian grid in the map's local frame. More...
 
struct  SHiP::FieldMapSymmetry
 Reflection symmetry. More...
 
struct  SHiP::FieldMapProvenance
 Where a map came from. Informational only; never affects evaluation. More...
 
struct  SHiP::FieldMap
 One field map: grid, symmetry, and per-node field components in Tesla, stored in FieldMapGrid::index order. More...
 
struct  SHiP::FieldBox
 Axis-aligned box, lengths in mm. More...
 

Namespaces

namespace  SHiP
 

Functions

void SHiP::validate (FieldMap const &map)
 Throw std::invalid_argument unless map is well formed: non-empty name, at least two nodes and a positive extent per axis, value arrays of grid.size() finite entries, mirrored axes starting at 0, parities of +-1.
 
std::shared_ptr< IFieldEvaluator > SHiP::makeFieldEvaluator (FieldMap const &map)
 Build a thread-safe evaluator for map: trilinear interpolation, clamped to the boundary value outside the grid, with map.symmetry applied.
 
FieldBox SHiP::extent (FieldMap const &map)
 Region map covers in its local frame.
 
std::shared_ptr< IFieldEvaluator > SHiP::translated (std::shared_ptr< IFieldEvaluator > inner, std::array< double, 3 > const &offset)
 Evaluator for inner placed with its origin at offset (mm): the field at p is inner's field at p - offset.
 
std::shared_ptr< IFieldEvaluator > SHiP::zeroOutside (std::shared_ptr< IFieldEvaluator > inner, FieldBox const &box)
 Evaluator that returns inner's field inside box, given in inner's frame, and 0 outside it, where map evaluators would clamp.
 
std::string SHiP::resolveFieldMapPath (std::string const &path)
 Canonical path of a map file.