14 double physField(
double x,
double y,
double z,
double factor )
25 double out = factor * sqrt( x * x + y * y + z * z );
36 const double defVal = 0.;
46 int numElems = elems.
size();
48 for(
int i = 0; i < numElems; i++ )
56 double fieldValue =
physField( xyz[0], xyz[1], xyz[2], factor );
68 const int ndofperE = np * np;
69 double* defDouble =
new double[ndofperE];
73 std::cout <<
"rval = " << rval << std::endl;
81 int numElems = elems.
size();
82 std::vector< double > tData( ndofperE, 0.0 );
84 for(
int i = 0; i < numElems; i++ )
91 double fieldValue =
physField( xyz[0], xyz[1], xyz[2], factor );
92 for(
int j = 0; j < ndofperE; ++j )
93 tData[j] = fieldValue;
109 const double defVal = 0.;
113 int numVerts = verts.
size();
114 for(
int i = 0; i < numVerts; i++ )
121 double fieldValue =
physField( vertPos[0], vertPos[1], vertPos[2], factor );
130 int main(
int argc,
char** argv )
133 using namespace moab;
139 cout <<
"Usage: " << argv[0] <<
" <infile> <outfile> [factor]\n"
140 <<
"Writes both vertex and element fields.\n";
147 if( argc == 4 ) factor = atof( argv[3] );
156 cout <<
"wrote " << argv[2] << endl;
158 cout <<
"Failed to write " << argv[2] << endl;