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 @@
l_tol = 1e-6
dt = 2
end_time = 100
num_steps = 10
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[./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 @@
#include "TimeStepper.h"
class NekTimestepper;
class NekTimeStepper;
template<>
InputParameters validParams<NekTimestepper>();
InputParameters validParams<NekTimeStepper>();
class NekTimestepper : public TimeStepper
class NekTimeStepper : public TimeStepper
{
public:
NekTimestepper(const InputParameters & parameters);
NekTimeStepper(const InputParameters & parameters);
protected:
virtual Real computeInitialDT() override;
virtual Real computeDT() override;
virtual void step() override;
virtual bool converged() override;
};
#endif //MOON_NEKTIMESTEPPER_H
......@@ -71,7 +71,7 @@ void
MoonApp::registerObjects(Factory & factory)
{
registerExecutioner(NekExecutioner);
registerTimeStepper(NekTimestepper);
registerTimeStepper(NekTimeStepper);
}
// External entry point for dynamic syntax association
......
......@@ -2,35 +2,44 @@
// Created by Ron Rahaman on 10/18/16.
//
#include "NekTimestepper.h"
#include "NekTimeStepper.h"
#include "NekInterface.h"
template<>
InputParameters validParams<NekTimestepper>()
InputParameters validParams<NekTimeStepper>()
{
InputParameters params = validParams<TimeStepper>();
return params;
}
NekTimestepper::NekTimestepper(const InputParameters & parameters) :
NekTimeStepper::NekTimeStepper(const InputParameters & parameters) :
TimeStepper(parameters)
{
}
Real
NekTimestepper::computeInitialDT()
NekTimeStepper::computeInitialDT()
{
return 0;
// TODO: Should report information from Nek
return 1;
}
Real
NekTimestepper::computeDT()
NekTimeStepper::computeDT()
{
return 0;
// TODO: Should report information from Nek
return 1;
}
void
NekTimestepper::step()
NekTimeStepper::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