-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
67 changed files
with
1,323 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#ifndef __CPUAPP | ||
#define __CPUAPP | ||
|
||
#include <math.h> | ||
#include <omp.h> | ||
|
||
#include "cpuFlux.cpp" | ||
#include "cpuSource.cpp" | ||
#include "cpuSourcew.cpp" | ||
#include "cpuEoS.cpp" | ||
#include "cpuEoSdu.cpp" | ||
#include "cpuEoSdw.cpp" | ||
#include "cpuTdfunc.cpp" | ||
#include "cpuAvfield.cpp" | ||
#include "cpuOutput.cpp" | ||
#include "cpuFbou.cpp" | ||
#include "cpuUbou.cpp" | ||
#include "cpuFhat.cpp" | ||
#include "cpuUhat.cpp" | ||
#include "cpuStab.cpp" | ||
#include "cpuInitu.cpp" | ||
#include "cpuInitq.cpp" | ||
#include "cpuInitudg.cpp" | ||
#include "cpuInitwdg.cpp" | ||
#include "cpuInitodg.cpp" | ||
|
||
#endif | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
template <typename T> void cpuAvfield(T *f, T *xdg, T *udg, T *odg, T *wdg, T *uinf, T *param, T time, int modelnumber, int ng, int nc, int ncu, int nd, int ncx, int nco, int ncw, int nce, int npe, int ne) | ||
{ | ||
} | ||
|
||
template void cpuAvfield(double *, double *, double *, double *, double *, double *, double *, double, int, int, int, int, int, int, int, int, int, int, int); | ||
template void cpuAvfield(float *, float *, float *, float *, float *, float *, float *, float, int, int, int, int, int, int, int, int, int, int, int); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
template <typename T> void cpuEoS(T *f, T *xdg, T *udg, T *odg, T *wdg, T *uinf, T *param, T time, int modelnumber, int ng, int nc, int ncu, int nd, int ncx, int nco, int ncw, int nce, int npe, int ne) | ||
{ | ||
} | ||
|
||
template void cpuEoS(double *, double *, double *, double *, double *, double *, double *, double, int, int, int, int, int, int, int, int, int, int, int); | ||
template void cpuEoS(float *, float *, float *, float *, float *, float *, float *, float, int, int, int, int, int, int, int, int, int, int, int); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
template <typename T> void cpuEoSdu(T *f, T *xdg, T *udg, T *odg, T *wdg, T *uinf, T *param, T time, int modelnumber, int ng, int nc, int ncu, int nd, int ncx, int nco, int ncw, int nce, int npe, int ne) | ||
{ | ||
} | ||
|
||
template void cpuEoSdu(double *, double *, double *, double *, double *, double *, double *, double, int, int, int, int, int, int, int, int, int, int, int); | ||
template void cpuEoSdu(float *, float *, float *, float *, float *, float *, float *, float, int, int, int, int, int, int, int, int, int, int, int); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
template <typename T> void cpuEoSdw(T *f, T *xdg, T *udg, T *odg, T *wdg, T *uinf, T *param, T time, int modelnumber, int ng, int nc, int ncu, int nd, int ncx, int nco, int ncw, int nce, int npe, int ne) | ||
{ | ||
} | ||
|
||
template void cpuEoSdw(double *, double *, double *, double *, double *, double *, double *, double, int, int, int, int, int, int, int, int, int, int, int); | ||
template void cpuEoSdw(float *, float *, float *, float *, float *, float *, float *, float, int, int, int, int, int, int, int, int, int, int, int); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
template <typename T> void cpuFbou1(T *f, T *xdg, T *udg, T *odg, T *wdg, T *uhg, T *nlg, T *tau, T *uinf, T *param, T time, int modelnumber, int ng, int nc, int ncu, int nd, int ncx, int nco, int ncw) | ||
{ | ||
#pragma omp parallel for | ||
for (int i = 0; i <ng; i++) { | ||
T param1 = param[0]; | ||
T tau1 = tau[0]; | ||
T udg1 = udg[0*ng+i]; | ||
T udg2 = udg[1*ng+i]; | ||
T udg3 = udg[2*ng+i]; | ||
T nlg1 = nlg[0*ng+i]; | ||
T nlg2 = nlg[1*ng+i]; | ||
f[0*ng+i] = tau1*udg1+nlg1*param1*udg2+nlg2*param1*udg3; | ||
} | ||
} | ||
|
||
template <typename T> void cpuFbou(T *f, T *xdg, T *udg, T *odg, T *wdg, T *uhg, T *nlg, T *tau, T *uinf, T *param, T time, int modelnumber, int ib, int ng, int nc, int ncu, int nd, int ncx, int nco, int ncw) | ||
{ | ||
if (ib == 1) | ||
cpuFbou1(f, xdg, udg, odg, wdg, uhg, nlg, tau, uinf, param, time, modelnumber, ng, nc, ncu, nd, ncx, nco, ncw); | ||
} | ||
|
||
template void cpuFbou(double *, double *, double *, double *, double *, double *, double *, double *, double *, double *, double, int, int, int, int, int, int, int, int, int); | ||
template void cpuFbou(float *, float *, float *, float *, float *, float *, float *, float *, float *, float *, float, int, int, int, int, int, int, int, int, int); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
template <typename T> void cpuFhat(T *f, T *xdg, T *udg1, T *udg2, T *odg1, T *odg2, T *wdg1, T *wdg2, T *uhg, T *nlg, T *tau, T *uinf, T *param, T time, int modelnumber, int ng, int nc, int ncu, int nd, int ncx, int nco, int ncw) | ||
{ | ||
} | ||
|
||
template void cpuFhat(double *, double *, double *, double *, double *, double *, double *, double *, double *, double *, double *, double *, double *, double, int, int, int, int, int, int, int, int); | ||
template void cpuFhat(float *, float *, float *, float *, float *, float *, float *, float *, float *, float *, float *, float *, float *, float, int, int, int, int, int, int, int, int); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
template <typename T> void cpuFlux(T *f, T *xdg, T *udg, T *odg, T *wdg, T *uinf, T *param, T time, int modelnumber, int ng, int nc, int ncu, int nd, int ncx, int nco, int ncw) | ||
{ | ||
#pragma omp parallel for | ||
for (int i = 0; i <ng; i++) { | ||
T param1 = param[0]; | ||
T udg2 = udg[1*ng+i]; | ||
T udg3 = udg[2*ng+i]; | ||
f[0*ng+i] = param1*udg2; | ||
f[1*ng+i] = param1*udg3; | ||
} | ||
} | ||
|
||
template void cpuFlux(double *, double *, double *, double *, double *, double *, double *, double, int, int, int, int, int, int, int, int); | ||
template void cpuFlux(float *, float *, float *, float *, float *, float *, float *, float, int, int, int, int, int, int, int, int); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
template <typename T> void cpuInitodg(T *f, T *xdg, T *uinf, T *param, int modelnumber, int ng, int ncx, int nce, int npe, int ne) | ||
{ | ||
} | ||
|
||
template void cpuInitodg(double *, double *, double *, double *, int, int, int, int, int, int); | ||
template void cpuInitodg(float *, float *, float *, float *, int, int, int, int, int, int); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
template <typename T> void cpuInitq(T *f, T *xdg, T *uinf, T *param, int modelnumber, int ng, int ncx, int nce, int npe, int ne) | ||
{ | ||
#pragma omp parallel for | ||
for (int i = 0; i <ng; i++) { | ||
int j = i%npe; | ||
int k = (i-j)/npe; | ||
T xdg1 = xdg[j+npe*0+npe*ncx*k]; | ||
T xdg2 = xdg[j+npe*1+npe*ncx*k]; | ||
f[j+npe*0+npe*nce*k] = sin(xdg1*3.141592653589793)*sin(xdg2*3.141592653589793); | ||
f[j+npe*1+npe*nce*k] = 0.0; | ||
f[j+npe*2+npe*nce*k] = 0.0; | ||
} | ||
} | ||
|
||
template void cpuInitq(double *, double *, double *, double *, int, int, int, int, int, int); | ||
template void cpuInitq(float *, float *, float *, float *, int, int, int, int, int, int); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
template <typename T> void cpuInitu(T *f, T *xdg, T *uinf, T *param, int modelnumber, int ng, int ncx, int nce, int npe, int ne) | ||
{ | ||
#pragma omp parallel for | ||
for (int i = 0; i <ng; i++) { | ||
int j = i%npe; | ||
int k = (i-j)/npe; | ||
T xdg1 = xdg[j+npe*0+npe*ncx*k]; | ||
T xdg2 = xdg[j+npe*1+npe*ncx*k]; | ||
f[j+npe*0+npe*nce*k] = sin(xdg1*3.141592653589793)*sin(xdg2*3.141592653589793); | ||
} | ||
} | ||
|
||
template void cpuInitu(double *, double *, double *, double *, int, int, int, int, int, int); | ||
template void cpuInitu(float *, float *, float *, float *, int, int, int, int, int, int); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
template <typename T> void cpuInitudg(T *f, T *xdg, T *uinf, T *param, int modelnumber, int ng, int ncx, int nce, int npe, int ne) | ||
{ | ||
#pragma omp parallel for | ||
for (int i = 0; i <ng; i++) { | ||
int j = i%npe; | ||
int k = (i-j)/npe; | ||
T xdg1 = xdg[j+npe*0+npe*ncx*k]; | ||
T xdg2 = xdg[j+npe*1+npe*ncx*k]; | ||
f[j+npe*0+npe*nce*k] = sin(xdg1*3.141592653589793)*sin(xdg2*3.141592653589793); | ||
f[j+npe*1+npe*nce*k] = 0.0; | ||
f[j+npe*2+npe*nce*k] = 0.0; | ||
} | ||
} | ||
|
||
template void cpuInitudg(double *, double *, double *, double *, int, int, int, int, int, int); | ||
template void cpuInitudg(float *, float *, float *, float *, int, int, int, int, int, int); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
template <typename T> void cpuInitwdg(T *f, T *xdg, T *uinf, T *param, int modelnumber, int ng, int ncx, int nce, int npe, int ne) | ||
{ | ||
#pragma omp parallel for | ||
for (int i = 0; i <ng; i++) { | ||
int j = i%npe; | ||
int k = (i-j)/npe; | ||
T xdg1 = xdg[j+npe*0+npe*ncx*k]; | ||
T xdg2 = xdg[j+npe*1+npe*ncx*k]; | ||
f[j+npe*0+npe*nce*k] = 0.0; | ||
} | ||
} | ||
|
||
template void cpuInitwdg(double *, double *, double *, double *, int, int, int, int, int, int); | ||
template void cpuInitwdg(float *, float *, float *, float *, int, int, int, int, int, int); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
template <typename T> void cpuOutput(T *f, T *xdg, T *udg, T *odg, T *wdg, T *uinf, T *param, T time, int modelnumber, int ng, int nc, int ncu, int nd, int ncx, int nco, int ncw, int nce, int npe, int ne) | ||
{ | ||
} | ||
|
||
template void cpuOutput(double *, double *, double *, double *, double *, double *, double *, double, int, int, int, int, int, int, int, int, int, int, int); | ||
template void cpuOutput(float *, float *, float *, float *, float *, float *, float *, float, int, int, int, int, int, int, int, int, int, int, int); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
template <typename T> void cpuSource(T *f, T *xdg, T *udg, T *odg, T *wdg, T *uinf, T *param, T time, int modelnumber, int ng, int nc, int ncu, int nd, int ncx, int nco, int ncw) | ||
{ | ||
#pragma omp parallel for | ||
for (int i = 0; i <ng; i++) { | ||
f[0*ng+i] = 0.0; | ||
} | ||
} | ||
|
||
template void cpuSource(double *, double *, double *, double *, double *, double *, double *, double, int, int, int, int, int, int, int, int); | ||
template void cpuSource(float *, float *, float *, float *, float *, float *, float *, float, int, int, int, int, int, int, int, int); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
template <typename T> void cpuSourcew(T *f, T *xdg, T *udg, T *odg, T *wdg, T *uinf, T *param, T time, int modelnumber, int ng, int nc, int ncu, int nd, int ncx, int nco, int ncw, int nce, int npe, int ne) | ||
{ | ||
} | ||
|
||
template void cpuSourcew(double *, double *, double *, double *, double *, double *, double *, double, int, int, int, int, int, int, int, int, int, int, int); | ||
template void cpuSourcew(float *, float *, float *, float *, float *, float *, float *, float, int, int, int, int, int, int, int, int, int, int, int); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
template <typename T> void cpuStab(T *f, T *xdg, T *udg1, T *udg2, T *odg1, T *odg2, T *wdg1, T *wdg2, T *uhg, T *nlg, T *tau, T *uinf, T *param, T time, int modelnumber, int ng, int nc, int ncu, int nd, int ncx, int nco, int ncw) | ||
{ | ||
} | ||
|
||
template void cpuStab(double *, double *, double *, double *, double *, double *, double *, double *, double *, double *, double *, double *, double *, double, int, int, int, int, int, int, int, int); | ||
template void cpuStab(float *, float *, float *, float *, float *, float *, float *, float *, float *, float *, float *, float *, float *, float, int, int, int, int, int, int, int, int); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
template <typename T> void cpuTdfunc(T *f, T *xdg, T *udg, T *odg, T *wdg, T *uinf, T *param, T time, int modelnumber, int ng, int nc, int ncu, int nd, int ncx, int nco, int ncw) | ||
{ | ||
#pragma omp parallel for | ||
for (int i = 0; i <ng; i++) { | ||
f[0*ng+i] = 1.0; | ||
} | ||
} | ||
|
||
template void cpuTdfunc(double *, double *, double *, double *, double *, double *, double *, double, int, int, int, int, int, int, int, int); | ||
template void cpuTdfunc(float *, float *, float *, float *, float *, float *, float *, float, int, int, int, int, int, int, int, int); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
template <typename T> void cpuUbou1(T *f, T *xdg, T *udg, T *odg, T *wdg, T *uhg, T *nlg, T *tau, T *uinf, T *param, T time, int modelnumber, int ng, int nc, int ncu, int nd, int ncx, int nco, int ncw) | ||
{ | ||
#pragma omp parallel for | ||
for (int i = 0; i <ng; i++) { | ||
f[0*ng+i] = 0.0; | ||
} | ||
} | ||
|
||
template <typename T> void cpuUbou(T *f, T *xdg, T *udg, T *odg, T *wdg, T *uhg, T *nlg, T *tau, T *uinf, T *param, T time, int modelnumber, int ib, int ng, int nc, int ncu, int nd, int ncx, int nco, int ncw) | ||
{ | ||
if (ib == 1) | ||
cpuUbou1(f, xdg, udg, odg, wdg, uhg, nlg, tau, uinf, param, time, modelnumber, ng, nc, ncu, nd, ncx, nco, ncw); | ||
} | ||
|
||
template void cpuUbou(double *, double *, double *, double *, double *, double *, double *, double *, double *, double *, double, int, int, int, int, int, int, int, int, int); | ||
template void cpuUbou(float *, float *, float *, float *, float *, float *, float *, float *, float *, float *, float, int, int, int, int, int, int, int, int, int); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
template <typename T> void cpuUhat(T *f, T *xdg, T *udg1, T *udg2, T *odg1, T *odg2, T *wdg1, T *wdg2, T *uhg, T *nlg, T *tau, T *uinf, T *param, T time, int modelnumber, int ng, int nc, int ncu, int nd, int ncx, int nco, int ncw) | ||
{ | ||
} | ||
|
||
template void cpuUhat(double *, double *, double *, double *, double *, double *, double *, double *, double *, double *, double *, double *, double *, double, int, int, int, int, int, int, int, int); | ||
template void cpuUhat(float *, float *, float *, float *, float *, float *, float *, float *, float *, float *, float *, float *, float *, float, int, int, int, int, int, int, int, int); |
Oops, something went wrong.