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

*** empty log message ***

parent ce2e28a7
No related branches found
No related tags found
No related merge requests found
...@@ -84,7 +84,8 @@ gmshLaplace${OBJEXT}: gmshLaplace.cpp gmshLaplace.h gmshTermOfFormulation.h \ ...@@ -84,7 +84,8 @@ gmshLaplace${OBJEXT}: gmshLaplace.cpp gmshLaplace.h gmshTermOfFormulation.h \
../Geo/SBoundingBox3d.h ../Geo/MElement.h ../Common/GmshDefines.h \ ../Geo/SBoundingBox3d.h ../Geo/MElement.h ../Common/GmshDefines.h \
../Geo/MVertex.h ../Geo/SPoint2.h ../Geo/SPoint3.h ../Geo/MEdge.h \ ../Geo/MVertex.h ../Geo/SPoint2.h ../Geo/SPoint3.h ../Geo/MEdge.h \
../Geo/MVertex.h ../Geo/SVector3.h ../Geo/MFace.h ../Geo/MVertex.h \ ../Geo/MVertex.h ../Geo/SVector3.h ../Geo/MFace.h ../Geo/MVertex.h \
../Geo/SVector3.h ../Numeric/FunctionSpace.h ../Numeric/GmshMatrix.h ../Geo/SVector3.h ../Numeric/FunctionSpace.h ../Numeric/GmshMatrix.h \
Numeric.h NumericEmbedded.h
gmshElasticity${OBJEXT}: gmshElasticity.cpp gmshElasticity.h \ gmshElasticity${OBJEXT}: gmshElasticity.cpp gmshElasticity.h \
gmshTermOfFormulation.h GmshMatrix.h ../Common/GmshMessage.h \ gmshTermOfFormulation.h GmshMatrix.h ../Common/GmshMessage.h \
../Common/Gmsh.h ../Common/GmshMessage.h ../Geo/GModel.h \ ../Common/Gmsh.h ../Common/GmshMessage.h ../Geo/GModel.h \
...@@ -98,7 +99,8 @@ gmshElasticity${OBJEXT}: gmshElasticity.cpp gmshElasticity.h \ ...@@ -98,7 +99,8 @@ gmshElasticity${OBJEXT}: gmshElasticity.cpp gmshElasticity.h \
../Geo/SBoundingBox3d.h ../Geo/MElement.h ../Common/GmshDefines.h \ ../Geo/SBoundingBox3d.h ../Geo/MElement.h ../Common/GmshDefines.h \
../Geo/MVertex.h ../Geo/SPoint2.h ../Geo/SPoint3.h ../Geo/MEdge.h \ ../Geo/MVertex.h ../Geo/SPoint2.h ../Geo/SPoint3.h ../Geo/MEdge.h \
../Geo/MVertex.h ../Geo/SVector3.h ../Geo/MFace.h ../Geo/MVertex.h \ ../Geo/MVertex.h ../Geo/SVector3.h ../Geo/MFace.h ../Geo/MVertex.h \
../Geo/SVector3.h ../Numeric/FunctionSpace.h ../Numeric/GmshMatrix.h ../Geo/SVector3.h ../Numeric/FunctionSpace.h ../Numeric/GmshMatrix.h \
Numeric.h NumericEmbedded.h
EigSolve${OBJEXT}: EigSolve.cpp EigSolve${OBJEXT}: EigSolve.cpp
FunctionSpace${OBJEXT}: FunctionSpace.cpp FunctionSpace.h GmshMatrix.h \ FunctionSpace${OBJEXT}: FunctionSpace.cpp FunctionSpace.h GmshMatrix.h \
../Common/GmshMessage.h ../Common/GmshDefines.h ../Common/GmshMessage.h ../Common/GmshDefines.h
......
...@@ -4,8 +4,7 @@ ...@@ -4,8 +4,7 @@
// bugs and problems to <gmsh@geuz.org>. // bugs and problems to <gmsh@geuz.org>.
#include "gmshElasticity.h" #include "gmshElasticity.h"
#include "Numeric.h"
extern double inv3x3 (double a[3][3], double b[3][3]);
void gmshElasticityTerm::elementMatrix(MElement *e, Double_Matrix & m) const void gmshElasticityTerm::elementMatrix(MElement *e, Double_Matrix & m) const
{ {
...@@ -18,7 +17,7 @@ void gmshElasticityTerm::elementMatrix(MElement *e, Double_Matrix & m) const ...@@ -18,7 +17,7 @@ void gmshElasticityTerm::elementMatrix(MElement *e, Double_Matrix & m) const
double Grads[256][3], grads[100][3]; double Grads[256][3], grads[100][3];
e->getIntegrationPoints(integrationOrder, &npts, &GP); e->getIntegrationPoints(integrationOrder, &npts, &GP);
m.set_all(0.0); m.set_all(0.);
double FACT = _E / (1 + _nu); double FACT = _E / (1 + _nu);
double C11 = FACT * (1 - _nu) / (1 - 2 * _nu); double C11 = FACT * (1 - _nu) / (1 - 2 * _nu);
...@@ -48,12 +47,15 @@ void gmshElasticityTerm::elementMatrix(MElement *e, Double_Matrix & m) const ...@@ -48,12 +47,15 @@ void gmshElasticityTerm::elementMatrix(MElement *e, Double_Matrix & m) const
const double detJ = e->getJacobian(u, v, w, jac); const double detJ = e->getJacobian(u, v, w, jac);
e->getGradShapeFunctions(u, v, w, grads); e->getGradShapeFunctions(u, v, w, grads);
inv3x3(jac, invjac); inv3x3(jac, invjac);
B.set_all(0.0); B.set_all(0.);
BT.set_all(0.0); BT.set_all(0.);
for (int j = 0; j < nbNodes; j++){ for (int j = 0; j < nbNodes; j++){
Grads[j][0] = invjac[0][0] * grads[j][0] + invjac[0][1] * grads[j][1] + invjac[0][2] * grads[j][2]; Grads[j][0] = invjac[0][0] * grads[j][0] + invjac[0][1] * grads[j][1] +
Grads[j][1] = invjac[1][0] * grads[j][0] + invjac[1][1] * grads[j][1] + invjac[1][2] * grads[j][2]; invjac[0][2] * grads[j][2];
Grads[j][2] = invjac[2][0] * grads[j][0] + invjac[2][1] * grads[j][1] + invjac[2][2] * grads[j][2]; Grads[j][1] = invjac[1][0] * grads[j][0] + invjac[1][1] * grads[j][1] +
invjac[1][2] * grads[j][2];
Grads[j][2] = invjac[2][0] * grads[j][0] + invjac[2][1] * grads[j][1] +
invjac[2][2] * grads[j][2];
BT(j, 0) = B(0, j) = Grads[j][0]; BT(j, 0) = B(0, j) = Grads[j][0];
BT(j, 3) = B(3, j) = Grads[j][1]; BT(j, 3) = B(3, j) = Grads[j][1];
...@@ -67,8 +69,8 @@ void gmshElasticityTerm::elementMatrix(MElement *e, Double_Matrix & m) const ...@@ -67,8 +69,8 @@ void gmshElasticityTerm::elementMatrix(MElement *e, Double_Matrix & m) const
BT(j + 2 * nbNodes, 4) = B(4, j + 2 * nbNodes) = Grads[j][0]; BT(j + 2 * nbNodes, 4) = B(4, j + 2 * nbNodes) = Grads[j][0];
BT(j + 2 * nbNodes, 5) = B(5, j + 2 * nbNodes) = Grads[j][1]; BT(j + 2 * nbNodes, 5) = B(5, j + 2 * nbNodes) = Grads[j][1];
} }
BTH.set_all(0.0); BTH.set_all(0.);
BTH.blas_dgemm(BT, H); BTH.blas_dgemm(BT, H);
m.blas_dgemm(BTH, B, weight * detJ, 1.0); m.blas_dgemm(BTH, B, weight * detJ, 1.);
} }
} }
...@@ -4,8 +4,7 @@ ...@@ -4,8 +4,7 @@
// bugs and problems to <gmsh@geuz.org>. // bugs and problems to <gmsh@geuz.org>.
#include "gmshLaplace.h" #include "gmshLaplace.h"
#include "Numeric.h"
extern double inv3x3 (double a[3][3], double b[3][3]);
void gmshLaplaceTerm::elementMatrix(MElement *e, Double_Matrix & m) const void gmshLaplaceTerm::elementMatrix(MElement *e, Double_Matrix & m) const
{ {
...@@ -18,7 +17,7 @@ void gmshLaplaceTerm::elementMatrix(MElement *e, Double_Matrix & m) const ...@@ -18,7 +17,7 @@ void gmshLaplaceTerm::elementMatrix(MElement *e, Double_Matrix & m) const
double Grads[256][3], grads[256][3]; double Grads[256][3], grads[256][3];
e->getIntegrationPoints(integrationOrder, &npts, &GP); e->getIntegrationPoints(integrationOrder, &npts, &GP);
m.set_all(0.0); m.set_all(0.);
for (int i = 0; i < npts; i++){ for (int i = 0; i < npts; i++){
const double u = GP[i].pt[0]; const double u = GP[i].pt[0];
...@@ -31,9 +30,12 @@ void gmshLaplaceTerm::elementMatrix(MElement *e, Double_Matrix & m) const ...@@ -31,9 +30,12 @@ void gmshLaplaceTerm::elementMatrix(MElement *e, Double_Matrix & m) const
inv3x3(jac, invjac) ; inv3x3(jac, invjac) ;
e->getGradShapeFunctions(u, v, w, grads); e->getGradShapeFunctions(u, v, w, grads);
for (int j = 0; j < nbNodes; j++){ for (int j = 0; j < nbNodes; j++){
Grads[j][0] = invjac[0][0] * grads[j][0] + invjac[0][1] * grads[j][1] + invjac[0][2] * grads[j][2]; Grads[j][0] = invjac[0][0] * grads[j][0] + invjac[0][1] * grads[j][1] +
Grads[j][1] = invjac[1][0] * grads[j][0] + invjac[1][1] * grads[j][1] + invjac[1][2] * grads[j][2]; invjac[0][2] * grads[j][2];
Grads[j][2] = invjac[2][0] * grads[j][0] + invjac[2][1] * grads[j][1] + invjac[2][2] * grads[j][2]; Grads[j][1] = invjac[1][0] * grads[j][0] + invjac[1][1] * grads[j][1] +
invjac[1][2] * grads[j][2];
Grads[j][2] = invjac[2][0] * grads[j][0] + invjac[2][1] * grads[j][1] +
invjac[2][2] * grads[j][2];
} }
for (int j = 0; j < nbNodes; j++){ for (int j = 0; j < nbNodes; j++){
for (int k = 0; k <= j; k++){ for (int k = 0; k <= j; k++){
...@@ -47,6 +49,4 @@ void gmshLaplaceTerm::elementMatrix(MElement *e, Double_Matrix & m) const ...@@ -47,6 +49,4 @@ void gmshLaplaceTerm::elementMatrix(MElement *e, Double_Matrix & m) const
for (int j = 0; j < nbNodes; j++) for (int j = 0; j < nbNodes; j++)
for (int k = 0; k < j; k++) for (int k = 0; k < j; k++)
m(k, j) = m(j, k); m(k, j) = m(j, k);
} }
...@@ -32,5 +32,4 @@ class gmshLaplaceTerm : public gmshNodalFemTerm { ...@@ -32,5 +32,4 @@ class gmshLaplaceTerm : public gmshNodalFemTerm {
virtual void elementMatrix(MElement *e, Double_Matrix &m) const; virtual void elementMatrix(MElement *e, Double_Matrix &m) const;
}; };
#endif #endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment