package AMRTools; import BoxTools.Util; import BoxTools.BoxLayout; import BoxTools.BoxLayoutData; import BoxTools.LayoutIterator; import BoxTools.DataIterator; import BoxTools.BoxedArray; import BoxTools.DataIndex; import BoxTools.List; /** * A LevelFluxRegister object contains the difference at the coarse-fine interface * between the coarse gradients computed using the ordinary method and the ones computed by * averaging the fine gradients. The goal is to use this difference to modify Laplacian in order * maintain the conservation form. Please refer to the Chombo design document for the details. * Along each orientation, there is one BoxLayoutData storing gradients at the * coarse-fine interface which are computed using the finite difference method. The updating * mapping from the gradients at the coarse level to this BoxLayoutData (register) * is cached. This information is used to update this register quickly. Also, there is another * another BoxLayoutData storing gradients at the coarse-fine interface which are * computed by averaging the gradients at the fine level. The updating mapping from the fine * level data to this register is also cached. Another info cached is the updating mapping from * the registers to the coarse level data, which is used to modify the Laplacian at the coarse * level. * An interesting question to answer during the implement ion is whether a local write plus a * global read is faster than a global write plus a local read. The guess from the Tatinium group * is that the first choice is usually faster than the second. We need to verify this. Currently * we have implementations using both the two strategies. *

Usage: must be declared local. * @see BoxTools.BoxLayout, BoxTools.BoxLayoutData, BoxTools.LayoutIterator, BoxTools.BoxedArray * and BoxTools.DataIndex. * @see Chombo Specification * @version 1.1 * Modified on Jul 09, 2004. change of syntax of foreach, see BoxTools/foreachLoopTest.ti. * @author Tong Wen, LBNL * @since 1.0 */ template public class LevelFluxRegister{ private final static int highBoundary=Util.HIGH_SIDE; private final static int lowBoundary=Util.LOW_SIDE; private final static int SPACE_DIM=Util.SPACE_DIM; private final static int SORT_DIM=Util.SORT_DIM; private BoxLayout local single m_coarseBL; private BoxLayout local single m_fineBL; private BoxLayout local single m_fineBL_c; private RectDomain single m_probDomain; //no use here? private int single m_refRatio; //private double single m_dxc; private GridSpacing local m_DXc; //private int single m_nComp; private boolean single m_defined=false; private int m_numFaceCells; private Point [] local [] local m_disps; LayoutIterator local m_coarseLItr, m_fineLItr; DataIndex local [] local [] local m_FCAdjInfo; template BoxLayoutData