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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hörl, Maximilian
dune-mmdg
Commits
e1f94d76
Commit
e1f94d76
authored
5 years ago
by
Hörl, Maximilian
Browse files
Options
Downloads
Patches
Plain Diff
add quadrature order to problem, change gitignore
parent
d74c68d2
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.gitignore
+1
-0
1 addition, 0 deletions
.gitignore
dune/mmdg/dg.hh
+8
-11
8 additions, 11 deletions
dune/mmdg/dg.hh
dune/mmdg/problems/dgproblem.hh
+8
-1
8 additions, 1 deletion
dune/mmdg/problems/dgproblem.hh
src/dg.cc
+3
-0
3 additions, 0 deletions
src/dg.cc
with
20 additions
and
12 deletions
.gitignore
+
1
−
0
View file @
e1f94d76
build-cmake
build-cmake
.fuse_hidden*
This diff is collapsed.
Click to expand it.
dune/mmdg/dg.hh
+
8
−
11
View file @
e1f94d76
...
@@ -57,9 +57,6 @@ private:
...
@@ -57,9 +57,6 @@ private:
//assemble stiffness matrix A and load vector b
//assemble stiffness matrix A and load vector b
void
assembleSLE
(
const
Scalar
K
,
const
Scalar
mu
)
void
assembleSLE
(
const
Scalar
K
,
const
Scalar
mu
)
{
{
//NOTE:
//const int order = 3; //order of the quadrature rule
//we use the basis
//we use the basis
// phi_elem,0 (x) = indicator(elem);
// phi_elem,0 (x) = indicator(elem);
// phi_elem,i (x) = x[i]*indicator(elem);
// phi_elem,i (x) = x[i]*indicator(elem);
...
@@ -77,29 +74,29 @@ private:
...
@@ -77,29 +74,29 @@ private:
//basis function phi_elem,i
//basis function phi_elem,i
const
int
elemIdxSLE
=
(
dim
+
1
)
*
elemIdx
;
const
int
elemIdxSLE
=
(
dim
+
1
)
*
elemIdx
;
/* //TODO: can be done outside of the loop?
/*
//TODO: can be done outside of the loop?
const Dune::QuadratureRule<double,dim>& rule =
const Dune::QuadratureRule<double,dim>& rule =
Dune::QuadratureRules<double,dim>::rule(geo.type(),order);
Dune::QuadratureRules<double,dim>::rule(geo.type(), problem_.quadratureOrder());
Dune::FieldVector<double, dim+1> update(0.0);
//NOTE: how are quadrature rules in Dune applied correctly?
//NOTE: how are quadrature rules in Dune applied correctly?
for (const auto& ip : rule)
for (const auto& ip : rule)
{
{
const auto qp = ip.position();
const auto
&
qp = ip.position();
//NOTE: is the volume of the element taken into account
//NOTE: is the volume of the element taken into account
//automatically?
//automatically?
const
auto
weight = ip.weight();
const
double
weight = ip.weight();
//quadrature for int_elem q*phi_elem,0 dV
//quadrature for int_elem q*phi_elem,0 dV
b[elemIdxSLE] += weight * q(qp);
b[elemIdxSLE] += weight *
problem_.
q(qp);
//quadrature for int_elem q*phi_elem,i dV
//quadrature for int_elem q*phi_elem,i dV
for (int i = 0; i < dim; i++)
for (int i = 0; i < dim; i++)
{
{
b[elemIdxSLE + i + 1] += weight * qp[i] * q(qp);
b[elemIdxSLE + i + 1] += weight * qp[i] *
problem_.
q(qp);
}
}
}
}
*/
*/
//NOTE: makeshift solution for source term q = -1
//NOTE: makeshift solution for source term q = -1
b
[
elemIdxSLE
]
+=
-
elemVol
;
b
[
elemIdxSLE
]
+=
-
elemVol
;
for
(
int
i
=
0
;
i
<
dim
;
i
++
)
for
(
int
i
=
0
;
i
<
dim
;
i
++
)
...
...
This diff is collapsed.
Click to expand it.
dune/mmdg/problems/dgproblem.hh
+
8
−
1
View file @
e1f94d76
...
@@ -17,7 +17,7 @@ class DGProblem
...
@@ -17,7 +17,7 @@ class DGProblem
}
}
//indicates whether an exact solution is implemented for the problem
//indicates whether an exact solution is implemented for the problem
virtual
bool
hasExactSolution
()
const
virtual
bool
hasExactSolution
()
const
{
{
return
false
;
return
false
;
};
};
...
@@ -33,6 +33,13 @@ class DGProblem
...
@@ -33,6 +33,13 @@ class DGProblem
{
{
return
Scalar
(
0.0
);
return
Scalar
(
0.0
);
}
}
//returns the recommended quadrature order to compute an integral
//over x * q(x)
virtual
int
quadratureOrder
()
const
{
return
1
;
}
};
};
#endif
#endif
This diff is collapsed.
Click to expand it.
src/dg.cc
+
3
−
0
View file @
e1f94d76
...
@@ -23,6 +23,9 @@
...
@@ -23,6 +23,9 @@
#include
<dune/mmdg/problems/dgproblem.hh>
#include
<dune/mmdg/problems/dgproblem.hh>
#include
<dune/mmdg/problems/poisson.hh>
#include
<dune/mmdg/problems/poisson.hh>
//TODO: specify K in problem? exact solution depends on K!
int
main
(
int
argc
,
char
**
argv
)
int
main
(
int
argc
,
char
**
argv
)
{
{
try
try
...
...
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