-- pde_read_ucd.ads all variables and arrays named in pde_read_ucd.h -- from pde_read_ucd.ads just call pde_read_ucd(file_name); -- only one call per execution -- start with subscript 1..n_vertices etc. -- -- structure of UCD file -- n_vertices n_cells n_ndata n_cdata n_mdata -- nodes called vertices in this implementation -- vertex data x,y,z 4th optional vertex under model data -- record xyz {x : real; y : real; z : real} -- vert array of xyz(1..n_vertices) -- record keys {int user; int i;} used if data not dense 1..n_vertices -- key array of keys(1..n_vertices) -- cell data -- record cells {i : integer; matl : integer; ctyp : integer; cverts[8]} -- ctyp pt=1(1) line=2(2) tri=3(3) quad=4(4) -- tet=5(4) pyr=6(5) prism=7(6) hex=8(8) type number, vert -- cell array of cells(1..n_cells) -- node data is Dirchilet boundary values, optional 4th coordinate -- nodecomp nodes1 nodes2 nodes3 component names -- noden1 noden2 noden3 component lengths, sum is n_ndata -- dirchilet_bound array of real(1..n_nvertices) -- fourth_dim array of real(1..n_vertices) -- cell_data is Neumann boundary values, outward normal positive -- cellcomp cells1, cells2, cells3 component names -- celln1 celln2 celln3 component lengths, sum is n_cdata -- neumann_bound array of real(1..n_cells) -- model_data is optional fourth dimension for vertices -- modelcomp models1 models2 models3 component names -- modeln1 modeln2 modeln3 component lengths, sum is n_mdata -- optional for this application n_vertices -- fourth_dim array of real(1..n_vertices) with Real_Arrays; use Real_Arrays; package Pde_Read_Ucd is procedure Pde_Read_Ucd_file(File_Name:string); -- inputs all values below N_Vertices : Integer; -- number of nodes N_Cells : Integer; -- number of cells N_Ndata : Integer; -- length of node data, zero if none (Dirchilet values) N_Cdata : Integer; -- length of cell data, zero if none (Neumann values) N_Mdata : Integer; -- number of model data, zero if none (4th vertex 4D) type xyz is record X : real; Y : real; Z : real; end record; type Verta is array(Integer range <>) of xyz; type PVerta is access Verta; Vert : PVerta; -- size determined and allocated when file read type Keys is record User : Integer; Internal : integer; end record; type Keya is array(Integer range <>) of Keys; type PKeya is access Keya; Key : PKeya; type Varray is array(1..8) of Integer; type Cells is record I : integer; Matl : Integer; Ctyp : Integer; Cvert : Varray; end record; type Cellsa is array(Integer range <>) of Cells; type PCellsa is access Cellsa; Cell : PCellsa; -- cell type name, integer number, number of vertices -- ctyp pt=1(1) line=2(2) tri=3(3) quad=4(4) tet=5(4) pyr=6(5) prism=7(6) -- hex=8(8) type number, vert Cvert : array(1..8) of Integer; Ctyps : array(0..8) of String(1..5) := ("none ", "pt ", "line ", "tri ", "quad ", "tet ", "pyr ", "prism", "hex "); Ctypi : array(0..8) of Integer := ( 0, 1, 2, 3, 4, 5, 6, 7, 8); Ctypn : array(0..8) of Integer := ( 0, 1, 2, 3, 4, 4, 5, 6, 8); -- node data, Dirchilet boundary values Nodecomp : Integer; -- number of components 1=Dirchilet, 2=D and 4th Nodes1, Nodes2, Nodes3 : String(1..72); -- component names Noden1, Noden2, Noden3 : Integer; -- component lengths, sum is n_ndata type Dba is array(Integer range <>) of Real; type PDba is access Dba; Dirchilet_Bound : PDba; -- Dirchilet bound and 4th component of node type Fourthda is array(Integer range <>) of Real; type PFourthda is access Fourthda; Fourth_Dim : PFourthda; -- cell_data, Neumann boundary values Cellcomp : Integer; -- number of components Cells1, Cells2, Cells3 : String(1..72); -- component names Celln1, Celln2, Celln3 : Integer; -- component lengths, sum is n_ndata type Nba is array(Integer range <>) of Real; type PNba is access Nba; Neumann_Bound : PNba; -- model_data, optional fourth coordinate for vertices Modelcomp : Integer; -- number of model components Models1, Models2, Models3 : String(1..72); -- component names Modeln1, Modeln2, Modeln3 : Integer; -- component lengths, sum is n_mdata end Pde_Read_Ucd;