public static Grid Read(BinaryReader reader) { byte version = reader.ReadByte(); switch (version) { case Version0: { string title = reader.ReadString(); SpecGrid sg = SpecGrid.Read(reader); Coord c = Coord.Read(reader); Zcorn z = Zcorn.Read(reader); Actnum a = Actnum.Read(reader); int np = reader.ReadInt32(); List <Prop> ps = new List <Prop>(); for (int p = 0; p < np; ++p) { ps.Add(Prop.Read(reader)); } int nw = reader.ReadInt32(); List <Compdat> ws = new List <Compdat>(); for (int w = 0; w < nw; ++w) { ws.Add(Compdat.Read(reader)); } return(new Grid(title, sg, c, z, a, ps, ws)); } default: return(new Grid()); } }
void Clear() { SpecGrid = new SpecGrid(); //MapAxes = new MapAxes(); Coord = new Coord(); Zcorn = new Zcorn(); Actnum = new Actnum(); Props = new List <Prop>(); Title = "Grid_" + (Namber++).ToString(); Wells = new List <Compdat>(); }
void Init(string title, SpecGrid sg, Coord c, Zcorn z, Actnum a, List <Prop> ps, List <Compdat> ws) { Clear(); Title = title; SpecGrid = sg; Coord = c; Zcorn = z; Actnum = a; Props = ps; Wells = ws; }
public bool Read(string file, FileType type) { SpecGrid = new SpecGrid(file, type); MapAxes ma = new MapAxes(file, type); Coord = new Coord(SpecGrid, ma, file, type); Zcorn = new Zcorn(SpecGrid, file, type); Actnum = new Actnum(SpecGrid, file, type); if (Specified()) { return(true); } Clear(); return(false); }
public void Write(BinaryWriter writer) { writer.Write(Version0); writer.Write(Title); SpecGrid.Write(writer); Coord.Write(writer); Zcorn.Write(writer); Actnum.Write(writer); writer.Write(Props.Count); foreach (Prop p in Props) { p.Write(writer); } writer.Write(Wells.Count); foreach (Compdat well in Wells) { well.Write(writer); } }
public Grid(string title, SpecGrid sg, Coord c, Zcorn z, Actnum a, List <Prop> ps, List <Compdat> ws) { Init(title, sg, c, z, a, ps, ws); }
/* * public Cell GlobalCell(int i, int j, int k) * { * //float[,] matrix = MapAxes.Matrix(); * Cell cell = new Cell(); * cell.Act = Actnum.Values[i, j, k]; * cell.Corners[0] = Coord.GlobalPillar(i + 0, j + 0).Point3D(Zcorn.Items[i, j, k].Corners[0]); * cell.Corners[1] = Coord.GlobalPillar(i + 1, j + 0).Point3D(Zcorn.Items[i, j, k].Corners[1]); * cell.Corners[2] = Coord.GlobalPillar(i + 0, j + 1).Point3D(Zcorn.Items[i, j, k].Corners[2]); * cell.Corners[3] = Coord.GlobalPillar(i + 1, j + 1).Point3D(Zcorn.Items[i, j, k].Corners[3]); * cell.Corners[4] = Coord.GlobalPillar(i + 0, j + 0).Point3D(Zcorn.Items[i, j, k].Corners[4]); * cell.Corners[5] = Coord.GlobalPillar(i + 1, j + 0).Point3D(Zcorn.Items[i, j, k].Corners[5]); * cell.Corners[6] = Coord.GlobalPillar(i + 0, j + 1).Point3D(Zcorn.Items[i, j, k].Corners[6]); * cell.Corners[7] = Coord.GlobalPillar(i + 1, j + 1).Point3D(Zcorn.Items[i, j, k].Corners[7]); * return cell; * } */ public bool Specified() { return(SpecGrid.Specified() && Coord.Specified() && Zcorn.Specified() && Actnum.Specified()); }
public int NZ() { return(Zcorn.NZ()); }
public int NY() { return(Zcorn.NY()); }
public int NX() { return(Zcorn.NX()); }