Commit 9e5cfd3e authored by Cody Permann's avatar Cody Permann

FORTRAN_CALL macro and namespace

parent 6bec3789
......@@ -34,7 +34,6 @@ include $(MOOSE_DIR)/modules/modules.mk
APPLICATION_DIR := $(CURDIR)
APPLICATION_NAME := moon
APP_REV_HEADER := $(CURDIR)/include/base/MoonRevision.h
BUILD_EXEC := yes
DEP_APPS := $(shell $(FRAMEWORK_DIR)/scripts/find_dep_apps.py $(APPLICATION_NAME))
include $(FRAMEWORK_DIR)/app.mk
......
#ifndef NEKINTERFACE_H
#define NEKINTERFACE_H
#include "Moose.h"
// String length for file paths in Nek5000
#define PATHLEN 132
// Nek Fortran interface
extern "C" {
// CFILES common block
extern struct {
char \
reafle[PATHLEN], \
fldfle[PATHLEN], \
dmpfle[PATHLEN], \
hisfle[PATHLEN], \
schfle[PATHLEN], \
orefle[PATHLEN], \
nrefle[PATHLEN];
} cfiles_;
// DIMN common block
extern struct {
int \
nelv, \
nelt, \
nx1, \
ny1, \
nz1, \
nx2, \
ny2, \
nz2, \
nx3, \
ny3, \
nz3, \
ndim, \
nfield,\
npert, \
nid, \
nxd, \
nyd, \
nzd;
} dimn_;
// DIMN common block
extern struct {
double flux_moose, temp_nek;
} test_passing_;
// subroutine nek_init(intracomm)
void nek_init_(const int&); // Ron likes this better now
void nek_init_step_();
void nek_step_();
void nek_finalize_step_();
namespace Nek5000
{
// Nek Fortran interface
extern "C" {
// CFILES common block
extern struct {
char \
reafle[PATHLEN], \
fldfle[PATHLEN], \
dmpfle[PATHLEN], \
hisfle[PATHLEN], \
schfle[PATHLEN], \
orefle[PATHLEN], \
nrefle[PATHLEN];
} cfiles_;
// DIMN common block
extern struct {
int \
nelv, \
nelt, \
nx1, \
ny1, \
nz1, \
nx2, \
ny2, \
nz2, \
nx3, \
ny3, \
nz3, \
ndim, \
nfield,\
npert, \
nid, \
nxd, \
nyd, \
nzd;
} dimn_;
// DIMN common block
extern struct {
double flux_moose, temp_nek;
} test_passing_;
// subroutine nek_init(intracomm)
void FORTRAN_CALL(nek_init)(const int&); // Ron likes this better now
void FORTRAN_CALL(nek_init_step)();
void FORTRAN_CALL(nek_step)();
void FORTRAN_CALL(nek_finalize_step)();
}
}
#endif /* NEKINTERFACE_H */
......@@ -19,15 +19,15 @@ NekExecutioner::NekExecutioner(const InputParameters & parameters) :
void NekExecutioner::init() {
Transient::init();
nek_init_(_communicator.get());
FORTRAN_CALL(Nek5000::nek_init)(_communicator.get());
}
void NekExecutioner::preStep() {
Transient::preStep();
nek_init_step_();
FORTRAN_CALL(Nek5000::nek_init_step)();
}
void NekExecutioner::postStep() {
Transient::postStep();
nek_finalize_step_();
FORTRAN_CALL(Nek5000::nek_finalize_step)();
}
......@@ -32,7 +32,5 @@ NekTimestepper::computeDT()
void
NekTimestepper::step()
{
nek_step_();
FORTRAN_CALL(Nek5000::nek_step)();
}
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