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
bef6168a
Commit
bef6168a
authored
13 years ago
by
Elias Pipping
Committed by
Elias Pipping
13 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Play around with the StVKA
parent
4f9f1cf6
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
src/Makefile.am
+5
-2
5 additions, 2 deletions
src/Makefile.am
src/one-body-sample.cc
+63
-0
63 additions, 0 deletions
src/one-body-sample.cc
with
68 additions
and
2 deletions
src/Makefile.am
+
5
−
2
View file @
bef6168a
SUBDIRS
=
SUBDIRS
=
check_PROGRAMS
=
\
check_PROGRAMS
=
\
...
@@ -6,7 +5,11 @@ check_PROGRAMS = \
...
@@ -6,7 +5,11 @@ check_PROGRAMS = \
test-gradient-method
test-gradient-method
bin_PROGRAMS
=
\
bin_PROGRAMS
=
\
gauss-seidel-sample
gauss-seidel-sample
\
one-body-sample
one_body_sample_SOURCES
=
\
one-body-sample.cc
gauss_seidel_sample_SOURCES
=
\
gauss_seidel_sample_SOURCES
=
\
gauss-seidel-sample.cc gaussseidel.hh
gauss-seidel-sample.cc gaussseidel.hh
...
...
This diff is collapsed.
Click to expand it.
src/one-body-sample.cc
0 → 100644
+
63
−
0
View file @
bef6168a
/* -*- mode:c++; mode:semantic -*- */
#ifdef HAVE_CONFIG_H
#include
"config.h"
#endif
#include
<dune/common/exceptions.hh>
#include
<dune/common/fmatrix.hh>
#include
<dune/istl/bcrsmatrix.hh>
#include
<dune/grid/yaspgrid.hh>
#include
<dune/fufem/functionspacebases/p1nodalbasis.hh>
#include
<dune/fufem/assemblers/operatorassembler.hh>
#include
<dune/fufem/assemblers/localassemblers/stvenantkirchhoffassembler.hh>
#include
<exception>
int
const
dim
=
2
;
int
main
()
{
try
{
typedef
Dune
::
BCRSMatrix
<
Dune
::
FieldMatrix
<
double
,
dim
,
dim
>>
OperatorType
;
// FIXME: Random values
double
const
E
=
1e8
;
double
const
nu
=
0.3
;
int
const
refinements
=
5
;
typedef
Dune
::
YaspGrid
<
dim
>
GridType
;
Dune
::
FieldVector
<
double
,
dim
>
const
end_points
(
1
);
// nth dimension (zero-indexed) goes from 0 to end_points[n]
Dune
::
FieldVector
<
int
,
dim
>
const
elements
(
2
);
// number of elements in each direction
Dune
::
FieldVector
<
bool
,
dim
>
const
periodic
(
false
);
GridType
grid
(
end_points
,
elements
,
periodic
,
0
);
grid
.
globalRefine
(
refinements
);
typedef
P1NodalBasis
<
GridType
::
LeafGridView
,
double
>
P1Basis
;
P1Basis
const
p1Basis
(
grid
.
leafView
());
OperatorAssembler
<
P1Basis
,
P1Basis
>
const
globalAssembler
(
p1Basis
,
p1Basis
);
StVenantKirchhoffAssembler
<
GridType
,
P1Basis
::
LocalFiniteElement
,
P1Basis
::
LocalFiniteElement
>
const
localStiffness
(
E
,
nu
);
OperatorType
stiffnessMatrix
;
globalAssembler
.
assemble
(
localStiffness
,
stiffnessMatrix
);
return
0
;
}
catch
(
Dune
::
Exception
&
e
)
{
Dune
::
derr
<<
"Dune reported error: "
<<
e
<<
std
::
endl
;
}
catch
(
std
::
exception
&
e
)
{
std
::
cout
<<
"Standard exception: "
<<
e
.
what
()
<<
std
::
endl
;
}
}
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