All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----AT.Ac.univie.imp.loeffler.pde.threeD.fd.CachingPDE
Caching is supported for the right hand side (source term) f and for a representation of the matrix A which is allmost always needed by the methods evaluateLHS() and evaluate().
public CachingPDE()
public NoBoundaryGrid sampleRHS(int size)
Sampling the right hand side f of a PDE for a given grid size (as this method does) is usually a time-consuming task. This implementation improves performance for those cases where sampleRHS() is called more than once for a specific grid size because it caches the right hand side (source term) f for every grid size. This may lead to space inefficiencies in general but not in the context of the (Full) Multigrid algorithm, where the right hand side is needed at all grid levels over and over again.
The actual calculation of the right hand side f is re-routed to method actuallySampleRHS().
protected abstract NoBoundaryGrid actuallySampleRHS(int size)
It is not necessary to know the value of f at the boundary of the grid, so the return type of this method is of type NoBoundaryGrid. But note that the size of the grid passed to this method includes (as always) the boundary. E.g., a 65x65x65 grid would be described by a size of 65 and its interior values (the one to be set by this method) would comprise the grid elements (1,1,1) to (63,63,63). The boundary elements (where at least one index is either 0 or 64) are non-existent in a NoBoundaryGrid.
protected Object sampleMatrix(int size)
Methods evaluateLHS() and evaluate() are supposed to call this method if they need a representation of the matrix A for doing their job for a grid of a certain size.
The actual calculation of the representation of the matrix A is re-routed to method actuallySampleMatrix().
protected abstract Object actuallySampleMatrix(int size)
The implementer of this method is entirely free in choosing any suitable representation for the matrix A as long as the methods evaluate() and evaluateLHS() are able to fulfill their job when passed the output of this method later in the course of the execution of the FMG algorithm.
All Packages Class Hierarchy This Package Previous Next Index