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) ) |
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); |
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 |