Toast++  1.0.2 (r.539)
Forward and inverse modelling in optical tomography
raster_bl.h
1 // -*-C++-*-
2 
3 #ifndef __RASTER_BL_H
4 #define __RASTER_BL_H
5 
11 #include "raster.h"
12 
13 // =========================================================================
17 class STOASTLIB Raster_Blob: public Raster {
18 public:
33  Raster_Blob (const IVector &_bdim, const IVector &_gdim, Mesh *mesh,
34  double _sup, RDenseMatrix *bb = 0);
35 
36  virtual ~Raster_Blob();
37 
43  virtual double Value (const Point &p, int i) const;
44 
45  virtual double Value_nomask (const Point &p, int i, bool is_solidx=true)
46  const = 0;
47 
53  virtual void NodeValues (int node, RVector &nv) const;
54  RVector NodeValues (int node) const
55  { RVector tmp(slen); NodeValues (node, tmp); return tmp; }
56 
57  void Map_MeshToBasis (const RVector &mvec, RVector &bvec) const;
58  void Map_MeshToBasis (const CVector &mvec, CVector &bvec) const;
59 
60  void Map_MeshToGrid (const RVector &mvec, RVector &gvec) const;
61  void Map_MeshToGrid (const CVector &mvec, CVector &gvec) const;
62 
63  void Map_MeshToSol (const RVector &mvec, RVector &svec) const;
64  void Map_MeshToSol (const CVector &mvec, CVector &svec) const;
65 
66  void Map_BasisToMesh (const RVector &bvec, RVector &mvec) const;
67  void Map_BasisToMesh (const CVector &bvec, CVector &mvec) const;
68 
69  void Map_GridToMesh (const RVector &gvec, RVector &mvec) const;
70  void Map_GridToMesh (const CVector &gvec, CVector &mvec) const;
71 
72  void Map_SolToMesh (const RVector &svec, RVector &mvec) const;
73  void Map_SolToMesh (const CVector &svec, CVector &mvec) const;
74 
75  void Map_GridToBasis (const RVector &gvec, RVector &bvec) const;
76  void Map_GridToBasis (const CVector &gvec, CVector &bvec) const;
77 
78  void Map_BasisToGrid (const RVector &bvec, RVector &gvec) const;
79  void Map_BasisToGrid (const CVector &bvec, CVector &gvec) const;
80 
81  void Map_SolToBasis (const RVector &svec, RVector &bvec) const;
82  void Map_SolToBasis (const CVector &svec, CVector &bvec) const;
83 
84  void Map_BasisToSol (const RVector &bvec, RVector &svec) const;
85  void Map_BasisToSol (const CVector &bvec, CVector &svec) const;
86 
87  void Map_SolToGrid (const RVector &svec, RVector &gvec) const;
88  void Map_SolToGrid (const CVector &svec, CVector &gvec) const;
89 
90  void Map_GridToSol (const RVector &gvec, RVector &svec) const;
91  void Map_GridToSol (const CVector &gvec, CVector &svec) const;
92 
93 protected:
94  double ComputeBasisScale ();
95 
96  void ComputeNodeValues ();
97 
98  RCompRowMatrix *nodevals;
99  // Sparse matrix of size nlen x slen
100  // containing nodal basis values for each basis function
101  // Initialised by ComputeNodeValues()
102 
103  double sup; // blob support radius in units of grid spacing
104  RVector igrid; // inverse grid spacing in x, y (, z)
105  int npad; // number of padding layers around bounding box
106  Point bbmin_pad, bbmax_pad; // bounding box including padding
107 };
108 
109 #endif // !__RASTER_BL_H
Generic blob basis representation.
Definition: raster_bl.h:17
virtual double Value(const Point &p, int i) const
Value of basis function b_i at point p Identical to Value_nomask, but returns zero if p is outside th...
virtual void Map_MeshToGrid(const RVector &mvec, RVector &gvec) const
Map a real-valued field from mesh to grid representation.
virtual void Map_GridToSol(const RVector &gvec, RVector &svec) const
Map a real-valued field from grid to solution representation.
virtual void Map_BasisToGrid(const RVector &bvec, RVector &gvec) const =0
Map a real-valued field from basis to grid representation.
virtual void Map_SolToBasis(const RVector &svec, RVector &bvec) const
Map a real-valued field from solution to basis representation.
Finite-element mesh management.
Definition: mesh.h:145
Base class for mapping between mesh and an independent basis representation.
Definition: raster.h:20
Definition: point.h:18
virtual void Map_BasisToSol(const RVector &bvec, RVector &svec) const
Map a real-valued field from basis to solution representation.
virtual void Map_SolToGrid(const RVector &svec, RVector &gvec) const
Map a real-valued field from solution to grid representation.
virtual void Map_MeshToBasis(const RVector &mvec, RVector &bvec) const
Map a real-valued field from mesh to basis representation.
virtual void Map_BasisToMesh(const RVector &bvec, RVector &mvec) const
Map a real-valued field from basis to mesh representation.
virtual void Map_GridToBasis(const RVector &gvec, RVector &bvec) const =0
Map a real-valued field from grid to basis representation.
virtual void Map_MeshToSol(const RVector &mvec, RVector &svec) const
Map a real-valued field from mesh to solution representation.
virtual void Map_SolToMesh(const RVector &svec, RVector &mvec) const
Map a real-valued field from solution to mesh representation.
virtual double Value_nomask(const Point &p, int i, bool is_solidx=true) const =0
Value of basis function b_i at point p This does not check for mesh support.
virtual void Map_GridToMesh(const RVector &gvec, RVector &mvec) const
Map a real-valued field from grid to mesh representation.