Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-gfe
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sander, Oliver
dune-gfe
Commits
71dadb29
Commit
71dadb29
authored
17 years ago
by
Oliver Sander
Committed by
sander@PCPOOL.MI.FU-BERLIN.DE
17 years ago
Browse files
Options
Downloads
Patches
Plain Diff
call lapack++ directly to solve underdetermined linear system
[[Imported from SVN: r1651]]
parent
97ac1b62
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/averageinterface.hh
+32
-5
32 additions, 5 deletions
src/averageinterface.hh
with
32 additions
and
5 deletions
src/averageinterface.hh
+
32
−
5
View file @
71dadb29
...
@@ -7,7 +7,8 @@
...
@@ -7,7 +7,8 @@
#include
"../../contact/src/dgindexset.hh"
#include
"../../contact/src/dgindexset.hh"
#include
"../../common/crossproduct.hh"
#include
"../../common/crossproduct.hh"
#include
"svd.hh"
#include
"svd.hh"
#include
"../linearsolver.hh"
#include
"lapackpp.h"
#undef max
// Given a resultant force and torque (from a rod problem), this method computes the corresponding
// Given a resultant force and torque (from a rod problem), this method computes the corresponding
// Neumann data for a 3d elasticity problem.
// Neumann data for a 3d elasticity problem.
...
@@ -94,6 +95,7 @@ void computeAveragePressure(const Dune::FieldVector<double,GridType::dimension>&
...
@@ -94,6 +95,7 @@ void computeAveragePressure(const Dune::FieldVector<double,GridType::dimension>&
}
}
// Set up matrix
// Set up matrix
#if 0 // DUNE style
Dune::Matrix<Dune::FieldMatrix<double,1,1> > matrix(6, 3*baseSet.size());
Dune::Matrix<Dune::FieldMatrix<double,1,1> > matrix(6, 3*baseSet.size());
matrix = 0;
matrix = 0;
for (int i=0; i<baseSet.size(); i++)
for (int i=0; i<baseSet.size(); i++)
...
@@ -117,16 +119,41 @@ void computeAveragePressure(const Dune::FieldVector<double,GridType::dimension>&
...
@@ -117,16 +119,41 @@ void computeAveragePressure(const Dune::FieldVector<double,GridType::dimension>&
b[i+3] = resultantTorque[i] * segmentArea;
b[i+3] = resultantTorque[i] * segmentArea;
}
}
matrix.solve(u,b);
#else
// LaPack++ style
LaGenMatDouble
matrix
(
6
,
3
*
baseSet
.
size
());
matrix
=
0
;
for
(
int
i
=
0
;
i
<
baseSet
.
size
();
i
++
)
for
(
int
j
=
0
;
j
<
3
;
j
++
)
matrix
(
j
,
i
*
3
+
j
)
=
mu
[
i
];
for
(
int
i
=
0
;
i
<
baseSet
.
size
();
i
++
)
for
(
int
j
=
0
;
j
<
3
;
j
++
)
for
(
int
k
=
0
;
k
<
3
;
k
++
)
matrix
(
3
+
k
,
3
*
i
+
j
)
=
mu_tilde
[
i
][
j
][
k
];
LaVectorDouble
u
(
3
*
baseSet
.
size
());
LaVectorDouble
b
(
6
);
// Scale the resultant force and torque with this segments area percentage.
// That way the resulting pressure gets distributed fairly uniformly.
ctype
segmentArea
=
nIt
.
intersectionGlobal
().
volume
()
/
area
;
for
(
int
i
=
0
;
i
<
3
;
i
++
)
{
b
(
i
)
=
resultantForce
[
i
]
*
segmentArea
;
b
(
i
+
3
)
=
resultantTorque
[
i
]
*
segmentArea
;
}
LaLinearSolve
(
matrix
,
u
,
b
);
#endif
// std::cout << b << std::endl;
// std::cout << b << std::endl;
// std::cout << matrix << std::endl;
// std::cout << matrix << std::endl;
//matrix.solve(u,b);
linearSolver
(
matrix
,
u
,
b
);
//std::cout << u << std::endl;
//std::cout << u << std::endl;
for
(
int
i
=
0
;
i
<
baseSet
.
size
();
i
++
)
for
(
int
i
=
0
;
i
<
baseSet
.
size
();
i
++
)
for
(
int
j
=
0
;
j
<
3
;
j
++
)
for
(
int
j
=
0
;
j
<
3
;
j
++
)
pressure
[
dgIndexSet
(
*
eIt
,
nIt
.
numberInSelf
())
+
i
][
j
]
=
u
[
i
*
3
+
j
]
;
pressure
[
dgIndexSet
(
*
eIt
,
nIt
.
numberInSelf
())
+
i
][
j
]
=
u
(
i
*
3
+
j
)
;
}
}
...
...
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