/[escript]/trunk/finley/src/CPPAdapter/MeshAdapter.cpp
ViewVC logotype

Diff of /trunk/finley/src/CPPAdapter/MeshAdapter.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1344 by ksteube, Wed Nov 14 04:28:25 2007 UTC revision 1345 by ksteube, Wed Nov 14 07:53:34 2007 UTC
# Line 158  void MeshAdapter::dump(const std::string Line 158  void MeshAdapter::dump(const std::string
158        if (! (ncdims[9] = dataFile.add_dim("dim_ContactElements_numNodes", num_ContactElements_numNodes)) )        if (! (ncdims[9] = dataFile.add_dim("dim_ContactElements_numNodes", num_ContactElements_numNodes)) )
159          throw DataException("Error - MeshAdapter::dump: appending dimension dim_ContactElements_numNodes to netCDF file failed: " + *newFileName);          throw DataException("Error - MeshAdapter::dump: appending dimension dim_ContactElements_numNodes to netCDF file failed: " + *newFileName);
160    
161     // MPI size, MPI rank, Name, order, reduced_order     // Attributes: MPI size, MPI rank, Name, order, reduced_order
162     if (!dataFile.add_att("mpi_size", mpi_size) )     if (!dataFile.add_att("mpi_size", mpi_size) )
163          throw DataException("Error - MeshAdapter::dump: appending mpi_size to NetCDF file failed: " + *newFileName);          throw DataException("Error - MeshAdapter::dump: appending mpi_size to NetCDF file failed: " + *newFileName);
164     if (!dataFile.add_att("mpi_rank", mpi_rank) )     if (!dataFile.add_att("mpi_rank", mpi_rank) )
165          throw DataException("Error - MeshAdapter::dump: appending mpi_rank to NetCDF file failed: " + *newFileName);          throw DataException("Error - MeshAdapter::dump: appending mpi_rank to NetCDF file failed: " + *newFileName);
166     if (!dataFile.add_att("Name",mesh->Name) )     if (!dataFile.add_att("Name",mesh->Name) )
167          throw DataException("Error - MeshAdapter::dump: appending Name to NetCDF file failed: " + *newFileName);          throw DataException("Error - MeshAdapter::dump: appending Name to NetCDF file failed: " + *newFileName);
168       if (!dataFile.add_att("numDim",numDim) )
169            throw DataException("Error - MeshAdapter::dump: appending order to NetCDF file failed: " + *newFileName);
170     if (!dataFile.add_att("order",mesh->order) )     if (!dataFile.add_att("order",mesh->order) )
171          throw DataException("Error - MeshAdapter::dump: appending order to NetCDF file failed: " + *newFileName);          throw DataException("Error - MeshAdapter::dump: appending order to NetCDF file failed: " + *newFileName);
172     if (!dataFile.add_att("reduced_order",mesh->reduced_order) )     if (!dataFile.add_att("reduced_order",mesh->reduced_order) )
173          throw DataException("Error - MeshAdapter::dump: appending reduced_order to NetCDF file failed: " + *newFileName);          throw DataException("Error - MeshAdapter::dump: appending reduced_order to NetCDF file failed: " + *newFileName);
174       if (!dataFile.add_att("numNodes",numNodes) )
175            throw DataException("Error - MeshAdapter::dump: appending numNodes to NetCDF file failed: " + *newFileName);
176     if (!dataFile.add_att("num_Elements",num_Elements) )     if (!dataFile.add_att("num_Elements",num_Elements) )
177          throw DataException("Error - MeshAdapter::dump: appending num_Elements to NetCDF file failed: " + *newFileName);          throw DataException("Error - MeshAdapter::dump: appending num_Elements to NetCDF file failed: " + *newFileName);
178     if (!dataFile.add_att("num_FaceElements",num_FaceElements) )     if (!dataFile.add_att("num_FaceElements",num_FaceElements) )
# Line 180  void MeshAdapter::dump(const std::string Line 184  void MeshAdapter::dump(const std::string
184    
185     // // // // // Nodes // // // // //     // // // // // Nodes // // // // //
186    
187       // Only write nodes if non-empty because NetCDF doesn't like empty arrays (it treats them as NC_UNLIMITED)
188       if (numNodes>0) {
189    
190     // Nodes Id     // Nodes Id
191     if (! ( ids = dataFile.add_var("Nodes_Id", ncInt, ncdims[0])) )     if (! ( ids = dataFile.add_var("Nodes_Id", ncInt, ncdims[0])) )
192          throw DataException("Error - MeshAdapter::dump: appending Nodes_Id to netCDF file failed: " + *newFileName);          throw DataException("Error - MeshAdapter::dump: appending Nodes_Id to netCDF file failed: " + *newFileName);
# Line 235  void MeshAdapter::dump(const std::string Line 242  void MeshAdapter::dump(const std::string
242     if (! (ids->put(int_ptr, mpi_size+1)) )     if (! (ids->put(int_ptr, mpi_size+1)) )
243          throw DataException("Error - MeshAdapter::dump: copy Nodes_DofDistribution to netCDF buffer failed: " + *newFileName);          throw DataException("Error - MeshAdapter::dump: copy Nodes_DofDistribution to netCDF buffer failed: " + *newFileName);
244    
245       }
246    
247     // // // // // Elements // // // // //     // // // // // Elements // // // // //
248    
    // Only write elements if non-empty because NetCDF doesn't like empty arrays (it treats them as NC_UNLIMITED)  
249     if (num_Elements>0) {     if (num_Elements>0) {
250    
251       // Temp storage to gather node IDs       // Temp storage to gather node IDs

Legend:
Removed from v.1344  
changed lines
  Added in v.1345

  ViewVC Help
Powered by ViewVC 1.1.26