Peter Gottschling committed Feb 15, 2008 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 ``````#include #include "SurfaceQuadrature.h" #include "Quadrature.h" namespace AMDiS { //::std::list SurfaceQuadrature::surfaceQuadratureList; SurfaceQuadrature::SurfaceQuadrature(Quadrature *quad, VectorOfFixVecs > &coords) : Quadrature((quad->getName() + " surface").c_str(), quad->getDegree(), quad->getDim() + 1, quad->getNumPoints(), NULL, quad->getWeight()), quad_(quad), coords_(coords) { int i, j, k; // copy coords // coords_ = NEW DimVec[dim](dim, NO_INIT); // for(i = 0; i < dim; i++) { // coords_[i] = coords[i]; // } lambda = NEW VectorOfFixVecs >(dim, n_points, NO_INIT); // for each integration point for(i=0; i < n_points; i++) { // get coords of quadrature point in dim-1 DimVec origin = quad->getLambda(i); for(j=0; j < dim+1; j++) (*lambda)[i][j] = 0.0; for(j = 0; j < dim; j++) { for(k = 0; k < dim+1; k++) { (*lambda)[i][k] += origin[j] * coords_[j][k]; } } // // create barycentric coords for dim // if(dim > 1) { // for (j = 0; j < side; j++) // (*lambda)[i][j] = origin[j]; // (*lambda)[i][side] = 0.0; // for (j = side+1; j <= dim; j++) // (*lambda)[i][j] = origin[j-1]; // } else { // (*lambda)[i][side] = 1.0; // (*lambda)[i][1-side] = 0.0; // } } } void SurfaceQuadrature::scaleSurfaceQuadrature(VectorOfFixVecs >&coords) { int i, j, k; // copy coords for(i = 0; i < dim; i++) { coords_[i] = coords[i]; } // for each integration point for(i=0; i < n_points; i++) { // get coords of quadrature point in dim-1 DimVec origin = quad_->getLambda(i); for(j=0; j < dim+1; j++) (*lambda)[i][j] = 0.0; for(j = 0; j < dim; j++) { for(k = 0; k < dim+1; k++) { (*lambda)[i][k] += origin[j] * coords_[j][k]; } } } } }``````