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

bug fixes in new high order element code
parent ade069b7
No related branches found
No related tags found
No related merge requests found
// $Id: Callbacks.cpp,v 1.515 2007-02-26 08:25:37 geuzaine Exp $
// $Id: Callbacks.cpp,v 1.516 2007-02-28 06:58:46 geuzaine Exp $
//
// Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
//
......@@ -29,7 +29,7 @@
#include "GeoStringInterface.h"
#include "findLinks.h"
#include "Generator.h"
#include "SecondOrder.h"
#include "HighOrder.h"
#include "Draw.h"
#include "SelectBuffer.h"
#include "Views.h"
......@@ -3864,9 +3864,9 @@ void mesh_inspect_cb(CALLBACK_ARGS)
void mesh_degree_cb(CALLBACK_ARGS)
{
if((long)data == 2)
Degre2(GMODEL, CTX.mesh.second_order_linear, CTX.mesh.second_order_incomplete);
SetOrderN(GMODEL, 2, CTX.mesh.second_order_linear, CTX.mesh.second_order_incomplete);
else
Degre1(GMODEL);
SetOrder1(GMODEL);
CTX.mesh.changed = ENT_LINE | ENT_SURFACE | ENT_VOLUME;
Draw();
Msg(STATUS2N, " ");
......
# $Id: Makefile,v 1.125 2007-02-27 22:01:25 geuzaine Exp $
# $Id: Makefile,v 1.126 2007-02-28 06:58:46 geuzaine Exp $
#
# Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
#
......@@ -144,7 +144,7 @@ Callbacks.o: Callbacks.cpp ../Common/Gmsh.h ../Common/Message.h \
../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../Geo/SPoint2.h \
../Geo/ExtrudeParams.h ../Common/SmoothData.h ../Numeric/Numeric.h \
../Geo/GeoStringInterface.h ../Geo/Geo.h ../Geo/findLinks.h \
../Mesh/Generator.h ../Mesh/SecondOrder.h ../Geo/GModel.h \
../Mesh/Generator.h ../Mesh/HighOrder.h ../Geo/GModel.h \
../Geo/GVertex.h ../Geo/GEntity.h ../Geo/Range.h ../Geo/SPoint3.h \
../Geo/SBoundingBox3d.h ../Geo/MVertex.h ../Geo/SPoint3.h \
../Geo/GPoint.h ../Geo/SPoint2.h ../Geo/GEdge.h ../Geo/GEntity.h \
......
......@@ -133,29 +133,27 @@ class MFace {
{
SPoint3 p(0., 0., 0.);
int n = getNumVertices();
if (n==3)
{
const double ff[3] = {1.-u-v,u,v};
for(int i = 0; i < n; i++) {
MVertex *v = getVertex(i);
p[0] += v->x() * ff[i];
p[1] += v->y() * ff[i];
p[2] += v->z() * ff[i];
}
}
else if (n==4)
{
const double ff[4] = {(1-u)*(1.-v),
(1-u)*(1.+v),
(1+u)*(1.+v),
(1+u)*(1.-v)};
for(int i = 0; i < n; i++) {
MVertex *v = getVertex(i);
p[0] += v->x() * ff[i] * .25;
p[1] += v->y() * ff[i] * .25;
p[2] += v->z() * ff[i] * .25;
}
if(n == 3){
const double ff[3] = {1. - u - v, u, v};
for(int i = 0; i < n; i++) {
MVertex *v = getVertex(i);
p[0] += v->x() * ff[i];
p[1] += v->y() * ff[i];
p[2] += v->z() * ff[i];
}
}
else if(n == 4){
const double ff[4] = {(1 - u) * (1. - v),
(1 - u) * (1. + v),
(1 + u) * (1. + v),
(1 + u) * (1. - v)};
for(int i = 0; i < n; i++) {
MVertex *v = getVertex(i);
p[0] += v->x() * ff[i] * .25;
p[1] += v->y() * ff[i] * .25;
p[2] += v->z() * ff[i] * .25;
}
}
else throw;
return p;
}
......
# $Id: Makefile,v 1.428 2007-02-26 08:26:35 geuzaine Exp $
# $Id: Makefile,v 1.429 2007-02-28 06:58:46 geuzaine Exp $
#
# Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
#
......@@ -23,7 +23,7 @@ include variables
GMSH_MAJOR_VERSION = 2
GMSH_MINOR_VERSION = 0
GMSH_PATCH_VERSION = 3
GMSH_PATCH_VERSION = 4
GMSH_EXTRA_VERSION = "-cvs"
GMSH_VERSION = ${GMSH_MAJOR_VERSION}.${GMSH_MINOR_VERSION}.${GMSH_PATCH_VERSION}${GMSH_EXTRA_VERSION}
......
// $Id: Generator.cpp,v 1.116 2007-02-27 17:15:47 remacle Exp $
// $Id: Generator.cpp,v 1.117 2007-02-28 06:58:46 geuzaine Exp $
//
// Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
//
......@@ -30,7 +30,7 @@
#include "meshGRegion.h"
#include "BackgroundMesh.h"
#include "BoundaryLayer.h"
#include "SecondOrder.h"
#include "HighOrder.h"
extern Context_T CTX;
extern GModel *GMODEL;
......@@ -280,7 +280,7 @@ void GenerateMesh(int ask)
int old = GMODEL->getMeshStatus(false);
// Change any high order elements back into first order ones
Degre1(GMODEL);
SetOrder1(GMODEL);
// 1D mesh
if(ask == 1 || (ask > 1 && old < 1)) {
......@@ -310,7 +310,8 @@ void GenerateMesh(int ask)
// Create second order elements
if(GMODEL->getMeshStatus() && CTX.mesh.order > 1)
Degre2(GMODEL,CTX.mesh.second_order_linear, CTX.mesh.second_order_incomplete);
SetOrderN(GMODEL, CTX.mesh.order,
CTX.mesh.second_order_linear, CTX.mesh.second_order_incomplete);
Msg(INFO, "%d vertices %d elements", GMODEL->numVertices(), GMODEL->numElements());
......
This diff is collapsed.
#ifndef _SECOND_ORDER_H_
#define _SECOND_ORDER_H_
#ifndef _HIGH_ORDER_H_
#define _HIGH_ORDER_H_
// Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
//
......@@ -22,7 +22,7 @@
#include "GModel.h"
void Degre1(GModel *m);
void Degre2(GModel *m, bool linear=true, bool incomplete=false);
void SetOrder1(GModel *m);
void SetOrderN(GModel *m, int order, bool linear=true, bool incomplete=false);
#endif
# $Id: Makefile,v 1.166 2007-02-27 22:01:25 geuzaine Exp $
# $Id: Makefile,v 1.167 2007-02-28 06:58:46 geuzaine Exp $
#
# Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
#
......@@ -46,7 +46,7 @@ SRC = Generator.cpp \
BackgroundMesh.cpp \
BoundaryLayer.cpp \
BDS.cpp \
SecondOrder.cpp
HighOrder.cpp
OBJ = ${SRC:.cpp=.o}
......@@ -90,7 +90,7 @@ Generator.o: Generator.cpp ../Common/Gmsh.h ../Common/Message.h \
../Geo/Pair.h ../Geo/ExtrudeParams.h ../Geo/GRegion.h ../Geo/GEntity.h \
../Geo/MElement.h ../Geo/ExtrudeParams.h ../Geo/SBoundingBox3d.h \
meshGEdge.h meshGFace.h meshGRegion.h BackgroundMesh.h BoundaryLayer.h \
SecondOrder.h
HighOrder.h
Attractors.o: Attractors.cpp Attractors.h ../Geo/SPoint3.h ../Geo/Geo.h \
../Common/GmshDefines.h ../Geo/gmshSurface.h ../Geo/Pair.h \
../Geo/Range.h ../Geo/SPoint2.h ../Geo/SPoint3.h ../Geo/SVector3.h \
......@@ -333,8 +333,8 @@ BDS.o: BDS.cpp ../Numeric/Numeric.h ../Common/GmshMatrix.h BDS.h \
../Common/Views.h ../Common/ColorTable.h ../Common/VertexArray.h \
../Common/SmoothData.h ../Common/AdaptiveViews.h ../Common/GmshMatrix.h \
../Common/Message.h
SecondOrder.o: SecondOrder.cpp SecondOrder.h ../Geo/GModel.h \
../Geo/GVertex.h ../Geo/GEntity.h ../Geo/Range.h ../Geo/SPoint3.h \
HighOrder.o: HighOrder.cpp HighOrder.h ../Geo/GModel.h ../Geo/GVertex.h \
../Geo/GEntity.h ../Geo/Range.h ../Geo/SPoint3.h \
../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../Common/GmshDefines.h \
../Geo/MVertex.h ../Geo/SPoint3.h ../Geo/GPoint.h ../Geo/SPoint2.h \
../Geo/GEdge.h ../Geo/GEntity.h ../Geo/GVertex.h ../Geo/SVector3.h \
......
......@@ -120,10 +120,10 @@ Linux and Mac OS X. The tutorial and demo files are included in the
archives.
<ul>
<li><a href="/gmsh/bin/Windows/gmsh-2.0.3-Windows.zip">Windows (NT, 2000, XP)</a>
<li><a href="/gmsh/bin/Linux/gmsh-2.0.3-Linux.tgz">Linux (Intel, glibc 2.3)</a>
<li><a href="/gmsh/bin/MacOSX/gmsh-2.0.3-MacOSX.tgz">Mac OS X (Universal, 10.4)</a>
<li><a href="/gmsh/src/gmsh-2.0.3-source.tgz">Source (all platforms)</a>
<li><a href="/gmsh/bin/Windows/gmsh-2.0.4-Windows.zip">Windows (NT, 2000, XP)</a>
<li><a href="/gmsh/bin/Linux/gmsh-2.0.4-Linux.tgz">Linux (Intel, glibc 2.3)</a>
<li><a href="/gmsh/bin/MacOSX/gmsh-2.0.4-MacOSX.tgz">Mac OS X (Universal, 10.4)</a>
<li><a href="/gmsh/src/gmsh-2.0.4-source.tgz">Source (all platforms)</a>
<a href="#build-footnote" name="build-footmark"><sup>2</sup></a>
</ul>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment