Converting from Old Field Abstraction to the New Field Abstraction
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Converting from Old Field Abstraction to the New Field Abstraction



	Both Stephen and I have converted existing Pooma code from the
old Field abstraction to the new Field abstraction.  Here are part of
the steps in the mostly mechanical conversion.  Revisions to this
document are solicited.

Thanks,
Jeffrey D. Oldham
oldham@xxxxxxxxxxxxxxxx
typedef UniformRectilinearMesh<2>	Mesh_t;		unchanged
typedef DiscreteGeometry<Cell, Mesh_t>	Geometry_t;	Remove.  We will replace "Cell" later.
typedef Field<Geometry_t,double,EngineTag> Field_t;	s/Geometry_t/Mesh_t/g


							Add: DomainLayout<2> layout(vertDomain, GuardLayers<2>(1));
							  // A layout tells how to distribute the data among the processors.
Mesh_t mesh(vertDomain);				Change to: Mesh_t mesh(layout, Vector<2>(0.0), Vector<2>(1.0,1.0));
							  // Make the initial values explicit.
							Centering<2> cell = canonicalCentering<2>(CellType, Continuous);
							  // Specify the centering here.
Geometry_t geom(mesh, GuardLayers<2>(1));		// Remove.

// Initialize the fields using the geometries.		// a_m and b_m are Fields.
a_m.initialize(geom);					a_m.initialize(cell, layout, mesh);
b_m.initialize(geom);					b_m.initialize(cell, layout, mesh);
							  // These Field changes vary on a case-by-case basis.

a_m.addBoundaryConditions(AllZeroFaceBC());		Pooma::addAllConstantFaceBC(a_m, 0.0);
							  // 0.0 is the initial value.