// A Field contains the values of a single field (phi, // error, etc.) across all levels. class Field { Patch [1d] patches; double [1d] [3d] grids; Field(Patch [1d] patches) { this.patches = patches; grids = new double [patches.domain()] [3d]; } Field replicate() { Field f = new Field(patches); // Make local copy of patch array, and copy patches. f.patches = new Patch [patches.domain()]; f.patches.copy(patches); f.grids.copy(grids); return f; } }