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 // Copyright (C) 1997-2003 C. Geuzaine, J.-F. Remacle
// //
...@@ -157,10 +157,6 @@ Post_View *BeginView(int allocate) ...@@ -157,10 +157,6 @@ Post_View *BeginView(int allocate)
return v; return v;
} }
// utility function
double ComputeVonMises(double*); // prototype
double ComputeVonMises(double *V) { double ComputeVonMises(double *V) {
static const double THIRD = 1.e0 / 3.e0; static const double THIRD = 1.e0 / 3.e0;
double tr = (V[0] + V[4] + V[8]) * THIRD; 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 ...@@ -159,4 +159,6 @@ Post_View *Create2DGraph(char *xname, char *yname, int nbdata, double *x, double
GmshColorTable *Get_ColorTable(int num); GmshColorTable *Get_ColorTable(int num);
void Print_ColorTable(int num, char *prefix, FILE *file); void Print_ColorTable(int num, char *prefix, FILE *file);
double ComputeVonMises(double* val);
#endif #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 // Copyright (C) 1997-2003 C. Geuzaine, J.-F. Remacle
// //
...@@ -1009,8 +1009,6 @@ void Draw_VectorPyramid(ARGS) ...@@ -1009,8 +1009,6 @@ void Draw_VectorPyramid(ARGS)
// Tensor Elements // Tensor Elements
extern double ComputeVonMises(double*);
void Draw_TensorElement(int type, Post_View * View, void Draw_TensorElement(int type, Post_View * View,
double ValMin, double ValMax, double Raise[3][8], double ValMin, double ValMax, double Raise[3][8],
double *X, double *Y, double *Z, double *V) double *X, double *Y, double *Z, double *V)
...@@ -1044,56 +1042,44 @@ void Draw_TensorElement(int type, Post_View * View, ...@@ -1044,56 +1042,44 @@ void Draw_TensorElement(int type, Post_View * View,
break; break;
} }
/// by lack of any current better solution, /// By lack of any current better solution, tensors are displayed as
/// tensors are displayed as their Von Mises /// their Von Mises invariant (J2 invariant); this will simply call
/// invariant (J2 invariant) /// the scalar function...
/// this will simply call the scalar function
if(View->TensorType == DRAW_POST_VONMISES) {
double V_VonMises[8]; // View->TensorType == DRAW_POST_VONMISES
for(int i = 0; i < nbnod; i++)
V_VonMises[i] = ComputeVonMises(V + 9*i);
switch (type) { double V_VonMises[8];
case POINT: for(int i = 0; i < nbnod; i++){
Draw_ScalarPoint(View, 0, ValMin, ValMax, Raise, X, Y, Z, V_VonMises); V_VonMises[i] = ComputeVonMises(V + 9*i);
break;
case LINE:
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);
break;
case QUADRANGLE:
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);
break;
case HEXAHEDRON:
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);
break;
case PYRAMID:
Draw_ScalarPyramid(View, 0, ValMin, ValMax, Raise, X, Y, Z, V_VonMises);
break;
}
} }
else {
static int error = 0; switch (type) {
if(!error) { case POINT:
error = 1; Draw_ScalarPoint(View, 0, ValMin, ValMax, Raise, X, Y, Z, V_VonMises);
Msg(GERROR, "Tensor field visualization is not implemented"); break;
Msg(GERROR, "We *need* some ideas on how to implement this!"); case LINE:
Msg(GERROR, "Send your ideas to <gmsh@geuz.org>!"); 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);
break;
case QUADRANGLE:
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);
break;
case HEXAHEDRON:
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);
break;
case PYRAMID:
Draw_ScalarPyramid(View, 0, ValMin, ValMax, Raise, X, Y, Z, V_VonMises);
break;
} }
} }
#define ARGS Post_View *View, \ #define ARGS Post_View *View, \
...@@ -1139,3 +1125,6 @@ void Draw_TensorPyramid(ARGS) ...@@ -1139,3 +1125,6 @@ void Draw_TensorPyramid(ARGS)
{ {
Draw_TensorElement(PYRAMID, View, ValMin, ValMax, Raise, X, Y, Z, V); 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 New in 1.44: new reference manual; added support for PNG output; fixed
small configure script bugs; 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