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
3b970505
Commit
3b970505
authored
12 years ago
by
Elias Pipping
Committed by
Elias Pipping
12 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add nextTimeStep() to timeSteppingScheme
parent
41531aee
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/one-body-sample.org
+1
-0
1 addition, 0 deletions
src/one-body-sample.org
src/timestepping.org
+29
-14
29 additions, 14 deletions
src/timestepping.org
with
30 additions
and
14 deletions
src/one-body-sample.org
+
1
−
0
View file @
3b970505
...
...
@@ -428,6 +428,7 @@
double const time = tau * run;
{
stateUpdater->nextTimeStep();
timeSteppingScheme->nextTimeStep();
VectorType ell(finestSize);
assemble_neumann<GridType, GridView, SmallVector, P1Basis>
...
...
This diff is collapsed.
Click to expand it.
src/timestepping.org
+
29
−
14
View file @
3b970505
...
...
@@ -20,6 +20,7 @@
#+end_src
#+name: virtual_function_declaration
#+begin_src c++
void virtual nextTimeStep();
void virtual setup(VectorType const &, double, double, VectorType &,
VectorType &, MatrixType &);
void virtual postProcess(VectorType const &);
...
...
@@ -57,6 +58,7 @@
class TimeSteppingScheme
{
public:
void virtual nextTimeStep() = 0;
void virtual
setup(VectorType const &ell,
double _tau,
...
...
@@ -69,6 +71,7 @@
void virtual extractDisplacement(VectorType &displacement) const = 0;
void virtual extractVelocity(VectorType &velocity) const = 0;
};
#+end_src
* TimeSteppingScheme: Implicit Euler
#+name: ImplicitEuler.hh
...
...
@@ -116,6 +119,14 @@
dirichletFunction(_dirichletFunction)
{}
template <class VectorType, class MatrixType, class FunctionType, int dim>
void ImplicitEuler<VectorType, MatrixType, FunctionType, dim>::
nextTimeStep()
{
ud_old = ud;
u_old = u;
}
template <class VectorType, class MatrixType, class FunctionType, int dim>
void ImplicitEuler<VectorType, MatrixType, FunctionType, dim>::
setup(VectorType const &ell,
...
...
@@ -129,10 +140,6 @@
tau = _tau;
// This function is only called once for every timestep
ud_old = ud;
u_old = u;
problem_rhs = ell;
A.mmv(u_old, problem_rhs);
...
...
@@ -252,6 +259,15 @@
dirichletFunction(_dirichletFunction)
{}
template <class VectorType, class MatrixType, class FunctionType, int dim>
void ImplicitTwoStep<VectorType, MatrixType, FunctionType, dim>::
nextTimeStep()
{
u_old_old = u_old;
ud_old = ud;
u_old = u;
}
template <class VectorType, class MatrixType, class FunctionType, int dim>
void ImplicitTwoStep<VectorType, MatrixType, FunctionType, dim>::
setup(VectorType const &ell,
...
...
@@ -265,11 +281,6 @@
tau = _tau;
// This function is only called once for every timestep
u_old_old = u_old;
ud_old = ud;
u_old = u;
switch (state) {
// Perform an implicit Euler step since we lack information
case NO_SETUP:
...
...
@@ -441,6 +452,15 @@
dirichletFunction(_dirichletFunction)
{}
template <class VectorType, class MatrixType, class FunctionType, int dim>
void Newmark<VectorType, MatrixType, FunctionType, dim>::
nextTimeStep()
{
udd_old = udd;
ud_old = ud;
u_old = u;
}
template <class VectorType, class MatrixType, class FunctionType, int dim>
void Newmark<VectorType, MatrixType, FunctionType, dim>::
setup(VectorType const &ell,
...
...
@@ -454,11 +474,6 @@
tau = _tau;
// This function is only called once for every timestep
udd_old = udd;
ud_old = ud;
u_old = u;
problem_rhs = ell;
B.usmv( 2.0/tau, ud_old, problem_rhs);
B.usmv( 1.0, udd_old, problem_rhs);
...
...
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