[cig-commits] r13981 - cs/cigma/trunk/src
luis at geodynamics.org
luis at geodynamics.org
Wed Jan 28 09:05:11 PST 2009
Author: luis
Date: 2009-01-28 09:05:11 -0800 (Wed, 28 Jan 2009)
New Revision: 13981
Modified:
cs/cigma/trunk/src/core_args.cpp
cs/cigma/trunk/src/core_extract_op.cpp
Log:
Debugging 'cigma extract' with available 2d elements (tri3, quad4)
Modified: cs/cigma/trunk/src/core_args.cpp
===================================================================
--- cs/cigma/trunk/src/core_args.cpp 2009-01-28 17:05:09 UTC (rev 13980)
+++ cs/cigma/trunk/src/core_args.cpp 2009-01-28 17:05:11 UTC (rev 13981)
@@ -51,6 +51,10 @@
{
os << mesh_info.p_nc << "," << mesh_info.p_eb;
}
+ if (mesh_info.cell_type_name != "")
+ {
+ os << ";" << mesh_info.cell_type_name;
+ }
os << ")";
}
return os;
Modified: cs/cigma/trunk/src/core_extract_op.cpp
===================================================================
--- cs/cigma/trunk/src/core_extract_op.cpp 2009-01-28 17:05:09 UTC (rev 13980)
+++ cs/cigma/trunk/src/core_extract_op.cpp 2009-01-28 17:05:11 UTC (rev 13981)
@@ -6,6 +6,7 @@
#include <iostream>
#include <cassert>
#include <sstream>
+#include <valarray>
using namespace std;
using namespace cigma;
@@ -116,9 +117,6 @@
TRI_LOG(points.n_points());
TRI_LOG(points.n_dim());
- //weights.init_value(1);
- //points.init_value(2);
-
shared_ptr<FE> fe(new FE);
fe->init(quadrature);
assert(fe->cell);
@@ -147,6 +145,22 @@
}
double *xyz = &global_qpts[q*3];
fe->cell->uvw2xyz(uvw, xyz);
+
+ if (false)
+ {
+ cout
+ << e << " "
+ << q << " "
+ << "-> "
+ << uvw[0] << " "
+ << uvw[1] << " "
+ << uvw[2] << " "
+ << "-> "
+ << xyz[0] << " "
+ << xyz[1] << " "
+ << xyz[2] << " "
+ << "\n";
+ }
}
// copy global coords to output arrays
@@ -154,43 +168,40 @@
{
weights(e*nq + q, 0) = fe->jxw[q];
for (j = 0; j < q_ndim; j++)
+ {
points(e*nq + q, j) = global_qpts[q*3 + j];
+ }
}
- }
- delete [] global_qpts;
-
-
- /*
- Quadrature global_qpts(nq, 3);
- //cigma::array<double> qpts(nq,3);
- shared_ptr<FE> fe(new FE(quadrature));
-
- ApplyReferenceMap(fe, global_quadrature);
-
- for (e = 0; e < nel; e++) // XXX: use cell_iterator
- {
- // load cell
- mesh->getCell(e, *(fe->cell));
- fe->update_jxw();
-
- // apply refmap to local quadrature points
- fe->apply_refmap(global_qpts);
-
- // copy data to
- for (q = 0; q < nq; q++)
+ // XXX: temporary debug statements
+ if (false)
{
- const int n = e*nq + q;
- weights->data(n) = quadrature->getWeight(q) * jxw[q];
- for (j = 0; j < ndim; j++)
+ for (q = 0; q < nq; q++)
{
- points->data(n,j) = qpts(q,j);
+ cout
+ << nel << " "
+ << nq << " "
+ << ":: ";
+ cout
+ << e << " "
+ << q << " "
+ << ":: ";
+ cout << (e*nq + q) << " ";
+ for (j = 0; j < q_ndim; j++) cout << (q*3 + j) << " ";
+ cout << ":: ";
+ cout << weights(e*nq+q,0) << " ";
+ for (j = 0; j < q_ndim; j++)
+ {
+ cout << points(e*nq+q,j) << " ";
+ }
+ cout << "\n";
}
}
+
}
- // */
-
+ delete [] global_qpts;
+
return 0;
}
More information about the CIG-COMMITS
mailing list