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 @@
#include "SVector3.h"
#include "MElement.h"
#include "MVertex.h"
#include "functionSpace.h"
......@@ -28,6 +29,7 @@ typedef SVector3 Vector;
class Tensor2{};
class Tensor4{};
/*
template<class T> struct TensorialTraits
{
typedef T ValType;
......@@ -44,14 +46,14 @@ template<> struct TensorialTraits<double>
static const int nb_basis_vectors=1; // scalaire
};
/*
template<> struct TensorialTraits<Vector>
{
typedef Vector ValType;
typedef Tensor2 GradType;
typedef Tensor3 HessType;
static const int nb_basis_vectors=3; // trois vecteurs de base linéairement indépendants.
};
// template<> struct TensorialTraits<Vector>
// {
// typedef Vector ValType;
// typedef Tensor2 GradType;
// typedef Tensor3 HessType;
// 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.
......@@ -84,7 +86,7 @@ template<class T> class LagrangeShapeFunction: public Function<T>
/*
class SpaceBase // renvoie des clefs des dofs
{
protected:
......@@ -163,6 +165,9 @@ public:
}
};
*/
template<class T> class Field : public Function<T> // renvoie des valeurs de champ (ff*valeurs dofs), gradient , etc...
{
public:
......@@ -217,8 +222,8 @@ template <class Term,class SpaceL,class SpaceR> class FormBilinear : public Form
void func2(void) { }
void getDofs(MElement *e)
{
_spacel->getDofs(e,Dofsl);
_spacer->getDofs(e,Dofsr);
_spacel->getKeys(e,Dofsl);
_spacer->getKeys(e,Dofsr);
};
void getFuncs(MElement *e,const double uvw[3]) {};
void getGradFuncs(MElement *e,const double uvw[3]) {};
......
......@@ -3,6 +3,8 @@
#include "PView.h"
#include "PViewData.h"
#include "highlevel.h"
#include "groupOfElements.h"
#include <iterator>
int main (int argc, char* argv[])
{
......@@ -11,25 +13,52 @@ int main (int argc, char* argv[])
return -1;
}
MElement *e;
GmshInitialize(argc, argv);
// globals are still present in Gmsh
// instanciate a solver
elasticitySolver mySolver (1000);
// read some input file
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.};
SpaceLagrange<double> L(123);
FormBilinear<TermBilinearMeca,SpaceLagrange<double>,SpaceLagrange<double> > f(L,L);
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,SpaceLagrange<double>,SpaceLagrange<double> > fnl(L,L);
FormBilinear<TermBilinearMecaNL,ScalarLagrangeFunctionSpace,ScalarLagrangeFunctionSpace > fnl(L,L);
fnl.func();
// globals are still present in Gmsh
GmshInitialize(argc, argv);
// instanciate a solver
elasticitySolver mySolver (1000);
// read some input file
mySolver.readInputFile(argv[1]);
// solve the problem
mySolver.solve();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment