Skip to content
Snippets Groups Projects
Commit 0b82c444 authored by Éric Béchet's avatar Éric Béchet
Browse files

No commit message

No commit message
parent 91620830
No related branches found
No related tags found
No related merge requests found
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include "SVector3.h" #include "SVector3.h"
#include "MElement.h" #include "MElement.h"
#include "MVertex.h" #include "MVertex.h"
#include "functionSpace.h"
...@@ -28,6 +29,7 @@ typedef SVector3 Vector; ...@@ -28,6 +29,7 @@ typedef SVector3 Vector;
class Tensor2{}; class Tensor2{};
class Tensor4{}; class Tensor4{};
/*
template<class T> struct TensorialTraits template<class T> struct TensorialTraits
{ {
typedef T ValType; typedef T ValType;
...@@ -44,14 +46,14 @@ template<> struct TensorialTraits<double> ...@@ -44,14 +46,14 @@ template<> struct TensorialTraits<double>
static const int nb_basis_vectors=1; // scalaire static const int nb_basis_vectors=1; // scalaire
}; };
/*
template<> struct TensorialTraits<Vector> // template<> struct TensorialTraits<Vector>
{ // {
typedef Vector ValType; // typedef Vector ValType;
typedef Tensor2 GradType; // typedef Tensor2 GradType;
typedef Tensor3 HessType; // typedef Tensor3 HessType;
static const int nb_basis_vectors=3; // trois vecteurs de base linéairement indépendants. // static const int nb_basis_vectors=3; // trois vecteurs de base linéairement indépendants.
}; // };
*/ */
template<class T> class Function // Fonction au sens EF du terme. template<class T> class Function // Fonction au sens EF du terme.
...@@ -84,7 +86,7 @@ template<class T> class LagrangeShapeFunction: public Function<T> ...@@ -84,7 +86,7 @@ template<class T> class LagrangeShapeFunction: public Function<T>
/*
class SpaceBase // renvoie des clefs des dofs class SpaceBase // renvoie des clefs des dofs
{ {
protected: protected:
...@@ -163,6 +165,9 @@ public: ...@@ -163,6 +165,9 @@ public:
} }
}; };
*/
template<class T> class Field : public Function<T> // renvoie des valeurs de champ (ff*valeurs dofs), gradient , etc... template<class T> class Field : public Function<T> // renvoie des valeurs de champ (ff*valeurs dofs), gradient , etc...
{ {
public: public:
...@@ -217,8 +222,8 @@ template <class Term,class SpaceL,class SpaceR> class FormBilinear : public Form ...@@ -217,8 +222,8 @@ template <class Term,class SpaceL,class SpaceR> class FormBilinear : public Form
void func2(void) { } void func2(void) { }
void getDofs(MElement *e) void getDofs(MElement *e)
{ {
_spacel->getDofs(e,Dofsl); _spacel->getKeys(e,Dofsl);
_spacer->getDofs(e,Dofsr); _spacer->getKeys(e,Dofsr);
}; };
void getFuncs(MElement *e,const double uvw[3]) {}; void getFuncs(MElement *e,const double uvw[3]) {};
void getGradFuncs(MElement *e,const double uvw[3]) {}; void getGradFuncs(MElement *e,const double uvw[3]) {};
......
...@@ -3,34 +3,63 @@ ...@@ -3,34 +3,63 @@
#include "PView.h" #include "PView.h"
#include "PViewData.h" #include "PViewData.h"
#include "highlevel.h" #include "highlevel.h"
#include "groupOfElements.h"
#include <iterator>
int main (int argc, char* argv[]) int main (int argc, char* argv[])
{ {
if (argc != 2){ if (argc != 2){
printf("usage : elasticity input_file_name\n"); printf("usage : elasticity input_file_name\n");
return -1; return -1;
} }
MElement *e;
const double uvw[3]={0.,0.,0.};
SpaceLagrange<double> L(123);
FormBilinear<TermBilinearMeca,SpaceLagrange<double>,SpaceLagrange<double> > f(L,L);
f.func();
f.Accumulate(e,uvw);
FormBilinear<TermBilinearMecaNL,SpaceLagrange<double>,SpaceLagrange<double> > fnl(L,L);
fnl.func();
// globals are still present in Gmsh
GmshInitialize(argc, argv);
GmshInitialize(argc, argv);
// globals are still present in Gmsh
// instanciate a solver // instanciate a solver
elasticitySolver mySolver (1000); elasticitySolver mySolver (1000);
// read some input file // read some input file
mySolver.readInputFile(argv[1]); mySolver.readInputFile(argv[1]);
groupOfElements *g = new groupOfElements (2, 7);
MElement *e=*(g->begin());
std::cout << e->getNumPrimaryVertices() << "vertices" << std::endl;
const double uvw[3]={0.,0.,0.};
std::vector<Dof> dofs;
std::vector<double> vals;
std::ostream_iterator< double > output( std::cout, " " );
ScalarLagrangeFunctionSpace L(100);
std::cout << L.getNumKeys(e) << "fonctions de formes L" << std::endl;
L.f(e,0.1,0.1,0,vals);
std::copy(vals.begin(),vals.end(),output);
VectorLagrangeFunctionSpace L1(101,VectorLagrangeFunctionSpace::VECTOR_X);
std::cout << L1.getNumKeys(e) << "fonctions de formes L1" << std::endl;
VectorLagrangeFunctionSpace L2(102,VectorLagrangeFunctionSpace::VECTOR_Y);
VectorLagrangeFunctionSpace L3(103,VectorLagrangeFunctionSpace::VECTOR_Z);
ProductFunctionSpace<VectorLagrangeFunctionSpace::ValType> P123(L1,L2,L3);
std::cout << P123.getNumKeys(e) << "fonctions de formes P123" << std::endl;
P123.getKeys(e,dofs);
std::cout << dofs.size() << std::endl;
FormBilinear<TermBilinearMeca,ScalarLagrangeFunctionSpace,ScalarLagrangeFunctionSpace > f(L,L);
f.func();
f.Accumulate(e,uvw);
FormBilinear<TermBilinearMecaNL,ScalarLagrangeFunctionSpace,ScalarLagrangeFunctionSpace > fnl(L,L);
fnl.func();
// solve the problem // solve the problem
mySolver.solve(); mySolver.solve();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment