Commit a4644e23 authored by Cody Permann's avatar Cody Permann

Fixup NekTimeStepper with additional methods

Also add a new Multiapp coupling example
Finally rename NekTimestepper to NekTimeStepper
parent fb769d1e
...@@ -98,6 +98,7 @@ ...@@ -98,6 +98,7 @@
l_tol = 1e-6 l_tol = 1e-6
dt = 2 dt = 2
end_time = 100 end_time = 100
num_steps = 10
petsc_options_iname = '-pc_type -pc_hypre_type' petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg' petsc_options_value = 'hypre boomeramg'
[./TimeStepper] [./TimeStepper]
......
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
[./u]
[../]
[]
[AuxVariables]
[./aux]
[../]
[]
[Kernels]
[./diff]
type = CoefDiffusion
variable = u
coef = 0.1
[../]
[./time]
type = TimeDerivative
variable = u
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = right
value = 1
[../]
[]
[Executioner]
# Preconditioned JFNK (default)
type = Transient
num_steps = 20
dt = 0.1
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
# picard_max_its = 30
nl_abs_tol = 1e-14
[]
[Outputs]
exodus = true
[]
[MultiApps]
[./sub]
type = TransientMultiApp
app_type = MoonApp
positions = '0 0 0'
input_files = picard_sub.i
[../]
[]
[Transfers]
[./u_to_sub]
type = MultiAppNearestNodeTransfer
direction = to_multiapp
multi_app = sub
source_variable = u
variable = aux
[../]
[./u_from_sub]
type = MultiAppNearestNodeTransfer
direction = from_multiapp
multi_app = sub
source_variable = u
variable = aux
[../]
[]
# Minimal Nek-wrapped MOOSE application.
# MOOSE Requires a mesh and a variable even
# if they are not used.
[Mesh]
type = GeneratedMesh
dim = 1
nx = 1
[]
[Variables]
[./u]
[../]
[]
[AuxVariables]
[./aux]
[../]
[]
[Executioner]
type = NekExecutioner
num_steps = 20
[./TimeStepper]
type = NekTimeStepper
[../]
[]
[Problem]
kernel_coverage_check = false
solve = false
[]
...@@ -7,20 +7,21 @@ ...@@ -7,20 +7,21 @@
#include "TimeStepper.h" #include "TimeStepper.h"
class NekTimestepper; class NekTimeStepper;
template<> template<>
InputParameters validParams<NekTimestepper>(); InputParameters validParams<NekTimeStepper>();
class NekTimestepper : public TimeStepper class NekTimeStepper : public TimeStepper
{ {
public: public:
NekTimestepper(const InputParameters & parameters); NekTimeStepper(const InputParameters & parameters);
protected: protected:
virtual Real computeInitialDT() override; virtual Real computeInitialDT() override;
virtual Real computeDT() override; virtual Real computeDT() override;
virtual void step() override; virtual void step() override;
virtual bool converged() override;
}; };
#endif //MOON_NEKTIMESTEPPER_H #endif //MOON_NEKTIMESTEPPER_H
...@@ -71,7 +71,7 @@ void ...@@ -71,7 +71,7 @@ void
MoonApp::registerObjects(Factory & factory) MoonApp::registerObjects(Factory & factory)
{ {
registerExecutioner(NekExecutioner); registerExecutioner(NekExecutioner);
registerTimeStepper(NekTimestepper); registerTimeStepper(NekTimeStepper);
} }
// External entry point for dynamic syntax association // External entry point for dynamic syntax association
......
...@@ -2,35 +2,44 @@ ...@@ -2,35 +2,44 @@
// Created by Ron Rahaman on 10/18/16. // Created by Ron Rahaman on 10/18/16.
// //
#include "NekTimestepper.h" #include "NekTimeStepper.h"
#include "NekInterface.h" #include "NekInterface.h"
template<> template<>
InputParameters validParams<NekTimestepper>() InputParameters validParams<NekTimeStepper>()
{ {
InputParameters params = validParams<TimeStepper>(); InputParameters params = validParams<TimeStepper>();
return params; return params;
} }
NekTimestepper::NekTimestepper(const InputParameters & parameters) : NekTimeStepper::NekTimeStepper(const InputParameters & parameters) :
TimeStepper(parameters) TimeStepper(parameters)
{ {
} }
Real Real
NekTimestepper::computeInitialDT() NekTimeStepper::computeInitialDT()
{ {
return 0; // TODO: Should report information from Nek
return 1;
} }
Real Real
NekTimestepper::computeDT() NekTimeStepper::computeDT()
{ {
return 0; // TODO: Should report information from Nek
return 1;
} }
void void
NekTimestepper::step() NekTimeStepper::step()
{ {
FORTRAN_CALL(Nek5000::nek_step)(); FORTRAN_CALL(Nek5000::nek_step)();
} }
bool
NekTimeStepper::converged()
{
// TODO: Should report information from Nek
return true;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment