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
d4a23e7e
Commit
d4a23e7e
authored
15 years ago
by
Éric Béchet
Browse files
Options
Downloads
Patches
Plain Diff
modified mainElasticity
parent
e546b03d
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
contrib/arc/conge.dat
+1
-1
1 addition, 1 deletion
contrib/arc/conge.dat
contrib/arc/conge3D.dat
+1
-1
1 addition, 1 deletion
contrib/arc/conge3D.dat
contrib/arc/highlevel.h
+2
-2
2 additions, 2 deletions
contrib/arc/highlevel.h
contrib/arc/mainElasticity.cpp
+49
-20
49 additions, 20 deletions
contrib/arc/mainElasticity.cpp
with
53 additions
and
24 deletions
contrib/arc/conge.dat
+
1
−
1
View file @
d4a23e7e
...
@@ -4,4 +4,4 @@ EdgeDisplacement 8 0 0
...
@@ -4,4 +4,4 @@ EdgeDisplacement 8 0 0
EdgeDisplacement 8 1 0
EdgeDisplacement 8 1 0
EdgeDisplacement 8 2 0
EdgeDisplacement 8 2 0
LineForce 9 100e6 0 0
LineForce 9 100e6 0 0
Volum
eForce 7 0 -1
00.e-3
0
Fac
eForce 7 0 -1
.0e10
0
This diff is collapsed.
Click to expand it.
contrib/arc/conge3D.dat
+
1
−
1
View file @
d4a23e7e
...
@@ -4,4 +4,4 @@ FaceDisplacement 8 0 0
...
@@ -4,4 +4,4 @@ FaceDisplacement 8 0 0
FaceDisplacement 8 1 0
FaceDisplacement 8 1 0
FaceDisplacement 8 2 0
FaceDisplacement 8 2 0
FaceForce 9 100e6 0 0
FaceForce 9 100e6 0 0
VolumeForce 7 0 -1
00.e-3
0
VolumeForce 7 0 -1
.0e10
0
This diff is collapsed.
Click to expand it.
contrib/arc/highlevel.h
+
2
−
2
View file @
d4a23e7e
...
@@ -167,14 +167,14 @@ public:
...
@@ -167,14 +167,14 @@ 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:
Field(){};
Field(){};
virtual ~Field(){};
virtual ~Field(){};
};
};
*/
class
FormBilinearBase
class
FormBilinearBase
...
...
This diff is collapsed.
Click to expand it.
contrib/arc/mainElasticity.cpp
+
49
−
20
View file @
d4a23e7e
...
@@ -16,14 +16,28 @@ int main (int argc, char* argv[])
...
@@ -16,14 +16,28 @@ int main (int argc, char* argv[])
GmshInitialize
(
argc
,
argv
);
GmshInitialize
(
argc
,
argv
);
// globals are still present in Gmsh
// globals are still present in Gmsh
// instanciate a solver
// instanciate a solver
elasticitySolver
mySolver
(
1000
);
My
elasticitySolver
mySolver
(
1000
);
//elasticitySolver mySolver (1000);
// read some input file
// read some input file
mySolver
.
readInputFile
(
argv
[
1
]);
mySolver
.
readInputFile
(
argv
[
1
]);
// solve the problem
mySolver
.
solve
();
PView
*
pv
=
mySolver
.
buildDisplacementView
(
"displacement"
);
pv
->
getData
()
->
writeMSH
(
"disp.msh"
,
false
);
delete
pv
;
// stop gmsh
GmshFinalize
();
}
/*
groupOfElements *g = new groupOfElements (2, 7);
groupOfElements *g = new groupOfElements (2, 7);
MElement *e=*(g->begin());
MElement *e=*(g->begin());
...
@@ -31,21 +45,46 @@ int main (int argc, char* argv[])
...
@@ -31,21 +45,46 @@ int main (int argc, char* argv[])
const double uvw[3]={0.,0.,0.};
const double uvw[3]={0.,0.,0.};
std::vector<Dof> dofs;
std::vector<Dof> dofs;
std::vector<double> vals;
std::vector<double> vals;
std::vector<SVector3> grads;
std::vector<SVector3> vals2;
std::vector<STensor3> grads2;
std::ostream_iterator< double > output( std::cout, " " );
std::ostream_iterator< double > output( std::cout, " " );
ScalarLagrangeFunctionSpace L(100);
ScalarLagrangeFunctionSpace L(100);
std::cout << L.getNumKeys(e) << "fonctions de formes L" << std::endl;
std::cout << L.getNumKeys(e) << "fonctions de formes L" << std::endl;
L.getKeys(e,dofs);
for (int i=0;i<dofs.size();++i) std::cout << "entity: " << dofs[i].getEntity() << " id: " << dofs[i].getType() << std::endl;
dofs.clear();
L.f(e,0.1,0.1,0,vals);
L.f(e,0.1,0.1,0,vals);
std
::
copy
(
vals
.
begin
(),
vals
.
end
(),
output
);
L.gradf(e,0.1,0.1,0,grads);
std::copy(vals.begin(),vals.end(),output); std::cout << std::endl;
for (std::vector<SVector3>::iterator it=grads.begin();it!=grads.end();++it) { std::cout << (*it)[0]<< " " << (*it)[1] <<" " << (*it)[2] << std::endl; }
VectorLagrangeFunctionSpace
L1
(
101
,
VectorLagrangeFunctionSpace
::
VECTOR_X
);
VectorLagrangeFunctionSpace L1(100,VectorLagrangeFunctionSpace::VECTOR_X);
std
::
cout
<<
L1
.
getNumKeys
(
e
)
<<
"fonctions de formes L1"
<<
std
::
endl
;
VectorLagrangeFunctionSpace L2(100,VectorLagrangeFunctionSpace::VECTOR_Y);
VectorLagrangeFunctionSpace
L2
(
102
,
VectorLagrangeFunctionSpace
::
VECTOR_Y
);
std::cout << L2.getNumKeys(e) << "fonctions de formes L2" << std::endl;
VectorLagrangeFunctionSpace
L3
(
103
,
VectorLagrangeFunctionSpace
::
VECTOR_Z
);
L2.f(e,0.1,0.1,0,vals2);
L2.gradf(e,0.1,0.1,0,grads2);
for (std::vector<SVector3>::iterator it=vals2.begin();it!=vals2.end();++it) { std::cout << (*it)[0]<< " " << (*it)[1] <<" " << (*it)[2] << std::endl; }
for (std::vector<STensor3>::iterator it=grads2.begin();it!=grads2.end();++it) { (*it).print(""); }
VectorLagrangeFunctionSpace L3(100,VectorLagrangeFunctionSpace::VECTOR_Z);
ProductFunctionSpace
<
VectorLagrangeFunctionSpace
::
ValType
>
P123
(
L1
,
L2
,
L3
);
VectorLagrangeFunctionSpace
P123(100
);
std::cout << P123.getNumKeys(e) << "fonctions de formes P123" << std::endl;
std::cout << P123.getNumKeys(e) << "fonctions de formes P123" << std::endl;
P123.getKeys(e,dofs);
P123.getKeys(e,dofs);
std::cout << dofs.size() << std::endl;
std::cout << dofs.size() << std::endl;
for (int i=0;i<dofs.size();++i) std::cout << "entity: " << dofs[i].getEntity() << " id: " << dofs[i].getType() << std::endl;
vals2.clear();
grads2.clear();
P123.f(e,0.1,0.1,0,vals2);
P123.gradf(e,0.1,0.1,0,grads2);
for (std::vector<SVector3>::iterator it=vals2.begin();it!=vals2.end();++it) { std::cout << (*it)[0]<< " " << (*it)[1] <<" " << (*it)[2] << std::endl; }
for (std::vector<STensor3>::iterator it=grads2.begin();it!=grads2.end();++it) { (*it).print(""); }
FormBilinear<TermBilinearMeca,ScalarLagrangeFunctionSpace,ScalarLagrangeFunctionSpace > f(L,L);
FormBilinear<TermBilinearMeca,ScalarLagrangeFunctionSpace,ScalarLagrangeFunctionSpace > f(L,L);
f.func();
f.func();
...
@@ -55,19 +94,9 @@ int main (int argc, char* argv[])
...
@@ -55,19 +94,9 @@ int main (int argc, char* argv[])
FormBilinear<TermBilinearMecaNL,ScalarLagrangeFunctionSpace,ScalarLagrangeFunctionSpace > fnl(L,L);
FormBilinear<TermBilinearMecaNL,ScalarLagrangeFunctionSpace,ScalarLagrangeFunctionSpace > fnl(L,L);
fnl.func();
fnl.func();
*/
// solve the problem
mySolver
.
solve
();
PView
*
pv
=
mySolver
.
buildDisplacementView
(
"displacement"
);
pv
->
getData
()
->
writeMSH
(
"disp.msh"
,
false
);
delete
pv
;
// stop gmsh
GmshFinalize
();
}
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