rgb_values.blue = (4.*x-sum13)*rezdif;
default:
break;
- };
+ }
}
else // White
rgb_values.red = rgb_values.green = rgb_values.blue = 1;
default:
Assert (false, ExcNotImplemented());
return "";
- };
+ }
}
break;
default:
Assert (false, ExcNotImplemented());
- };
+ }
///////////////////////
// preamble
<< "# For a description of the UCD format see the AVS Developer's guide."
<< std::endl
<< "#" << std::endl;
- };
+ }
// start with ucd data
out << n_nodes << ' '
for (unsigned int i=spacedim; i<3; ++i)
out << "0 ";
out << std::endl;
- };
+ }
break;
- };
+ }
case 2:
{
out << std::endl;
++present_node;
- };
+ }
break;
- };
+ }
case 3:
{
out << std::endl;
++present_node;
- };
+ }
break;
- };
+ }
default:
Assert (false, ExcNotImplemented());
- };
- };
+ }
+ }
// note that we number starting with 1!
Assert (present_node == n_nodes+1,
ExcInternalError());
- };
+ }
/////////////////////////////////////////
// write cell. number them consecutively,
<< first_vertex_of_patch+i+1 << ' '
<< first_vertex_of_patch+i+1+1 << std::endl;
break;
- };
+ }
case 2:
{
<< first_vertex_of_patch+i*(n_subdivisions+1)+j+1+1
<< std::endl;
++present_cell;
- };
+ }
break;
- };
+ }
case 3:
{
<< first_vertex_of_patch+(i*(n_subdivisions+1)+j+1 )*(n_subdivisions+1)+k+1+1 << ' '
<< std::endl;
++present_cell;
- };
+ }
break;
- };
+ }
default:
Assert (false, ExcNotImplemented());
- };
+ }
// finally update the number
break;
default:
Assert (false, ExcNotImplemented());
- };
- };
+ }
+ }
out << std::endl;
// note that we number starting with 1!
Assert (present_cell == n_cells+1,
ExcInternalError());
- };
+ }
/////////////////////////////
out << patch->data(data_set,i) << ' ';
out << std::endl;
- };
+ }
break;
- };
+ }
case 2:
{
out << std::endl;
++present_node;
- };
+ }
break;
- };
+ }
case 3:
{
out << std::endl;
++present_node;
- };
+ }
break;
- };
+ }
default:
Assert (false, ExcNotImplemented());
- };
- };
- };
+ }
+ }
+ }
// no model data
break;
default:
Assert (false, ExcNotImplemented());
- };
+ }
// start with vertices order is
// lexicographical, x varying
// fastest
- out << "object \"vertices\" class array type float rank 1 shape " << spacedim << " items " << n_nodes << " data follows"
- << std::endl;
+ out << "object \"vertices\" class array type float rank 1 shape " << spacedim
+ << " items " << n_nodes << " data follows" << std::endl;
///////////////////////////////
// first write the coordinates of all vertices
for (unsigned int i=0; i<spacedim; ++i)
out << node(i) << '\t';
out << std::endl;
- };
+ }
break;
- };
+ }
case 2:
{
for (unsigned int i=0; i<spacedim; ++i)
out << node(i) << '\t';
out << std::endl;
- };
+ }
break;
- };
+ }
case 3:
{
for (unsigned int i=0; i<spacedim; ++i)
out << node(i) << '\t';
out << std::endl;
- };
+ }
break;
- };
+ }
default:
Assert (false, ExcNotImplemented());
- };
- };
- };
+ }
+ }
+ }
/////////////////////////////////////////
// write cells
for (unsigned int i=0; i<n_subdivisions; ++i)
out << first_vertex_of_patch+i << '\t'
<< first_vertex_of_patch+i+1 << std::endl;
- };
+ }
break;
case 2:
if (true)
<< first_vertex_of_patch+(i+1)*(n_subdivisions+1)+j << '\t'
<< first_vertex_of_patch+(i+1)*(n_subdivisions+1)+j+1
<< std::endl;
- };
- };
+ }
+ }
break;
case 3:
if (true)
break;
default:
Assert (false, ExcNotImplemented());
- };
+ }
// finally update the number
break;
default:
Assert (false, ExcNotImplemented());
- };
- };
+ }
+ }
out << std::endl;
- };
+ }
out << "attribute \"element type\" string \"";
if (dim==1) out << "lines";
for (unsigned int data_set=0; data_set<n_data_sets; ++data_set)
out << patch->data(data_set,i) << '\t';
out << std::endl;
- };
+ }
break;
- };
+ }
case 2:
{
for (unsigned int data_set=0; data_set<n_data_sets; ++data_set)
out << patch->data(data_set,i*(n_subdivisions+1) + j) << '\t';
out << std::endl;
- };
+ }
break;
- };
+ }
case 3:
{
(i*(n_subdivisions+1)+j)*(n_subdivisions+1)+k)
<< '\t';
out << std::endl;
- };
+ }
break;
- };
+ }
default:
Assert (false, ExcNotImplemented());
- };
- };
+ }
+ }
out << "attribute \"dep\" string \"positions\"" << std::endl;
} else {
out << "object \"data\" class constantarray type float rank 0 items " << n_nodes << " data follows"
<< time->tm_hour << ":"
<< std::setw(2) << time->tm_min << ":"
<< std::setw(2) << time->tm_sec << '"' << std::endl;
- };
+ }
out << "end" << std::endl;
// assert the stream is still ok
default:
Assert (false, ExcNotImplemented());
- };
+ }
for (unsigned int i=0; i<data_names.size(); ++i)
out << '<'
<< data_names[i]
<< "> ";
out << std::endl;
- };
+ }
// loop over all patches
out << patch->data(data_set,i) << ' ';
out << std::endl;
- };
+ }
// end of patch
out << std::endl
<< std::endl;
break;
- };
+ }
case 2:
{
out << patch->data(data_set,i*(n_subdivisions+1) + j) << ' ';
out << std::endl;
- };
+ }
// end of row in patch
out << std::endl;
- };
+ }
// end of patch
out << std::endl;
break;
- };
+ }
case 3:
{
// end of line
out << std::endl
<< std::endl;
- };
+ }
// line into positive y-direction
// if possible
// end of line
out << std::endl
<< std::endl;
- };
+ }
// line into positive z-direction
// if possible
// end of line
out << std::endl
<< std::endl;
- };
+ }
- };
+ }
break;
- };
+ }
default:
Assert (false, ExcNotImplemented());
- };
- };
+ }
+ }
AssertThrow (out, ExcIO());
}
<< " color White" << std::endl
<< "}" << std::endl;
}
- };
+ }
// max. and min. heigth of solution
double hmin=0, hmax=0;
(patch->vertices[0] * (1-x_frac))) * (1-y_frac) +
((patch->vertices[2] * x_frac) +
(patch->vertices[3] * (1-x_frac))) * y_frac);
- };
- };
+ }
+ }
if (!flags.bicubic_patch)
{ // setting up triangles
patch->data(0,(i-1)*(n_subdivisions+1)+j);
h1(2)=ver[(i+1)*(n_subdivisions+1)+j](1)-
ver[(i-1)*(n_subdivisions+1)+j](1);
- };
+ }
if (j==0)
{
h2(0)=ver[i*(n_subdivisions+1)+j+1](0)-
patch->data(0,i*(n_subdivisions+1)+j-1);
h2(2)=ver[i*(n_subdivisions+1)+j+1](1)-
ver[i*(n_subdivisions+1)+j-1](1);
- };
+ }
nrml[i*(n_subdivisions+1)+j](0)=h1(1)*h2(2)-h1(2)*h2(1);
nrml[i*(n_subdivisions+1)+j](1)=h1(2)*h2(0)-h1(0)*h2(2);
nrml[i*(n_subdivisions+1)+j](2)=h1(0)*h2(1)-h1(1)*h2(0);
<< ver[dl+1](0) << ","
<< patch->data(0,dl+1) << ","
<< ver[dl+1](1) << ">}" << std::endl;
- };
- };
- };
+ }
+ }
+ }
}
else
{ // writing bicubic_patch
out << "\t<" << ver[i](0) << "," << patch->data(0,i) << "," << ver[i](1) << ">";
if (i!=15) out << ",";
out << std::endl;
- };
+ }
out << " texture {Tex}" << std::endl
<< "}" << std::endl;
- };
- };
+ }
+ }
if (!flags.bicubic_patch)
{ // the end of the mesh
((patch->vertices[2] * x_frac) +
(patch->vertices[3] * (1-x_frac))) * y_frac),
- (((patch->vertices[1] * x_frac1) +
- (patch->vertices[0] * (1-x_frac1))) * (1-y_frac) +
- ((patch->vertices[2] * x_frac1) +
- (patch->vertices[3] * (1-x_frac1))) * y_frac),
-
- (((patch->vertices[1] * x_frac1) +
- (patch->vertices[0] * (1-x_frac1))) * (1-y_frac1) +
- ((patch->vertices[2] * x_frac1) +
- (patch->vertices[3] * (1-x_frac1))) * y_frac1),
-
- (((patch->vertices[1] * x_frac) +
- (patch->vertices[0] * (1-x_frac))) * (1-y_frac1) +
- ((patch->vertices[2] * x_frac) +
- (patch->vertices[3] * (1-x_frac))) * y_frac1)
- };
-
+ (((patch->vertices[1] * x_frac1) +
+ (patch->vertices[0] * (1-x_frac1))) * (1-y_frac) +
+ ((patch->vertices[2] * x_frac1) +
+ (patch->vertices[3] * (1-x_frac1))) * y_frac),
+
+ (((patch->vertices[1] * x_frac1) +
+ (patch->vertices[0] * (1-x_frac1))) * (1-y_frac1) +
+ ((patch->vertices[2] * x_frac1) +
+ (patch->vertices[3] * (1-x_frac1))) * y_frac1),
+
+ (((patch->vertices[1] * x_frac) +
+ (patch->vertices[0] * (1-x_frac))) * (1-y_frac1) +
+ ((patch->vertices[2] * x_frac) +
+ (patch->vertices[3] * (1-x_frac))) * y_frac1)
+ };
+
switch (spacedim)
{
case 2:
// ( cz -sz 0 )( 1 0 0 )(x) ( cz*x-sz*(cx*y-sx*z)+0*(sx*y+cx*z) )
// Dxz = ( sz cz 0 )( 0 cx -sx )(y) = ( sz*x+cz*(cx*y-sx*z)+0*(sx*y+cx*z) )
// ( 0 0 1 )( 0 sx cx )(z) ( 0*x+ *(cx*y-sx*z)+1*(sx*y+cx*z) )
- };
+ }
// compute coordinates of
// center of cell
min_color_value : eps_cell.color_value);
max_color_value = (max_color_value > eps_cell.color_value ?
max_color_value : eps_cell.color_value);
- };
- };
+ }
+ }
// finally add this cell
cells.insert (eps_cell);
- };
- };
+ }
+ }
// find out minimum and maximum x and
// y coordinates to compute offsets
x_max = std::max (x_max, cell->vertices[vertex](0));
y_min = std::min (y_min, cell->vertices[vertex](1));
y_max = std::max (y_max, cell->vertices[vertex](1));
- };
+ }
// scale in x-direction such that
// in the output 0 <= x <= 300.
// even for fine grids, but reduces
// the file size significantly
out << std::setprecision (5);
- };
+ }
// check if min and max
// values for the color are
<< (cell->vertices[2]-offset) * scale << " l "
<< (cell->vertices[3]-offset) * scale << " lf"
<< std::endl;
- };
+ }
if (flags.draw_mesh)
out << "0 sg " // draw lines in black
<< (cell->vertices[2]-offset) * scale << " l "
<< (cell->vertices[3]-offset) * scale << " lx"
<< std::endl;
- };
+ }
out << "showpage" << std::endl;
break;
- };
+ }
default:
Assert (false, ExcNotImplemented());
- };
+ }
}
break;
default:
Assert (false, ExcNotImplemented());
- };
+ }
// in gmv format the vertex
(patch->vertices[0](0) * (n_subdivisions-i) / n_subdivisions))
<< ' ';
break;
- };
+ }
case 2:
{
((patch->vertices[2](d-1) * x_frac) +
(patch->vertices[3](d-1) * (1-x_frac))) * y_frac)
<< ' ';
- };
+ }
break;
- };
+ }
case 3:
{
((patch->vertices[6](d-1) * x_frac) +
(patch->vertices[7](d-1) * (1-x_frac))) * y_frac) * z_frac)
<< ' ';
- };
+ }
break;
- };
+ }
default:
Assert (false, ExcNotImplemented());
- };
+ }
}
else
// d>spacedim. write zeros instead
= static_cast<unsigned int>(std::pow (static_cast<double>(n_subdivisions+1), dim));
for (unsigned int i=0; i<n_points; ++i)
out << "0 ";
- };
- };
+ }
+ }
out << std::endl;
- };
+ }
out << std::endl;
<< first_vertex_of_patch+i+1 << ' '
<< first_vertex_of_patch+i+1+1 << std::endl;
break;
- };
+ }
case 2:
{
<< first_vertex_of_patch+i*(n_subdivisions+1)+j+1+1
<< std::endl;
break;
- };
+ }
case 3:
{
<< first_vertex_of_patch+((i+1)*(n_subdivisions+1)+j+1)*(n_subdivisions+1)+k+1+1 << ' '
<< first_vertex_of_patch+(i*(n_subdivisions+1)+j+1 )*(n_subdivisions+1)+k+1+1 << ' '
<< std::endl;
- };
+ }
break;
- };
+ }
default:
Assert (false, ExcNotImplemented());
- };
+ }
// finally update the number
break;
default:
Assert (false, ExcNotImplemented());
- };
- };
+ }
+ }
out << std::endl;
- };
+ }
///////////////////////////////////////
// data output.
std::ostream_iterator<double>(out, " "));
out << std::endl
<< std::endl;
- };
+ }
break;
default:
Assert (false, ExcNotImplemented());
- };
+ }
break;
default:
Assert (false, ExcNotImplemented());
- };
+ }
for (unsigned int data_set=0; data_set<n_data_sets; ++data_set)
- {
- out << ", \"" << data_names[data_set] << "\"";
- };
+ out << ", \"" << data_names[data_set] << "\"";
out << std::endl;
switch (dim)
{
- case 2:
- out << "quadrilateral" << std::endl;
- break;
- case 3:
- out << "brick" << std::endl;
- break;
- default:
- Assert (false, ExcNotImplemented());
- };
+ case 2:
+ out << "quadrilateral" << std::endl;
+ break;
+ case 3:
+ out << "brick" << std::endl;
+ break;
+ default:
+ Assert (false, ExcNotImplemented());
+ }
}
else
- {
- out << "zone f=block, n=" << n_nodes << std::endl;
- };
- };
+ out << "zone f=block, n=" << n_nodes << std::endl;
+ }
// in Tecplot FEBLOCK format the vertex
(patch->vertices[0](0) * (n_subdivisions-i) / n_subdivisions))
<< '\n';
break;
- };
+ }
case 2:
{
((patch->vertices[2](d-1) * x_frac) +
(patch->vertices[3](d-1) * (1-x_frac))) * y_frac)
<< '\n';
- };
+ }
break;
- };
+ }
case 3:
{
((patch->vertices[6](d-1) * x_frac) +
(patch->vertices[7](d-1) * (1-x_frac))) * y_frac) * z_frac)
<< '\n';
- };
+ }
break;
- };
+ }
default:
Assert (false, ExcNotImplemented());
- };
- };
+ }
+ }
out << std::endl;
- };
+ }
///////////////////////////////////////
// then write data.
for (unsigned int data_set=0; data_set<n_data_sets; ++data_set)
{
-
std::copy (data_vectors[data_set].begin(),
data_vectors[data_set].end(),
std::ostream_iterator<double>(out, "\n"));
out << std::endl;
- };
+ }
/////////////////////////////////
case 1:
{
break;
- };
+ }
case 2:
{
for (unsigned int i=0; i<n_subdivisions; ++i)
<< first_vertex_of_patch+(i+1)*(n_subdivisions+1)+j+1+1 << ' '
<< first_vertex_of_patch+i*(n_subdivisions+1)+j+1+1
<< std::endl;
- };
+ }
break;
- };
+ }
case 3:
{
<< first_vertex_of_patch+((i+1)*(n_subdivisions+1)+j+1)*(n_subdivisions+1)+k+1+1 << ' '
<< first_vertex_of_patch+(i*(n_subdivisions+1)+j+1 )*(n_subdivisions+1)+k+1+1 << ' '
<< std::endl;
- };
+ }
break;
- };
+ }
default:
Assert (false, ExcNotImplemented());
- };
+ }
// finally update the number
break;
default:
Assert (false, ExcNotImplemented());
- };
+ }
- };
+ }
// assert the stream is still ok
{
write_tecplot (patches, data_names, flags, out);
return;
- };
+ }
// if the user hasn't specified a
// file name we should call the
" file through the TecplotFlags interface."));
write_tecplot (patches, data_names, flags, out);
return;
- };
+ }
AssertThrow (out, ExcIO());
break;
default:
Assert (false, ExcNotImplemented());
- };
+ }
{
string_size += 1;
string_size += data_names[data_set].size();
- };
+ }
char *tecVarNames = new char[string_size];
break;
default:
Assert(false, ExcNotImplemented());
- };
+ }
switch (dim)
{
default:
Assert(false, ExcNotImplemented());
}
-
for (unsigned int data_set=0; data_set<n_data_sets; ++data_set)
{
tecVarNames = strncat(tecVarNames, " ", 1);
tecVarNames = strncat(tecVarNames, data_names[data_set].c_str(), data_names[data_set].size());
- };
+ }
// in Tecplot FEBLOCK format the vertex
// coordinates and the data have an
// the vertices, so do this on a
// separate thread and when wanting
// to write out the data, we wait
- // for that thread to finish
-
+ // for that thread to finish
Table<2,double> data_vectors (n_data_sets, n_nodes);
void (*fun_ptr) (const std::vector<Patch<dim,spacedim> > &,
///////////////////////////////
// first make up a list of used
// vertices along with their
- // coordinates
-
-
+ // coordinates
for (unsigned int d=1; d<=spacedim; ++d)
{
unsigned int entry=0;
// compute coordinates for
// this patch point
tm.nd((d-1),entry) = static_cast<float>(
- (((patch->vertices[1](d-1) * x_frac) +
- (patch->vertices[0](d-1) * (1-x_frac))) * (1-y_frac) +
- ((patch->vertices[2](d-1) * x_frac) +
- (patch->vertices[3](d-1) * (1-x_frac))) * y_frac)
- );
+ (((patch->vertices[1](d-1) * x_frac) +
+ (patch->vertices[0](d-1) * (1-x_frac))) * (1-y_frac) +
+ ((patch->vertices[2](d-1) * x_frac) +
+ (patch->vertices[3](d-1) * (1-x_frac))) * y_frac)
+ );
entry++;
- };
+ }
break;
- };
+ }
case 3:
{
// compute coordinates for
// this patch point
tm.nd((d-1),entry) = static_cast<float>(
- ((((patch->vertices[1](d-1) * x_frac) +
- (patch->vertices[0](d-1) * (1-x_frac))) * (1-y_frac) +
- ((patch->vertices[2](d-1) * x_frac) +
- (patch->vertices[3](d-1) * (1-x_frac))) * y_frac) * (1-z_frac) +
- (((patch->vertices[5](d-1) * x_frac) +
- (patch->vertices[4](d-1) * (1-x_frac))) * (1-y_frac) +
- ((patch->vertices[6](d-1) * x_frac) +
- (patch->vertices[7](d-1) * (1-x_frac))) * y_frac) * z_frac)
- );
+ ((((patch->vertices[1](d-1) * x_frac) +
+ (patch->vertices[0](d-1) * (1-x_frac))) * (1-y_frac) +
+ ((patch->vertices[2](d-1) * x_frac) +
+ (patch->vertices[3](d-1) * (1-x_frac))) * y_frac) * (1-z_frac) +
+ (((patch->vertices[5](d-1) * x_frac) +
+ (patch->vertices[4](d-1) * (1-x_frac))) * (1-y_frac) +
+ ((patch->vertices[6](d-1) * x_frac) +
+ (patch->vertices[7](d-1) * (1-x_frac))) * y_frac) * z_frac)
+ );
entry++;
- };
+ }
break;
- };
+ }
default:
Assert (false, ExcNotImplemented());
- };
- };
- };
+ }
+ }
+ }
///////////////////////////////////////
/////////////////////////////////
// now for the cells. note that
// vertices are counted from 1 onwards
-
unsigned int first_vertex_of_patch = 0;
unsigned int elem=0;
tm.cd(3,elem) = first_vertex_of_patch+i*(n_subdivisions+1)+j+1+1;
elem++;
- };
+ }
break;
- };
+ }
case 3:
{
tm.cd(7,elem) = first_vertex_of_patch+(i*(n_subdivisions+1)+j+1 )*(n_subdivisions+1)+k+1+1;
elem++;
- };
+ }
break;
- };
+ }
default:
Assert (false, ExcNotImplemented());
- };
+ }
// finally update the number
break;
default:
Assert (false, ExcNotImplemented());
- };
- };
+ }
+ }
{
ierr = TECEND ();
- Assert (ierr == 0, ExcTecplotAPIError());
-
- };
+ Assert (ierr == 0, ExcTecplotAPIError());
+ }
delete [] tecVarNames;
<< std::endl
<< "DATASET UNSTRUCTURED_GRID"
<< std::endl;
- };
+ }
// first count the number of cells
break;
default:
Assert (false, ExcNotImplemented());
- };
+ }
// in gmv format the vertex
(patch->vertices[0](0) * (n_subdivisions-i) / n_subdivisions))
<< " 0 0\n";
break;
- };
+ }
case 2:
{
((patch->vertices[2] * x_frac) +
(patch->vertices[3] * (1-x_frac))) * y_frac)
<< " 0\n";
- };
+ }
break;
- };
+ }
case 3:
{
((patch->vertices[6] * x_frac) +
(patch->vertices[7] * (1-x_frac))) * y_frac) * z_frac)
<< std::endl;
- };
+ }
break;
- };
+ }
default:
Assert (false, ExcNotImplemented());
- };
- };
+ }
+ }
/////////////////////////////////
// now for the cells
<< first_vertex_of_patch+i << ' '
<< first_vertex_of_patch+i+1 << std::endl;
break;
- };
+ }
case 2:
{
<< first_vertex_of_patch+i*(n_subdivisions+1)+j+1
<< std::endl;
break;
- };
+ }
case 3:
{
<< first_vertex_of_patch+((i+1)*(n_subdivisions+1)+j+1)*(n_subdivisions+1)+k+1 << ' '
<< first_vertex_of_patch+(i*(n_subdivisions+1)+j+1 )*(n_subdivisions+1)+k+1 << ' '
<< std::endl;
- };
+ }
break;
- };
+ }
default:
Assert (false, ExcNotImplemented());
- };
+ }
// finally update the number
break;
default:
Assert (false, ExcNotImplemented());
- };
- };
+ }
+ }
// next output the types of the
// cells. since all cells are
break;
default:
Assert (false, ExcNotImplemented());
- };
- };
+ }
+ }
///////////////////////////////////////
// data output.
data_vectors[data_set].end(),
std::ostream_iterator<double>(out, " "));
out << std::endl;
- };
+ }
// assert the stream is still ok
AssertThrow (out, ExcIO());
data_vectors[data_set][next_value] = patch->data(data_set,i);
break;
- };
+ }
case 2:
{
data_vectors[data_set][next_value]
= patch->data(data_set,i*(n_subdivisions+1) + j);
++next_value;
- };
+ }
break;
- };
+ }
case 3:
{
= patch->data(data_set,
(i*(n_subdivisions+1)+j)*(n_subdivisions+1)+k);
++next_value;
- };
+ }
break;
- };
+ }
default:
Assert (false, ExcNotImplemented());
- };
- };
+ }
+ }
for (unsigned int data_set=0; data_set<n_data_sets; ++data_set)
Assert (data_vectors[data_set].size() == next_value,
default:
Assert (false, ExcNotImplemented());
- };
+ }
}