Skip to content
Snippets Groups Projects
Commit f3e737c4 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

cleanup vonmises (a bit)
parent cc627e5d
No related branches found
No related tags found
No related merge requests found
// $Id: Views.cpp,v 1.95 2003-05-14 13:35:50 stainier Exp $
// $Id: Views.cpp,v 1.96 2003-05-14 14:23:10 geuzaine Exp $
//
// Copyright (C) 1997-2003 C. Geuzaine, J.-F. Remacle
//
......@@ -157,10 +157,6 @@ Post_View *BeginView(int allocate)
return v;
}
// utility function
double ComputeVonMises(double*); // prototype
double ComputeVonMises(double *V) {
static const double THIRD = 1.e0 / 3.e0;
double tr = (V[0] + V[4] + V[8]) * THIRD;
......
......@@ -159,4 +159,6 @@ Post_View *Create2DGraph(char *xname, char *yname, int nbdata, double *x, double
GmshColorTable *Get_ColorTable(int num);
void Print_ColorTable(int num, char *prefix, FILE *file);
double ComputeVonMises(double* val);
#endif
// $Id: PostElement.cpp,v 1.15 2003-05-14 13:35:50 stainier Exp $
// $Id: PostElement.cpp,v 1.16 2003-05-14 14:23:10 geuzaine Exp $
//
// Copyright (C) 1997-2003 C. Geuzaine, J.-F. Remacle
//
......@@ -1009,8 +1009,6 @@ void Draw_VectorPyramid(ARGS)
// Tensor Elements
extern double ComputeVonMises(double*);
void Draw_TensorElement(int type, Post_View * View,
double ValMin, double ValMax, double Raise[3][8],
double *X, double *Y, double *Z, double *V)
......@@ -1044,15 +1042,16 @@ void Draw_TensorElement(int type, Post_View * View,
break;
}
/// by lack of any current better solution,
/// tensors are displayed as their Von Mises
/// invariant (J2 invariant)
/// this will simply call the scalar function
if(View->TensorType == DRAW_POST_VONMISES) {
/// By lack of any current better solution, tensors are displayed as
/// their Von Mises invariant (J2 invariant); this will simply call
/// the scalar function...
// View->TensorType == DRAW_POST_VONMISES
double V_VonMises[8];
for(int i = 0; i < nbnod; i++)
for(int i = 0; i < nbnod; i++){
V_VonMises[i] = ComputeVonMises(V + 9*i);
}
switch (type) {
case POINT:
......@@ -1062,20 +1061,16 @@ void Draw_TensorElement(int type, Post_View * View,
Draw_ScalarLine(View, 0, ValMin, ValMax, Raise, X, Y, Z, V_VonMises);
break;
case TRIANGLE:
Draw_ScalarTriangle(View, 0, ValMin, ValMax, Raise, X, Y, Z,
V_VonMises);
Draw_ScalarTriangle(View, 0, ValMin, ValMax, Raise, X, Y, Z, V_VonMises);
break;
case QUADRANGLE:
Draw_ScalarQuadrangle(View, 0, ValMin, ValMax, Raise, X, Y, Z,
V_VonMises);
Draw_ScalarQuadrangle(View, 0, ValMin, ValMax, Raise, X, Y, Z, V_VonMises);
break;
case TETRAHEDRON:
Draw_ScalarTetrahedron(View, 0, ValMin, ValMax, Raise, X, Y, Z,
V_VonMises);
Draw_ScalarTetrahedron(View, 0, ValMin, ValMax, Raise, X, Y, Z, V_VonMises);
break;
case HEXAHEDRON:
Draw_ScalarHexahedron(View, 0, ValMin, ValMax, Raise, X, Y, Z,
V_VonMises);
Draw_ScalarHexahedron(View, 0, ValMin, ValMax, Raise, X, Y, Z, V_VonMises);
break;
case PRISM:
Draw_ScalarPrism(View, 0, ValMin, ValMax, Raise, X, Y, Z, V_VonMises);
......@@ -1084,16 +1079,7 @@ void Draw_TensorElement(int type, Post_View * View,
Draw_ScalarPyramid(View, 0, ValMin, ValMax, Raise, X, Y, Z, V_VonMises);
break;
}
}
else {
static int error = 0;
if(!error) {
error = 1;
Msg(GERROR, "Tensor field visualization is not implemented");
Msg(GERROR, "We *need* some ideas on how to implement this!");
Msg(GERROR, "Send your ideas to <gmsh@geuz.org>!");
}
}
}
#define ARGS Post_View *View, \
......@@ -1139,3 +1125,6 @@ void Draw_TensorPyramid(ARGS)
{
Draw_TensorElement(PYRAMID, View, ValMin, ValMax, Raise, X, Y, Z, V);
}
#undef ARGS
$Id: VERSIONS,v 1.142 2003-04-21 01:32:54 geuzaine Exp $
$Id: VERSIONS,v 1.143 2003-05-14 14:23:10 geuzaine Exp $
New in 1.45: small bug fixes (min/max computation for tensor views,
physical points in read mesh, etc.); documentation updates;
New in 1.44: new reference manual; added support for PNG output; fixed
small configure script bugs;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment