1 / 11

Dataflow Datatypes

Dataflow Datatypes. Dataflow Datatypes Revisited. Matrix. Field. ColorMap. Geometry. Matrices: Class Hierarchy. Matrix -- base class

hchadwick
Download Presentation

Dataflow Datatypes

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Dataflow Datatypes

  2. Dataflow Datatypes Revisited Matrix Field ColorMap Geometry

  3. Matrices: Class Hierarchy • Matrix -- base class • get, put, [ ], nrows, ncols, get_row, get_col, get_val, zero, mult, mult_transpose, print, {is_,as_,}{sparse,dense,column}, cg_solve, bicg_solve, scalar_multiply • SparseRowMatrix • int *rows, int *cols, double *a, int nnz; • ColumnMatrix • double *data; • DenseMatrix • double **data;

  4. Matrices: External Libraries • PETSc • Preconditioners: jacobi, bijacobi, sor, eisenstat, icc, ilu, asm, sles, lu, mg, spai, milu, nn, cholesky, ramg • Solvers: KSRICHARDSON, PSPCHEBYCHEV, KSPGG, KSPGMRES, KSPTCQMR, KSPBCGS, KSPBGS, KSPTFQMR, KSPCR, KSPLSQR, KSPBICG, KSPPREONLY • BLAS and Atlas • Faster linear-algebra via loop unrolling

  5. Dataflow Datatypes Revisited Matrix Field ColorMap Geometry

  6. Fields: Mesh + Data Geometry Regular Irregular PointCloudField Data int, float, double, … Vector, Tensor, … ScanlineField CurveField QuadSurfField TriSurfField ImageField Data_at (center) Properties TetVolField LatVolField HexVolField

  7. Meshes • Mesh -- base class • get_bounding_box, transform, synchronize, dimensionality • PointCloudMesh • Iterators, get_{node,edge,face,cell}, locate, get_weights, add_node • HexVolMesh • Iterators, get_{node,edge,face,cell}, locate, get_weights, add_node, add_elem • ImageMesh • Same, plus new Index type

  8. Fields • Field::GenericField -- base class • GenericField<MeshType, DataType>, data_at • Holds Handle to Mesh • Owns Data -- resize_fdata() [new DataType for FData{2,3}d] • Freeze/Thaw (data) • value(), set_value(), fdata() • mesh(), mesh_detach() • All fields derive from GenericField • PointCloudMesh -> PointCloudField • ImageMesh -> ImageField • Persistent::Datatype::PropertyManager::Field::GenericField • io(), PerTypeIDlock/genmap of attrib/valuesdata_at, interfaces • Mesh::PropertyManager

  9. Persistent • Serialize data for disk I/O • Eventually for distributed data marshalling • Architecture independent • Build atop XDR • Slow for big data • Optional circumvention for DenseMatrix • Data files are (somewhat) human readable, but should ~not~ be generated / edited by anything other than SCIRun • Use “convert” programs

  10. Persistent • void • Matrix::io(Piostream& stream) • { • /* int version = */ stream.begin_class("Matrix", MATRIX_VERSION); • PropertyManager::io(stream); • stream.end_class(); • } • void ColumnMatrix::io(Piostream& stream) • { • /* int version = */stream.begin_class("ColumnMatrix", COLUMNMATRIX_VERSION); • Matrix::io(stream); • stream.io(rows); • if(stream.reading()) { • data=scinew double[rows]; • } • int i; • for(i=0;i<rows;i++) • stream.io(data[i]); • stream.end_class(); • }

  11. Converter: CurveFieldToText • MeshHandle mH = handle->mesh(); • CurveMesh *cm = dynamic_cast<CurveMesh *>(mH.get_rep()); • CurveMesh::Node::iterator niter; • CurveMesh::Node::iterator niter_end; • CurveMesh::Node::size_type nsize; • cm->begin(niter); cm->end(niter_end); cm->size(nsize); • cerr << "Number of points = "<< nsize <<"\n"; • while(niter != niter_end) { • Point p; • cm->get_center(p, *niter); • fprintf(fPts, "%lf %lf %lf\n", p.x(), p.y(), p.z()); • ++niter; • } • CurveMesh::Edge::size_type esize; • CurveMesh::Edge::iterator eiter; • CurveMesh::Edge::iterator eiter_end; • CurveMesh::Node::array_type edge_nodes(2); • cm->size(esize); • cm->begin(eiter); • cm->end(eiter_end); • FILE *fEdges = fopen(edgesName, "wt"); • cerr << "Number of edges = "<< esize <<"\n"; • while(eiter != eiter_end) { • cm->get_nodes(edge_nodes, *eiter); • fprintf(fEdges, "%d %d\n", (int)edge_nodes[0]+baseIndex, (int)edge_nodes[1]+baseIndex); • ++eiter; • }

More Related