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

*** empty log message ***

parent 4c9add98
No related branches found
No related tags found
No related merge requests found
...@@ -7,7 +7,7 @@ include variables ...@@ -7,7 +7,7 @@ include variables
GMSH_MAJOR_VERSION = 2 GMSH_MAJOR_VERSION = 2
GMSH_MINOR_VERSION = 2 GMSH_MINOR_VERSION = 2
GMSH_PATCH_VERSION = 5 GMSH_PATCH_VERSION = 6
GMSH_EXTRA_VERSION = GMSH_EXTRA_VERSION =
GMSH_VERSION = ${GMSH_MAJOR_VERSION}.${GMSH_MINOR_VERSION}.${GMSH_PATCH_VERSION}${GMSH_EXTRA_VERSION} GMSH_VERSION = ${GMSH_MAJOR_VERSION}.${GMSH_MINOR_VERSION}.${GMSH_PATCH_VERSION}${GMSH_EXTRA_VERSION}
...@@ -113,7 +113,7 @@ else ...@@ -113,7 +113,7 @@ else
if not exist ${includedir}\gmsh mkdir ${includedir}\gmsh if not exist ${includedir}\gmsh mkdir ${includedir}\gmsh
if not exist ${libdir} mkdir ${libdir} if not exist ${libdir} mkdir ${libdir}
erase /q ${includedir}\gmsh\*.h erase /q ${includedir}\gmsh\*.h
for %%i in (${subst /,\,${GMSH_API}}) do copy %%i ${includedir}\gmsh for %%i in (${subst /,\,${GMSH_API}}) do copy %%i ${includedir}\gmsh
copy /y lib\libGmsh${LIBEXT} ${libdir}\libGmsh${LIBSUFFIX}${LIBEXT} copy /y lib\libGmsh${LIBEXT} ${libdir}\libGmsh${LIBSUFFIX}${LIBEXT}
endif endif
......
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
#include "GmshDefines.h" #include "GmshDefines.h"
#include "GmshMessage.h" #include "GmshMessage.h"
Double_Matrix generate1DMonomials(int order) Double_Matrix generate1DMonomials(int order)
{ {
Double_Matrix monomials(order + 1, 1); Double_Matrix monomials(order + 1, 1);
...@@ -115,14 +114,7 @@ Double_Matrix generatePascalSerendipityTetrahedron(int order) ...@@ -115,14 +114,7 @@ Double_Matrix generatePascalSerendipityTetrahedron(int order)
4 * std::max(0, (order - 2) * (order - 1) / 2); 4 * std::max(0, (order - 2) * (order - 1) / 2);
Double_Matrix monomials(nbMonomials, 3); Double_Matrix monomials(nbMonomials, 3);
// order 0
monomials.set_all(0); monomials.set_all(0);
monomials(0, 0) = 0;
monomials(0, 1) = 0;
monomials(0, 2) = 0;
int index = 1; int index = 1;
for (int p = 1; p < order; p++) { for (int p = 1; p < order; p++) {
for (int i = 0; i < 3; i++) { for (int i = 0; i < 3; i++) {
...@@ -687,13 +679,11 @@ const gmshFunctionSpace &gmshFunctionSpaces::find(int tag) ...@@ -687,13 +679,11 @@ const gmshFunctionSpace &gmshFunctionSpaces::find(int tag)
std::map<std::pair<int,int>, Double_Matrix> gmshFunctionSpaces::injector; std::map<std::pair<int,int>, Double_Matrix> gmshFunctionSpaces::injector;
const Double_Matrix &gmshFunctionSpaces::findInjector(int tag1,int tag2)
const Double_Matrix &gmshFunctionSpaces::findInjector(int tag1,int tag2) { {
std::pair<int,int> key(tag1,tag2); std::pair<int,int> key(tag1,tag2);
std::map<std::pair<int,int>,Double_Matrix>::const_iterator it = injector.find(key); std::map<std::pair<int,int>,Double_Matrix>::const_iterator it = injector.find(key);
if (it != injector.end()) return it->second; if (it != injector.end()) return it->second;
const gmshFunctionSpace& fs1 = find(tag1); const gmshFunctionSpace& fs1 = find(tag1);
const gmshFunctionSpace& fs2 = find(tag2); const gmshFunctionSpace& fs2 = find(tag2);
...@@ -710,5 +700,3 @@ const Double_Matrix &gmshFunctionSpaces::findInjector(int tag1,int tag2) { ...@@ -710,5 +700,3 @@ const Double_Matrix &gmshFunctionSpaces::findInjector(int tag1,int tag2) {
injector.insert(std::make_pair(key,inj)); injector.insert(std::make_pair(key,inj));
return injector[key]; return injector[key];
} }
...@@ -17,166 +17,93 @@ struct gmshFunctionSpace ...@@ -17,166 +17,93 @@ struct gmshFunctionSpace
Double_Matrix points; Double_Matrix points;
Double_Matrix monomials; Double_Matrix monomials;
Double_Matrix coefficients; Double_Matrix coefficients;
inline void evaluateMonomials(double u, double v, double w, double p[]) const
inline void evaluateMonomials(double u,double v,double w,double p[]) const { {
for (int j=0;j<monomials.size1();j++) { for (int j = 0; j < monomials.size1(); j++) {
p[j] = pow(u,(int) monomials(j,0)); p[j] = pow(u, (int)monomials(j, 0));
if (monomials.size2() > 1) p[j] *= pow(v,(int) monomials(j,1)); if (monomials.size2() > 1) p[j] *= pow(v, (int)monomials(j, 1));
if (monomials.size2() > 2) p[j] *= pow(w,(int) monomials(j,2)); if (monomials.size2() > 2) p[j] *= pow(w, (int)monomials(j, 2));
} }
} }
/* inline void evaluateMonomialDerivatives(double u,double v,double w,double p[][3]) const */
/* { */
/* for (int j=0;j<monomials.size1();j++) { */
/* int expU = (int) monomials(j,0); */
/* double uu = pow(u,expU); */
/* p[j][0] = pow(u,expU - 1) * expU; */
/* p[j][1] = 0.; */
/* p[j][2] = 0.; */
/* if (monomials.size2() > 1) { */
/* int expV = (int) monomials(j,1); */
/* double vv = pow(v,expV); */
/* p[j][0] *= vv; */
/* p[j][1] = uu * pow(v,expV-1) * expV; */
/* if (monomials.size2() > 2) { */
/* int expW = (int) monomials(j,2); */
/* double ww = pow(w,expW); */
/* p[j][0] *= ww; */
/* p[j][1] *= ww; */
/* p[j][2] = uu * vv * pow(w,expW-1) * expW; */
/* } */
/* } */
/* } */
/* } */
inline void f(double u, double v, double w, double *sf) const inline void f(double u, double v, double w, double *sf) const
{ {
double p[256]; double p[256];
evaluateMonomials(u,v,w,p); evaluateMonomials(u, v, w, p);
for (int i = 0; i < coefficients.size1(); i++) {
for (int i=0;i<coefficients.size1();i++) {
sf[i] = 0; sf[i] = 0;
for (int j=0;j<coefficients.size2();j++) { for (int j = 0; j < coefficients.size2(); j++) {
sf[i] += coefficients(i,j) * p[j]; sf[i] += coefficients(i, j) * p[j];
} }
} }
} }
inline void df(double u, double v, double w, double grads[][3]) const inline void df(double u, double v, double w, double grads[][3]) const
{ {
switch (monomials.size2()) { switch (monomials.size2()) {
case 1: case 1:
{ for (int i = 0; i < coefficients.size1(); i++){
for (int i = 0; i < coefficients.size1(); i++){ grads[i][0] = 0;
grads[i][0] = 0; grads[i][1] = 0;
grads[i][1] = 0; grads[i][2] = 0;
grads[i][2] = 0; for(int j = 0; j < coefficients.size2(); j++){
for(int j = 0; j < coefficients.size2(); j++){ if ((monomials)(j, 0) > 0)
if ((monomials)(j, 0) > 0) grads[i][0] += (coefficients)(i, j) *
grads[i][0] += (coefficients)(i, j) * pow(u, (monomials)(j, 0) - 1) * (monomials)(j, 0); pow(u, (monomials)(j, 0) - 1) * (monomials)(j, 0);
}
} }
break;
} }
break;
case 2: case 2:
{ for (int i = 0; i < coefficients.size1(); i++){
grads[i][0] = 0;
for (int i = 0; i < coefficients.size1(); i++){ grads[i][1] = 0;
grads[i][0] = 0; grads[i][2] = 0;
grads[i][1] = 0; for(int j = 0; j < coefficients.size2(); j++){
grads[i][2] = 0; if ((monomials)(j, 0) > 0)
for(int j = 0; j < coefficients.size2(); j++){ grads[i][0] += (coefficients)(i, j) *
if ((monomials)(j, 0) > 0) pow(u, (monomials)(j, 0) - 1) * (monomials)(j, 0) *
grads[i][0] += (coefficients)(i, j) * pow(v, (monomials)(j, 1));
pow(u, (monomials)(j, 0) - 1) * (monomials)(j, 0) * if ((monomials)(j, 1) > 0)
pow(v, (monomials)(j, 1)); grads[i][1] += (coefficients)(i, j) *
if ((monomials)(j, 1) > 0) pow(u, (monomials)(j, 0)) *
grads[i][1] += (coefficients)(i, j) * pow(v, (monomials)(j, 1) - 1) * (monomials)(j, 1);
pow(u, (monomials)(j, 0)) *
pow(v, (monomials)(j, 1) - 1) * (monomials)(j, 1);
}
} }
break;
} }
break;
case 3: case 3:
{ for (int i = 0; i < coefficients.size1(); i++){
grads[i][0] = 0;
for (int i = 0; i < coefficients.size1(); i++){ grads[i][1] = 0;
grads[i][0] = 0; grads[i][2] = 0;
grads[i][1] = 0; for(int j = 0; j < coefficients.size2(); j++){
grads[i][2] = 0; if ((monomials)(j, 0) > 0)
for(int j = 0; j < coefficients.size2(); j++){ grads[i][0] += (coefficients)(i, j) *
if ((monomials)(j, 0) > 0) pow(u, (monomials)(j, 0) - 1) * (monomials)(j, 0) *
grads[i][0] += (coefficients)(i, j) * pow(v, (monomials)(j, 1)) *
pow(u, (monomials)(j, 0) - 1) * (monomials)(j, 0) * pow(w, (monomials)(j, 2));
pow(v, (monomials)(j, 1)) * if ((monomials)(j, 1) > 0)
pow(w, (monomials)(j, 2)); grads[i][1] += (coefficients)(i, j) *
if ((monomials)(j, 1) > 0) pow(u, (monomials)(j, 0)) *
grads[i][1] += (coefficients)(i, j) * pow(v, (monomials)(j, 1) - 1) * (monomials)(j, 1) *
pow(u, (monomials)(j, 0)) * pow(w, (monomials)(j, 2));
pow(v, (monomials)(j, 1) - 1) * (monomials)(j, 1) * if ((monomials)(j, 2) > 0)
pow(w, (monomials)(j, 2)); grads[i][2] += (coefficients)(i, j) *
if ((monomials)(j, 2) > 0) pow(u, (monomials)(j, 0)) *
grads[i][2] += (coefficients)(i, j) * pow(v, (monomials)(j, 1)) *
pow(u, (monomials)(j, 0)) * pow(w, (monomials)(j, 2) - 1) * (monomials)(j, 2);
pow(v, (monomials)(j, 1)) *
pow(w, (monomials)(j, 2) - 1) * (monomials)(j, 2);
}
} }
break;
} }
break;
} }
} }
/* inline void df(double u, double v, double w, double grads[][3]) const */
/* { */
/* double p[256][3]; */
/* evaluateMonomialDerivatives(u,v,w,p); */
/* for (int i=0;i<coefficients.size1();i++) { */
/* grads[i][0] = 0.; */
/* grads[i][1] = 0.; */
/* grads[i][2] = 0.; */
/* for (int j=0;j<coefficients.size2();j++) { */
/* grads[i][0] += coefficients(i,j) * p[j][0]; */
/* grads[i][1] += coefficients(i,j) * p[j][1]; */
/* // grads[i][2] += coefficients(i,j) * p[j][2]; */
/* } */
/* } */
/* } */
}; };
class gmshFunctionSpaces class gmshFunctionSpaces
{ {
private:
static std::map<int, gmshFunctionSpace> fs; static std::map<int, gmshFunctionSpace> fs;
static std::map<std::pair<int,int>,Double_Matrix> injector; static std::map<std::pair<int, int>, Double_Matrix> injector;
public : public :
static const gmshFunctionSpace &find(int); static const gmshFunctionSpace &find(int);
static const Double_Matrix &findInjector(int,int); static const Double_Matrix &findInjector(int, int);
}; };
#endif #endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment