Toast++  1.0.2 (r.539)
Forward and inverse modelling in optical tomography
qmmesh.h
1 // ==========================================================================
2 // Module libfe
3 // File qmmesh.h
4 // Declaration of class QMMesh
5 // ==========================================================================
6 
7 #ifndef __QMMESH_H
8 #define __QMMESH_H
9 
10 // measurement profile type
11 
12 typedef enum {
13  PROFILE_POINT,
14  PROFILE_GAUSSIAN,
15  PROFILE_COSINE,
16  PROFILE_TOPHAT
17 } MProfileType;
18 
19 // ==========================================================================
20 // class QMMesh
21 
22 class FELIB QMMesh : public Mesh {
23 public:
24  int nQ, nM; // number of source/measurement points
25  int nQM; // total number of measurements (not always nQ*nM !)
26  Point *Q, *M, *QN, *MN; // lists of source/measurement points and normals
27 
28  int *nQMref; // nQMref[q]: number of detectors connected to q
29  int **QMref; // QMref[q][i] is the absolute detector index
30  // for the i-th detector connected to q
31  int *Qofs; // offset of source blocks in data array
32  int **QMofs; // QMofs[q][m] is the absolute offset into data
33  // array for measurement from source q and detector
34  // m (or -1 if combination is not used)
35 
36  int *Mel; // list of measurement elements
37  RDenseMatrix *Mcosingder; // list of cosin*gder matrices for measurement
38  // elements
39  RVector *source_profile;
40  RVector *meas_profile;
41  // Arrays of dimension nQ and nM of boundary source and measurement
42  // profile vectors, respectively.
43  // Each vector is of dimension nbnd() (i.e. number of boundary nodes)
44  // and contains the weights of measurement i at each boundary node
45  // Valid after InitM
46 
47  bool fixed_q_pos; // TRUE if Q contains final source positions
48  bool fixed_m_pos; // TRUE if M contains final measurement positions
49  bool external_m_pos; // TRUE if M points are not in mesh
50  bool external_q_pos; // TRUE if Q points are not in mesh, they are then projected along normal onto mesh
51 
52  QMMesh ();
53  ~QMMesh ();
54 
55  void SetupQM (const Point *q, int nq, const Point *m, int nm,
56  const ICompRowMatrix *linklist = NULL);
57  //void SetupRegularQM (int nqm);
58  void LoadQM (std::istream &is);
59 
60  void ScaleMesh (double scale);
61  // rescale the whole mesh
62 
63  void ScaleMesh (const RVector &scale);
64  // Anisotropic scaling
65 
66  bool Connected (int q, int m) const;
67  bool Connected (int qm) const;
68  // returns TRUE if measurement with source q and detector m exists
69 
70  int Meas (int q, int m) const;
71  // returns the index number of absolute measurement 'm' for source 'q'
72  // (i.e. inverse of QMref: QMref[q][Meas(q,m)] = m)
73  // returns -1 if q and m not connected
74 
75  void GetMesh (std::istream& i); // read mesh definition from stream
76  void PutMesh (std::ostream& o); // write mesh definition to stream
77  // IO functions
78 
79  MProfileType *mptype; // list of measurement profiles
80  double *mwidth; // measurement width parameters
81  double *msup; // measurement support parameters
82 
83  MProfileType *qptype; // list of source profiles
84  double *qwidth; // source width parameters
85  double *qsup; // source support parameters
86 
87 private:
88  void InitM (); // precalculation of measurement matrices
89 };
90 
91 #endif // !__QMMESH_H
Templated vector class.
Definition: vector.h:39
Finite-element mesh management.
Definition: mesh.h:145
Definition: point.h:18
Definition: qmmesh.h:22
Dense matrix class.
Definition: crmatrix.h:38