Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-tectonic
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
podlesny
dune-tectonic
Commits
8ab7a52a
Commit
8ab7a52a
authored
10 years ago
by
Elias Pipping
Browse files
Options
Downloads
Patches
Plain Diff
[Cleanup] Print grid info
parent
9724d521
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/sand-wedge.cc
+30
-0
30 additions, 0 deletions
src/sand-wedge.cc
with
30 additions
and
0 deletions
src/sand-wedge.cc
+
30
−
0
View file @
8ab7a52a
...
@@ -44,6 +44,7 @@
...
@@ -44,6 +44,7 @@
#include
<dune/fufem/sharedpointermap.hh>
#include
<dune/fufem/sharedpointermap.hh>
#include
<dune/solvers/norms/energynorm.hh>
#include
<dune/solvers/norms/energynorm.hh>
#include
<dune/solvers/norms/sumnorm.hh>
#include
<dune/solvers/norms/sumnorm.hh>
#include
<dune/solvers/norms/twonorm.hh>
#include
<dune/solvers/solvers/loopsolver.hh>
#include
<dune/solvers/solvers/loopsolver.hh>
#include
<dune/solvers/solvers/solver.hh>
#include
<dune/solvers/solvers/solver.hh>
#include
<dune/tnnmg/nonlinearities/zerononlinearity.hh>
#include
<dune/tnnmg/nonlinearities/zerononlinearity.hh>
...
@@ -81,6 +82,21 @@ void initPython() {
...
@@ -81,6 +82,21 @@ void initPython() {
Python
::
run
(
"sys.path.append('"
datadir
"')"
);
Python
::
run
(
"sys.path.append('"
datadir
"')"
);
}
}
template
<
class
Geometry
>
double
diameter
(
Geometry
const
&
geometry
)
{
auto
const
numCorners
=
geometry
.
corners
();
std
::
vector
<
typename
Geometry
::
GlobalCoordinate
>
corners
(
numCorners
);
for
(
int
i
=
0
;
i
<
numCorners
;
++
i
)
corners
[
i
]
=
geometry
.
corner
(
i
);
TwoNorm
<
typename
Geometry
::
GlobalCoordinate
>
twoNorm
;
double
diameter
=
0.0
;
for
(
int
i
=
0
;
i
<
numCorners
;
++
i
)
for
(
int
j
=
0
;
j
<
i
;
++
j
)
diameter
=
std
::
max
(
diameter
,
twoNorm
.
diff
(
corners
[
i
],
corners
[
j
]));
return
diameter
;
}
int
main
(
int
argc
,
char
*
argv
[])
{
int
main
(
int
argc
,
char
*
argv
[])
{
try
{
try
{
Dune
::
ParameterTree
parset
;
Dune
::
ParameterTree
parset
;
...
@@ -97,10 +113,24 @@ int main(int argc, char *argv[]) {
...
@@ -97,10 +113,24 @@ int main(int argc, char *argv[]) {
auto
const
refinements
=
parset
.
get
<
size_t
>
(
"grid.refinements"
);
auto
const
refinements
=
parset
.
get
<
size_t
>
(
"grid.refinements"
);
grid
->
globalRefine
(
refinements
);
grid
->
globalRefine
(
refinements
);
double
minDiameter
=
std
::
numeric_limits
<
double
>::
infinity
();
double
maxDiameter
=
0.0
;
for
(
auto
it
=
grid
->
template
leafbegin
<
0
>();
it
!=
grid
->
template
leafend
<
0
>();
++
it
)
{
auto
const
geometry
=
it
->
geometry
();
auto
const
diam
=
diameter
(
geometry
);
minDiameter
=
std
::
min
(
minDiameter
,
diam
);
maxDiameter
=
std
::
max
(
maxDiameter
,
diam
);
}
std
::
cout
<<
"min diameter: "
<<
minDiameter
<<
std
::
endl
;
std
::
cout
<<
"max diameter: "
<<
maxDiameter
<<
std
::
endl
;
using
GridView
=
Grid
::
LeafGridView
;
using
GridView
=
Grid
::
LeafGridView
;
GridView
const
leafView
=
grid
->
leafGridView
();
GridView
const
leafView
=
grid
->
leafGridView
();
size_t
const
leafVertexCount
=
leafView
.
size
(
dims
);
size_t
const
leafVertexCount
=
leafView
.
size
(
dims
);
std
::
cout
<<
"Number of DOFs: "
<<
leafVertexCount
<<
std
::
endl
;
auto
myFaces
=
gridConstructor
.
constructFaces
(
leafView
);
auto
myFaces
=
gridConstructor
.
constructFaces
(
leafView
);
// Neumann boundary
// Neumann boundary
...
...
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