[cig-commits] r13746 - cs/cigma/trunk/src
luis at geodynamics.org
luis at geodynamics.org
Wed Dec 17 02:32:57 PST 2008
Author: luis
Date: 2008-12-17 02:32:56 -0800 (Wed, 17 Dec 2008)
New Revision: 13746
Modified:
cs/cigma/trunk/src/Field.cpp
cs/cigma/trunk/src/MeshPart.cpp
cs/cigma/trunk/src/cli_compare_cmd.cpp
cs/cigma/trunk/src/io_vtk.h
Log:
Misc updates
Modified: cs/cigma/trunk/src/Field.cpp
===================================================================
--- cs/cigma/trunk/src/Field.cpp 2008-12-17 10:32:54 UTC (rev 13745)
+++ cs/cigma/trunk/src/Field.cpp 2008-12-17 10:32:56 UTC (rev 13746)
@@ -63,23 +63,15 @@
const int nel = mesh->n_cells();
const int ndofs = fe->cell->n_nodes();
const int valdim = this->n_rank();
+
assert((0 <= cellIndex) && (cellIndex < nel));
- /*
- for (int i = 0; i < ndofs; i++)
- {
- int n = mesh->connect->getId(cellIndex, i);
- for (int j = 0; j < valdim; j++)
- {
- cellDofs[valdim*i + j] = dofs->dofs[valdim*n + j];
- }
- }*/
-
int nodeIds[ndofs];
for (int i = 0; i < ndofs; i++)
{
nodeIds[i] = mesh->connect->getId(cellIndex, i);
}
+
dofs->getData(ndofs, nodeIds, cellDofs);
}
Modified: cs/cigma/trunk/src/MeshPart.cpp
===================================================================
--- cs/cigma/trunk/src/MeshPart.cpp 2008-12-17 10:32:54 UTC (rev 13745)
+++ cs/cigma/trunk/src/MeshPart.cpp 2008-12-17 10:32:56 UTC (rev 13746)
@@ -134,6 +134,7 @@
{
this->cell_type = vtk->getCellType(0);
}
+ TRI_LOG(cell_type);
this->setPath2(p_nc, p_eb);
}
Modified: cs/cigma/trunk/src/cli_compare_cmd.cpp
===================================================================
--- cs/cigma/trunk/src/cli_compare_cmd.cpp 2008-12-17 10:32:54 UTC (rev 13745)
+++ cs/cigma/trunk/src/cli_compare_cmd.cpp 2008-12-17 10:32:56 UTC (rev 13746)
@@ -9,6 +9,7 @@
using namespace cigma;
namespace po = boost::program_options;
+
// ----------------------------------------------------------------------------
CompareCmd::CompareCmd()
@@ -37,8 +38,6 @@
;
opts2.add_options()
- ("freq,f", po::value<int>(&(op.freq)), "Output frequency of timer")
- ("threshold", po::value<double>(&threshold), "Threshold value for global residual")
("first-mesh", po::value<string>(&mesh1), "Mesh for first field")
("first-mesh-cell", po::value<string>(&cell1), "...cell type for first mesh")
("first-mesh-coords", po::value<string>(&nc1), "...node coordinates for first mesh")
@@ -54,12 +53,13 @@
("rule,r", po::value<string>(&rule), "Integration rule (points and weights)")
("rule-weights", po::value<string>(&qw), "...integration weights on reference cell")
("rule-points", po::value<string>(&qx), "...integration points on reference cell")
+ ("freq,f", po::value<int>(&(op.freq)), "Output frequency of timer")
+ ("threshold", po::value<double>(&threshold), "Threshold value for global residual")
;
+ // define positional arguments
args.add("first", 1);
args.add("second", 1);
- //args.add("first-mesh", 1);
- //args.add("second-mesh", 1);
}
void CompareCmd::configure()
Modified: cs/cigma/trunk/src/io_vtk.h
===================================================================
--- cs/cigma/trunk/src/io_vtk.h 2008-12-17 10:32:54 UTC (rev 13745)
+++ cs/cigma/trunk/src/io_vtk.h 2008-12-17 10:32:56 UTC (rev 13746)
@@ -71,7 +71,7 @@
std::string vtk_cellname(int cellType);
-int vtk_celltype(Cell::type cellType);
+int vtk_celltype(cigma::Cell::type cellType);
int vtk_celldim(int cellType);
@@ -79,8 +79,8 @@
vtkXMLReader* vtk_read_xml(const char *filename, vtkGridType& gridType);
-template <typename T>
-int vtk_read_pointdata(vtkDataSet* dataset, const char *loc, T** data, int *num, int *dim)
+template <typename MT>
+int vtk_read_pointdata(vtkDataSet* dataset, const char *loc, MT** data, int *num, int *dim)
{
TRI_LOG_STR("vtk_read_pointdata()");
TRI_LOG(loc);
@@ -94,7 +94,7 @@
int npts;
int rank;
- T* array = 0;
+ MT* array = 0;
vtkPointData *pointData = dataset->GetPointData();
@@ -119,7 +119,8 @@
TRI_LOG(datatype);
// verify we are loading a dataset of the correct type
- if (datatype != vtk_datatype_from<T>())
+ /*
+ if (datatype != vtk_datatype_from<MT>())
{
std::ostringstream stream;
std::string name = vtk_datatype_name(datatype);
@@ -130,6 +131,7 @@
<< std::ends;
throw cigma::Exception("vtk_read_pointdata", stream.str(), 3);
}
+ */
npts = dataArray->GetNumberOfTuples();
rank = dataArray->GetNumberOfComponents();
@@ -139,7 +141,7 @@
if (datatype == VTK_INT)
{
- array = new T[npts * rank];
+ array = new MT[npts * rank];
vtkIntArray* x = static_cast<vtkIntArray*>(dataArray);
for (i = 0; i < npts; i++)
{
@@ -153,7 +155,7 @@
}
else if (datatype == VTK_LONG)
{
- array = new T[npts * rank];
+ array = new MT[npts * rank];
vtkLongArray* x = static_cast<vtkLongArray*>(dataArray);
for (i = 0; i < npts; i++)
{
@@ -167,7 +169,7 @@
}
else if (datatype == VTK_FLOAT)
{
- array = new T[npts * rank];
+ array = new MT[npts * rank];
vtkFloatArray* x = static_cast<vtkFloatArray*>(dataArray);
for (i = 0; i < npts; i++)
{
@@ -181,7 +183,7 @@
}
else if (datatype == VTK_DOUBLE)
{
- array = new T[npts * rank];
+ array = new MT[npts * rank];
vtkDoubleArray* x = static_cast<vtkDoubleArray*>(dataArray);
for (i = 0; i < npts; i++)
{
More information about the CIG-COMMITS
mailing list