Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
nek5000
giraffe
Commits
cce1aa35
Commit
cce1aa35
authored
Apr 23, 2018
by
Kevin Dugan
Browse files
Adding executioner and timestepper
parent
b9f0d92f
Changes
7
Hide whitespace changes
Inline
Side-by-side
examples/integration_example/.gitignore
View file @
cce1aa35
SESSION.NAME
integration_example.f
integration_example.sch
examples/integration_example/rod12.run1
0 → 100644
View file @
cce1aa35
File added
include/executioners/NekExecutioner.h
0 → 100644
View file @
cce1aa35
//
// Created by Ron Rahaman on 10/18/16.
//
#ifndef GIRAFFE_NEKEXECUTIONER_H
#define GIRAFFE_NEKEXECUTIONER_H
#include
"Transient.h"
class
NekExecutioner
;
template
<
>
InputParameters
validParams
<
NekExecutioner
>
();
class
NekExecutioner
:
public
Transient
{
public:
/**
* Constructor
*
* @param parameters The parameters object holding data for the class to use.
*/
NekExecutioner
(
const
InputParameters
&
parameters
);
/**
* Initialize the executioner
*/
virtual
void
init
();
/**
* Do whatever is necessary to advance one step.
*/
virtual
void
preStep
();
// virtual void takeStep(Real input_dt = -1.0);
virtual
void
postStep
();
/**
* Whether or not the last solve converged.
*/
// virtual bool lastSolveConverged();
};
#endif //GIRAFFE_NEKEXECUTIONER_H
include/timesteppers/NekTimeStepper.h
0 → 100644
View file @
cce1aa35
//
// Created by Ron Rahaman on 10/18/16.
//
#ifndef GIRAFFE_NEKTIMESTEPPER_H
#define GIRAFFE_NEKTIMESTEPPER_H
#include
"TimeStepper.h"
class
NekTimeStepper
;
template
<
>
InputParameters
validParams
<
NekTimeStepper
>
();
class
NekTimeStepper
:
public
TimeStepper
{
public:
NekTimeStepper
(
const
InputParameters
&
parameters
);
protected:
virtual
Real
computeInitialDT
()
override
;
virtual
Real
computeDT
()
override
;
virtual
void
step
()
override
;
virtual
bool
converged
()
override
;
private:
Real
_dt
;
};
#endif //GIRAFFE_NEKTIMESTEPPER_H
src/base/GiraffeApp.C
View file @
cce1aa35
...
...
@@ -15,6 +15,10 @@
// Transfers
#include
"MultiAppPolynomialToNek.h"
// Executioners
#include
"NekExecutioner.h"
#include
"NekTimeStepper.h"
template
<>
InputParameters
validParams
<
GiraffeApp
>
()
...
...
@@ -58,6 +62,9 @@ GiraffeApp::registerObjects(Factory & factory)
registerUserObject
(
NekSideIntegralVariableUserObject
);
registerTransfer
(
MultiAppPolynomialToNek
);
registerExecutioner
(
NekExecutioner
);
registerTimeStepper
(
NekTimeStepper
);
}
void
...
...
src/executioners/NekExecutioner.C
0 → 100644
View file @
cce1aa35
//
// Created by Ron Rahaman on 10/18/16.
//
#include
"NekExecutioner.h"
#include
"NekInterface.h"
template
<>
InputParameters
validParams
<
NekExecutioner
>
()
{
InputParameters
params
=
validParams
<
Transient
>
();
return
params
;
}
NekExecutioner
::
NekExecutioner
(
const
InputParameters
&
parameters
)
:
Transient
(
parameters
)
{
}
void
NekExecutioner
::
init
()
{
Transient
::
init
();
FORTRAN_CALL
(
Nek5000
::
nek_init
)(
_communicator
.
get
());
}
void
NekExecutioner
::
preStep
()
{
Transient
::
preStep
();
FORTRAN_CALL
(
Nek5000
::
nek_init_step
)();
}
void
NekExecutioner
::
postStep
()
{
Transient
::
postStep
();
FORTRAN_CALL
(
Nek5000
::
nek_finalize_step
)();
}
src/timesteppers/NekTimeStepper.C
0 → 100644
View file @
cce1aa35
//
// Created by Ron Rahaman on 10/18/16.
//
#include
"NekTimeStepper.h"
#include
"NekInterface.h"
template
<>
InputParameters
validParams
<
NekTimeStepper
>
()
{
InputParameters
params
=
validParams
<
TimeStepper
>
();
params
.
addParam
<
Real
>
(
"dt"
,
1
.
0
,
"Size of the time step"
);
return
params
;
}
NekTimeStepper
::
NekTimeStepper
(
const
InputParameters
&
parameters
)
:
TimeStepper
(
parameters
),
_dt
(
getParam
<
Real
>
(
"dt"
))
{
}
Real
NekTimeStepper
::
computeInitialDT
()
{
// TODO: Should report information from Nek
return
_dt
;
}
Real
NekTimeStepper
::
computeDT
()
{
// TODO: Should report information from Nek
return
_dt
;
}
void
NekTimeStepper
::
step
()
{
FORTRAN_CALL
(
Nek5000
::
nek_step
)();
}
bool
NekTimeStepper
::
converged
()
{
// TODO: Should report information from Nek
return
true
;
}
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment