10 #include "toasttype.h"
142 void SetPhaseUnwrap (
bool unwrap)
187 void SetLinSolver (
const char *solver,
double tol = 1e-10);
242 bool elbasis =
false);
244 void AssembleSystemMatrixComponent (
const RVector &prm,
int type);
274 void Reset (
const Solution &sol,
double omega = 0,
bool elbasis =
false);
463 void DistributeSources_MPI (
int nq)
const;
501 mutable int *Q0, *Q1;
503 #endif // MPI_FWDSOLVER
512 STOASTLIB
void Project_cplx (
const QMMesh &mesh,
int q,
const CVector &phi,
519 #define SETUP_MPI() Setup_MPI()
520 #define CLEANUP_MPI() Cleanup_MPI()
523 #define CLEANUP_MPI()
537 #ifndef __FWDSOLVER_CC
542 #endif // !__FWDSOLVER_CC
544 #endif // !__FWDSOLVER_H
void AssembleMassMatrix(const Mesh *mesh=0)
Construct the FEM mass matrix for time-dependent problems.
void ReadParams(ParamParser &pp)
Read solver parameters from a parameter file.
void WriteParams(ParamParser &pp)
Write the current solver settings to a parameter file.
LSOLVER solvertp
linear solver type
Definition: fwdsolver.h:394
TVector< T > ProjectAll(const TCompRowMatrix< T > &mvec, const TVector< T > *dphi, DataScale scl=DATA_DEFAULT)
Return boundary data for all sources and all detectors, given photon density fields for all sources...
LSOLVER
Definition: fwdsolver.h:18
PreconType
Definition: precon.h:23
void Reset(const Solution &sol, double omega=0, bool elbasis=false)
Reset the forward solver by re-building the system matrices from a new set of parameters.
double iterative_tol
iterative solver tolerance
Definition: fwdsolver.h:407
void SetLinSolver(const char *solver, double tol=1e-10)
Set the solver type and tolerance.
TVector< T > * pphi
work buffer for field calculation
Definition: fwdsolver.h:434
direct solver (LU)
Definition: fwdsolver.h:20
DataScale GetDataScaling() const
Returns the current default setting for data scaling.
TVector< T > ProjectSingle(int q, const TCompRowMatrix< T > &mvec, const TVector< T > &phi, DataScale scl=DATA_DEFAULT) const
Return boundary data for a single source, given the corresponding photon density field.
void SetPrecon(PreconType type)
Set the preconditioning method.
void SetLinSolverMaxit(int maxit)
Set max iteration count for iterative solver.
Definition: fwdsolver.h:208
Finite-element mesh management.
Definition: mesh.h:145
DataScale
Definition: fwdsolver.h:27
void * SuperLU
SuperLU solver engine.
Definition: fwdsolver.h:406
TFwdSolver(const QMMesh *mesh, LSOLVER linsolver, double tol=1e-10)
Constructor. Creates a forward solver instance.
Templated forward solver class.
Definition: fwdsolver.h:37
const QMMesh * meshptr
pointer to the associated FEM mesh
Definition: fwdsolver.h:393
TCompRowMatrix< T > * FL
lower triangle of system matrix decomposition
Definition: fwdsolver.h:401
void Allocate()
Evaluates fill structure of system matrices and allocates dynamic memory for them.
const QMMesh * MeshPtr() const
Returns a pointer to the FEM mesh associated with the forward solver instance.
Definition: fwdsolver.h:215
RVector UnfoldComplex(const TVector< T > &vec) const
Unfold real and imaginary parts of a complex vector.
TCompRowMatrix< T > * F
FEM system matrix.
Definition: fwdsolver.h:399
void CalcField(const TVector< T > &qvec, TVector< T > &phi, IterativeSolverResult *res=0) const
Calculate photon density field for a given source vector.
Distributed compressed-row sparse matrix class.
Definition: crmatrix_mpi.h:33
int iterative_maxit
iterative solver max iterations (0 for auto)
Definition: fwdsolver.h:408
RVector ProjectAll_real(const TCompRowMatrix< T > &mvec, const TVector< T > *dphi, DataScale scl=DATA_DEFAULT)
Return boundary data for the complex case in a real vector.
bool unwrap_phase
use phase unwrapping?
Definition: fwdsolver.h:435
void SetDataScaling(DataScale scl)
Set the default scaling for data returned by the projection methods.
TCompRowMatrix< T > * B
mass matrix; only used for time-domain problems
Definition: fwdsolver.h:404
linear scaling
Definition: fwdsolver.h:29
double GetLinSolverTol() const
Returns the solver tolerance.
Definition: fwdsolver.h:200
Definition: mwsolution.h:8
iterative solver
Definition: fwdsolver.h:21
TVector< T > * Fd
diagonal of Cholesky factorisation
Definition: fwdsolver.h:402
undefined
Definition: fwdsolver.h:19
LSOLVER LinSolver() const
Returns the current solver type.
Definition: fwdsolver.h:193
void AssembleSystemMatrix(const Solution &sol, double omega=0, bool elbasis=false)
Construct the FEM system matrix from a set of parameter distributions for a given modulation frequenc...
TPreconditioner< T > * precon
preconditioner instance
Definition: fwdsolver.h:403
PreconType precontp
preconditioner
Definition: fwdsolver.h:409
void CalcFields(const TCompRowMatrix< T > &qvec, TVector< T > *phi, IterativeSolverResult *res=0) const
Calculate photon density fields for all sources.
DataScale dscale
default data scaling: DATA_LIN or DATA_LOG
Definition: fwdsolver.h:433
Definition: solution.h:39
~TFwdSolver()
Destructor. Destroys the forward solver instance.
default method
Definition: fwdsolver.h:28
logarithmic scaling
Definition: fwdsolver.h:30
IterativeMethod method
iterative solver method, if applicable
Definition: fwdsolver.h:395