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
47411592
Commit
47411592
authored
13 years ago
by
Éric Béchet
Browse files
Options
Downloads
Patches
Plain Diff
No commit message
No commit message
parent
be350578
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
Solver/CMakeLists.txt
+3
-3
3 additions, 3 deletions
Solver/CMakeLists.txt
Solver/STensor43.h
+61
-0
61 additions, 0 deletions
Solver/STensor43.h
Solver/elasticitySolver.cpp
+30
-0
30 additions, 0 deletions
Solver/elasticitySolver.cpp
Solver/elasticitySolver.h
+1
-0
1 addition, 0 deletions
Solver/elasticitySolver.h
with
95 additions
and
3 deletions
Solver/CMakeLists.txt
+
3
−
3
View file @
47411592
This diff is collapsed.
Click to expand it.
Solver/STensor43.h
+
61
−
0
View file @
47411592
...
@@ -69,6 +69,67 @@ class STensor43 {
...
@@ -69,6 +69,67 @@ class STensor43 {
return *this;
return *this;
}*/
}*/
void
print
(
const
char
*
)
const
;
void
print
(
const
char
*
)
const
;
STensor43
transpose
(
int
n
,
int
m
)
const
{
STensor43
ithis
;
if
((
n
==
0
&&
m
==
1
)
||
(
n
==
1
&&
m
==
0
))
{
for
(
int
i
=
0
;
i
<
3
;
i
++
)
for
(
int
j
=
0
;
j
<
3
;
j
++
)
for
(
int
k
=
0
;
k
<
3
;
k
++
)
for
(
int
l
=
0
;
l
<
3
;
l
++
)
ithis
(
i
,
j
,
k
,
l
)
=
(
*
this
)(
j
,
i
,
k
,
l
);
return
ithis
;
}
if
((
n
==
0
&&
m
==
2
)
||
(
n
==
2
&&
m
==
0
))
{
for
(
int
i
=
0
;
i
<
3
;
i
++
)
for
(
int
j
=
0
;
j
<
3
;
j
++
)
for
(
int
k
=
0
;
k
<
3
;
k
++
)
for
(
int
l
=
0
;
l
<
3
;
l
++
)
ithis
(
i
,
j
,
k
,
l
)
=
(
*
this
)(
k
,
j
,
i
,
l
);
return
ithis
;
}
if
((
n
==
0
&&
m
==
3
)
||
(
n
==
3
&&
m
==
0
))
{
for
(
int
i
=
0
;
i
<
3
;
i
++
)
for
(
int
j
=
0
;
j
<
3
;
j
++
)
for
(
int
k
=
0
;
k
<
3
;
k
++
)
for
(
int
l
=
0
;
l
<
3
;
l
++
)
ithis
(
i
,
j
,
k
,
l
)
=
(
*
this
)(
l
,
j
,
k
,
i
);
return
ithis
;
}
if
((
n
==
1
&&
m
==
2
)
||
(
n
==
2
&&
m
==
1
))
{
for
(
int
i
=
0
;
i
<
3
;
i
++
)
for
(
int
j
=
0
;
j
<
3
;
j
++
)
for
(
int
k
=
0
;
k
<
3
;
k
++
)
for
(
int
l
=
0
;
l
<
3
;
l
++
)
ithis
(
i
,
j
,
k
,
l
)
=
(
*
this
)(
i
,
k
,
j
,
l
);
return
ithis
;
}
if
((
n
==
1
&&
m
==
3
)
||
(
n
==
3
&&
m
==
1
))
{
for
(
int
i
=
0
;
i
<
3
;
i
++
)
for
(
int
j
=
0
;
j
<
3
;
j
++
)
for
(
int
k
=
0
;
k
<
3
;
k
++
)
for
(
int
l
=
0
;
l
<
3
;
l
++
)
ithis
(
i
,
j
,
k
,
l
)
=
(
*
this
)(
i
,
l
,
k
,
j
);
return
ithis
;
}
if
((
n
==
2
&&
m
==
3
)
||
(
n
==
3
&&
m
==
2
))
{
for
(
int
i
=
0
;
i
<
3
;
i
++
)
for
(
int
j
=
0
;
j
<
3
;
j
++
)
for
(
int
k
=
0
;
k
<
3
;
k
++
)
for
(
int
l
=
0
;
l
<
3
;
l
++
)
ithis
(
i
,
j
,
k
,
l
)
=
(
*
this
)(
i
,
j
,
l
,
k
);
return
ithis
;
}
return
ithis
+=
(
*
this
);
}
};
};
// tensor product
// tensor product
...
...
This diff is collapsed.
Click to expand it.
Solver/elasticitySolver.cpp
+
30
−
0
View file @
47411592
...
@@ -65,6 +65,36 @@ void elasticitySolver::setMesh(const std::string &meshFileName)
...
@@ -65,6 +65,36 @@ void elasticitySolver::setMesh(const std::string &meshFileName)
LagrangeMultiplierSpace
=
new
ScalarLagrangeFunctionSpace
(
_tag
+
1
);
LagrangeMultiplierSpace
=
new
ScalarLagrangeFunctionSpace
(
_tag
+
1
);
}
}
void
elasticitySolver
::
exportKb
()
{
FILE
*
f
=
fopen
(
"K.txt"
,
"w"
);
double
valeur
;
std
::
string
sysname
=
"A"
;
for
(
int
i
=
0
;
i
<
pAssembler
->
sizeOfR
()
;
i
++
)
{
for
(
int
j
=
0
;
j
<
pAssembler
->
sizeOfR
()
;
j
++
)
{
pAssembler
->
getLinearSystem
(
sysname
)
->
getFromMatrix
(
i
,
j
,
valeur
);
fprintf
(
f
,
"%+e "
,
valeur
)
;
}
fprintf
(
f
,
"
\n
"
);
}
fclose
(
f
);
f
=
fopen
(
"b.txt"
,
"w"
);
for
(
int
i
=
0
;
i
<
pAssembler
->
sizeOfR
()
;
i
++
)
{
pAssembler
->
getLinearSystem
(
sysname
)
->
getFromRightHandSide
(
i
,
valeur
);
fprintf
(
f
,
"%+e
\n
"
,
valeur
)
;
}
fclose
(
f
);
}
void
elasticitySolver
::
solve
()
void
elasticitySolver
::
solve
()
{
{
...
...
This diff is collapsed.
Click to expand it.
Solver/elasticitySolver.h
+
1
−
0
View file @
47411592
...
@@ -93,6 +93,7 @@ class elasticitySolver
...
@@ -93,6 +93,7 @@ class elasticitySolver
virtual
void
setMesh
(
const
std
::
string
&
meshFileName
);
virtual
void
setMesh
(
const
std
::
string
&
meshFileName
);
void
solve
();
void
solve
();
void
postSolve
();
void
postSolve
();
void
exportKb
();
void
getSolutionOnElement
(
MElement
*
el
,
fullMatrix
<
double
>
&
sol
);
void
getSolutionOnElement
(
MElement
*
el
,
fullMatrix
<
double
>
&
sol
);
virtual
PView
*
buildDisplacementView
(
const
std
::
string
postFileName
);
virtual
PView
*
buildDisplacementView
(
const
std
::
string
postFileName
);
virtual
PView
*
buildStressesView
(
const
std
::
string
postFileName
);
virtual
PView
*
buildStressesView
(
const
std
::
string
postFileName
);
...
...
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