[cig-commits] r14070 - cs/cigma/trunk/src
luis at geodynamics.org
luis at geodynamics.org
Wed Feb 18 08:14:13 PST 2009
Author: luis
Date: 2009-02-18 08:14:12 -0800 (Wed, 18 Feb 2009)
New Revision: 14070
Modified:
cs/cigma/trunk/src/cli_mesh_info_cmd.cpp
Log:
Add dimension and bounds to the output of the 'cigma mesh-info' command
Modified: cs/cigma/trunk/src/cli_mesh_info_cmd.cpp
===================================================================
--- cs/cigma/trunk/src/cli_mesh_info_cmd.cpp 2009-02-18 16:14:11 UTC (rev 14069)
+++ cs/cigma/trunk/src/cli_mesh_info_cmd.cpp 2009-02-18 16:14:12 UTC (rev 14070)
@@ -70,12 +70,37 @@
{
mesh->computeCellVolumes();
+ const int ndim = mesh->n_dim();
+ const int ncells = mesh->n_cells();
+ const int nnodes = mesh->coords->n_points();
+
+ double minpt[ndim], maxpt[ndim];
+ mesh->getBoundingBox(minpt, maxpt);
+
double h = mesh->getMaxCellDiameter();
double volume = mesh->getVolume();
+
const string indent = " ";
+
cout << "Mesh Info:" << endl;
- cout << indent << "Location = " << meshfile << endl;
+
+ cout << indent << "Location = " << meshfile << endl;
+ cout << indent << "Dimension = " << ndim << endl;
+ cout << indent << "Num cells = " << ncells << endl;
+ cout << indent << "Num nodes = " << nnodes << endl;
cout << indent << "Cell type = " << Cell::type2string(mesh->getCellType()) << endl;
+
+ cout << indent << "Mesh bounds = ";
+ for (int i = 0; i < ndim; i++)
+ {
+ cout << "[" << minpt[i] << ", " << maxpt[i] << "]";
+ if (i != ndim-1)
+ {
+ cout << " x ";
+ }
+ }
+ cout << endl;
+
cout << indent << "Total mesh volume = " << volume << endl;
cout << indent << "Max cell diameter = " << h << endl;
More information about the CIG-COMMITS
mailing list