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
7ce6cd85
Commit
7ce6cd85
authored
12 years ago
by
Elias Pipping
Committed by
Elias Pipping
12 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Allow X-only Dirichlet conditions
parent
1b1c3d67
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
dune/tectonic/myblockproblem.hh
+12
-5
12 additions, 5 deletions
dune/tectonic/myblockproblem.hh
src/timestepping.org
+27
-18
27 additions, 18 deletions
src/timestepping.org
with
39 additions
and
23 deletions
dune/tectonic/myblockproblem.hh
+
12
−
5
View file @
7ce6cd85
...
...
@@ -289,15 +289,22 @@ class MyBlockProblem<MyConvexProblemTypeTEMPLATE>::IterateObject {
LocalVectorType
&
ui
,
int
m
,
typename
Dune
::
BitSetVector
<
block_size
>::
const_reference
ignore
)
{
{
int
ignore_component
=
block_size
;
// Special value that indicates nothing should be ignored
int
ignore_component
=
block_size
;
// Special value that indicates nothing should be ignored
switch
(
ignore
.
count
())
{
case
0
:
// Full problem
break
;
case
1
:
// 1 Dimension is fixed
assert
(
ignore
[
1
]);
// Only the second component is allowed to stay fixed
ignore_component
=
1
;
// Only the X and Y components are allowed to be fixed in this manner
if
(
ignore
[
0
])
{
ignore_component
=
0
;
break
;
}
if
(
ignore
[
1
])
{
ignore_component
=
1
;
break
;
}
assert
(
false
);
break
;
case
block_size
:
// Ignore the whole node
return
;
...
...
This diff is collapsed.
Click to expand it.
src/timestepping.org
+
27
−
18
View file @
7ce6cd85
...
...
@@ -26,6 +26,30 @@
void virtual extractDisplacement(VectorType &) const;
void virtual extractVelocity(VectorType &) const;
#+end_src
#+name: dirichletCondition
#+begin_src c++
for (size_t i=0; i < dirichletNodes.size(); ++i)
switch (dirichletNodes[i].count()) {
case 0:
continue;
case dim:
problem_iterate[i] = 0;
dirichletFunction.evaluate(time, problem_iterate[i][0]);
break;
case 1:
if (dirichletNodes[i][0]) {
dirichletFunction.evaluate(time, problem_iterate[i][0]);
break;
}
if (dirichletNodes[i][1]) {
problem_iterate[i][1] = 0;
break;
}
assert(false);
default:
assert(false);
}
#+end_src
* Abstract TimeSteppingScheme
#+name: TimeSteppingScheme.hh
#+begin_src c++
...
...
@@ -119,12 +143,7 @@
// ud_old makes a good initial iterate; we could use anything, though
problem_iterate = ud_old;
for (size_t i=0; i < dirichletNodes.size(); ++i)
if (dirichletNodes[i].count() == dim) {
problem_iterate[i] = 0;
dirichletFunction.evaluate(time, problem_iterate[i][0]);
} else if (dirichletNodes[i][1])
problem_iterate[i][1] = 0; // Y direction prescribed
<<dirichletCondition>>
}
template <class VectorType, class MatrixType, class FunctionType, int dim>
...
...
@@ -281,12 +300,7 @@
// ud_old makes a good initial iterate; we could use anything, though
problem_iterate = ud_old;
for (size_t i=0; i < dirichletNodes.size(); ++i)
if (dirichletNodes[i].count() == dim) {
problem_iterate[i] = 0;
dirichletFunction.evaluate(time, problem_iterate[i][0]);
} else if (dirichletNodes[i][1])
problem_iterate[i][1] = 0; // Y direction prescribed
<<dirichletCondition>>
}
template <class VectorType, class MatrixType, class FunctionType, int dim>
...
...
@@ -454,12 +468,7 @@
// ud_old makes a good initial iterate; we could use anything, though
problem_iterate = ud_old;
for (size_t i=0; i < dirichletNodes.size(); ++i)
if (dirichletNodes[i].count() == dim) {
problem_iterate[i] = 0;
dirichletFunction.evaluate(time, problem_iterate[i][0]);
} else if (dirichletNodes[i][1])
problem_iterate[i][1] = 0; // Y direction prescribed
<<dirichletCondition>>
}
template <class VectorType, class MatrixType, class FunctionType, int dim>
...
...
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