Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
dune-mmdg
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
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hörl, Maximilian
dune-mmdg
Commits
f9c8037a
Commit
f9c8037a
authored
Jan 17, 2020
by
Hörl, Maximilian
Browse files
Options
Downloads
Patches
Plain Diff
add A, b, d, dof as member variables
parent
4e8fb584
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
dune/mmdg/dg.hh
+19
-11
19 additions, 11 deletions
dune/mmdg/dg.hh
with
19 additions
and
11 deletions
dune/mmdg/dg.hh
+
19
−
11
View file @
f9c8037a
...
@@ -18,21 +18,23 @@ class DG
...
@@ -18,21 +18,23 @@ class DG
public:
public:
using
Scalar
=
typename
GridView
::
ctype
;
using
Scalar
=
typename
GridView
::
ctype
;
static
constexpr
int
dim
=
GridView
::
dimension
;
static
constexpr
int
dim
=
GridView
::
dimension
;
using
Matrix
=
Dune
::
DynamicMatrix
<
Scalar
>
;
using
Vector
=
Dune
::
DynamicVector
<
Scalar
>
;
//constructor
//constructor
DG
(
const
GridView
&
gridView
,
const
Mapper
&
mapper
,
DG
(
const
GridView
&
gridView
,
const
Mapper
&
mapper
,
const
Problem
&
problem
)
:
const
Problem
&
problem
)
:
gridView_
(
gridView
),
mapper_
(
mapper
),
problem_
(
problem
)
{}
gridView_
(
gridView
),
mapper_
(
mapper
),
problem_
(
problem
),
dof
((
1
+
dim
)
*
gridView
.
size
(
0
))
{
A
=
Matrix
(
dof
,
dof
,
0.0
);
//initialize stiffness matrix
b
=
Vector
(
dof
,
0.0
);
//initialize load vector
d
=
Vector
(
dof
,
0.0
);
//initialize solution vector
}
const
void
operator
()
(
const
Scalar
K
,
const
Scalar
mu
)
const
const
void
operator
()
(
const
Scalar
K
,
const
Scalar
mu
)
{
{
//NOTE: what is an appropriate sparse matrix type? -> BCRS
//NOTE: what is an appropriate sparse matrix type? -> BCRS
const
int
dof
=
(
1
+
dim
)
*
gridView_
.
size
(
0
);
//degrees of freedom
using
Matrix
=
Dune
::
DynamicMatrix
<
Scalar
>
;
using
Vector
=
Dune
::
DynamicVector
<
Scalar
>
;
Matrix
A
(
dof
,
dof
,
0.0
);
//stiffness matrix
Vector
b
(
dof
,
0.0
);
//load vector
Vector
d
(
dof
,
0.0
);
//NOTE:
//NOTE:
// const int order = 3; //order of the quadrature rule
// const int order = 3; //order of the quadrature rule
...
@@ -122,7 +124,7 @@ public:
...
@@ -122,7 +124,7 @@ public:
{
{
std
::
cout
<<
"
\t
"
<<
intersctGeo
.
corner
(
k
);
std
::
cout
<<
"
\t
"
<<
intersctGeo
.
corner
(
k
);
}
}
std
::
cout
<<
"
\n\n
"
;
std
::
cout
<<
"
\t
normal: "
<<
normal
<<
"
\n\n
"
;
//TODO: quadrature rule cannot be used for dim = 1!
//TODO: quadrature rule cannot be used for dim = 1!
// const Dune::QuadratureRule<double,dim-1>& secondOrderRule =
// const Dune::QuadratureRule<double,dim-1>& secondOrderRule =
...
@@ -480,10 +482,16 @@ public:
...
@@ -480,10 +482,16 @@ public:
}
}
const
GridView
&
gridView_
;
const
GridView
&
gridView_
;
const
Mapper
&
mapper_
;
//element mapper for gridView_
const
Mapper
&
mapper_
;
//element mapper for gridView_
const
Problem
&
problem_
;
//the DG problem to be solved
const
Problem
&
problem_
;
//the DG problem to be solved
const
int
dof
;
//degrees of freedom
private
:
Matrix
A
;
//stiffness matrix
Vector
b
;
//load vector
Vector
d
;
//solution vector
};
};
#endif
#endif
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