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

cleanup vonmises (a bit)
parent cc627e5d
Branches
Tags
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,15 +1042,16 @@ void Draw_TensorElement(int type, Post_View * View, ...@@ -1044,15 +1042,16 @@ 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) { // View->TensorType == DRAW_POST_VONMISES
double V_VonMises[8]; 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); V_VonMises[i] = ComputeVonMises(V + 9*i);
}
switch (type) { switch (type) {
case POINT: case POINT:
...@@ -1062,20 +1061,16 @@ void Draw_TensorElement(int type, Post_View * View, ...@@ -1062,20 +1061,16 @@ void Draw_TensorElement(int type, Post_View * View,
Draw_ScalarLine(View, 0, ValMin, ValMax, Raise, X, Y, Z, V_VonMises); Draw_ScalarLine(View, 0, ValMin, ValMax, Raise, X, Y, Z, V_VonMises);
break; break;
case TRIANGLE: case TRIANGLE:
Draw_ScalarTriangle(View, 0, ValMin, ValMax, Raise, X, Y, Z, Draw_ScalarTriangle(View, 0, ValMin, ValMax, Raise, X, Y, Z, V_VonMises);
V_VonMises);
break; break;
case QUADRANGLE: case QUADRANGLE:
Draw_ScalarQuadrangle(View, 0, ValMin, ValMax, Raise, X, Y, Z, Draw_ScalarQuadrangle(View, 0, ValMin, ValMax, Raise, X, Y, Z, V_VonMises);
V_VonMises);
break; break;
case TETRAHEDRON: case TETRAHEDRON:
Draw_ScalarTetrahedron(View, 0, ValMin, ValMax, Raise, X, Y, Z, Draw_ScalarTetrahedron(View, 0, ValMin, ValMax, Raise, X, Y, Z, V_VonMises);
V_VonMises);
break; break;
case HEXAHEDRON: case HEXAHEDRON:
Draw_ScalarHexahedron(View, 0, ValMin, ValMax, Raise, X, Y, Z, Draw_ScalarHexahedron(View, 0, ValMin, ValMax, Raise, X, Y, Z, V_VonMises);
V_VonMises);
break; break;
case PRISM: case PRISM:
Draw_ScalarPrism(View, 0, ValMin, ValMax, Raise, X, Y, Z, V_VonMises); Draw_ScalarPrism(View, 0, ValMin, ValMax, Raise, X, Y, Z, V_VonMises);
...@@ -1084,16 +1079,7 @@ void Draw_TensorElement(int type, Post_View * View, ...@@ -1084,16 +1079,7 @@ void Draw_TensorElement(int type, Post_View * View,
Draw_ScalarPyramid(View, 0, ValMin, ValMax, Raise, X, Y, Z, V_VonMises); Draw_ScalarPyramid(View, 0, ValMin, ValMax, Raise, X, Y, Z, V_VonMises);
break; 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, \ #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