Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gmsh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
0b82c444
Commit
0b82c444
authored
15 years ago
by
Éric Béchet
Browse files
Options
Downloads
Patches
Plain Diff
No commit message
No commit message
parent
91620830
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
contrib/arc/highlevel.h
+16
-11
16 additions, 11 deletions
contrib/arc/highlevel.h
contrib/arc/mainElasticity.cpp
+43
-14
43 additions, 14 deletions
contrib/arc/mainElasticity.cpp
with
59 additions
and
25 deletions
contrib/arc/highlevel.h
+
16
−
11
View file @
0b82c444
...
@@ -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
->
get
Dof
s
(
e
,
Dofsl
);
_spacel
->
get
Key
s
(
e
,
Dofsl
);
_spacer
->
get
Dof
s
(
e
,
Dofsr
);
_spacer
->
get
Key
s
(
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
])
{};
...
...
This diff is collapsed.
Click to expand it.
contrib/arc/mainElasticity.cpp
+
43
−
14
View file @
0b82c444
...
@@ -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
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment