SundanceMeshIOUtils.hpp
Go to the documentation of this file.
00001 #ifndef SUNDANCE_MESHIO_UTILS_HPP
00002 #define SUNDANCE_MESHIO_UTILS_HPP
00003 
00004 #include "Sundance.hpp"
00005 #include "SundanceFileIOChacoPartitioner.hpp"
00006 #include "SundanceCellLIDMappedFieldWrapper.hpp"
00007 
00008 namespace Sundance
00009 {
00010 
00011 /** Read the node-based fields from a mesher */
00012 Expr readNodalFields(const MeshSource& mesher, const Mesh& mesh,
00013   const VectorType<double>& vecType, int verb=0);
00014 
00015 
00016 /** Read a 2D field stored in simple ASCII format
00017  * 
00018  * nx ny                 # num x pts, num y pts
00019  * u1_1 u2_1 ... uN_1    # data at node 1
00020  * u1_2 u2_2 ... uN_2    # data at node 2
00021  * 
00022 */
00023 Expr readSerialGridField(const std::string& gridFile, 
00024   double ax, double bx,
00025   double ay, double by,
00026   const VectorType<double>& vecType,
00027   const MeshType& meshType,
00028   Mesh& mesh);
00029 
00030 
00031 /** This function reads in an exodus file, discretizes a function on 
00032  * it, and computes some functional on it. It then writes the field, 
00033  * reads it back, and computes the same functional on the new copy. 
00034  * The return value is the difference between the two functionals
00035  * which should be zero if all is running correctly. */
00036 double readbackTester(const std::string& infile, const MPIComm& comm, int verb=0) ;
00037 
00038 
00039 /** Partition a mesh and write the parts to exodus files */
00040 void serialPartition(
00041   const RCP<SerialPartitionerBase>& part,
00042   int numProc,
00043   const MeshSource& mesher, 
00044   const std::string& outfile);
00045 }
00046 
00047 #endif

Site Contact