Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TurTLE
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TurTLE
TurTLE
Commits
4ecbfff3
Commit
4ecbfff3
authored
9 years ago
by
Cristian Lalescu
Browse files
Options
Downloads
Patches
Plain Diff
use FFTW(complex) explicitly instead of C
one more step towards avoiding stupid problems...
parent
e001cb9d
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
bfps/cpp/fluid_solver.cpp
+3
-5
3 additions, 5 deletions
bfps/cpp/fluid_solver.cpp
bfps/cpp/fluid_solver_base.cpp
+10
-12
10 additions, 12 deletions
bfps/cpp/fluid_solver_base.cpp
bfps/cpp/tracers.cpp
+1
-3
1 addition, 3 deletions
bfps/cpp/tracers.cpp
with
14 additions
and
20 deletions
bfps/cpp/fluid_solver.cpp
+
3
−
5
View file @
4ecbfff3
...
...
@@ -40,7 +40,7 @@ void fluid_solver<rnumber>::impose_zero_modes()
/*****************************************************************************/
/* macro for specializations to numeric types compatible with FFTW */
#define FLUID_SOLVER_DEFINITIONS(FFTW, R,
C,
MPI_RNUM, MPI_CNUM) \
#define FLUID_SOLVER_DEFINITIONS(FFTW, R, MPI_RNUM, MPI_CNUM) \
\
template<> \
fluid_solver<R>::fluid_solver( \
...
...
@@ -186,7 +186,7 @@ void fluid_solver<R>::compute_vorticity() \
} \
\
template<> \
void fluid_solver<R>::compute_velocity(
C
*vorticity) \
void fluid_solver<R>::compute_velocity(
FFTW(complex)
*vorticity) \
{ \
double k2; \
std::fill_n((R*)this->cu, this->cd->local_size*2, 0.0); \
...
...
@@ -239,7 +239,7 @@ void fluid_solver<R>::dft_vorticity() \
\
template<> \
void fluid_solver<R>::add_forcing(\
C
*field, R factor) \
FFTW(complex)
*field, R factor) \
{ \
if (strcmp(this->forcing_type, "none") == 0) \
return; \
...
...
@@ -451,13 +451,11 @@ int fluid_solver<R>::write(char field, char representation) \
FLUID_SOLVER_DEFINITIONS
(
FFTW_MANGLE_FLOAT
,
float
,
fftwf_complex
,
MPI_FLOAT
,
MPI_COMPLEX
)
FLUID_SOLVER_DEFINITIONS
(
FFTW_MANGLE_DOUBLE
,
double
,
fftw_complex
,
MPI_DOUBLE
,
BFPS_MPICXX_DOUBLE_COMPLEX
)
/*****************************************************************************/
...
...
This diff is collapsed.
Click to expand it.
bfps/cpp/fluid_solver_base.cpp
+
10
−
12
View file @
4ecbfff3
...
...
@@ -106,7 +106,7 @@ void fluid_solver_base<rnumber>::write_spectrum(const char *fname, cnumber *a, c
/*****************************************************************************/
/* macro for specializations to numeric types compatible with FFTW */
#define FLUID_SOLVER_BASE_DEFINITIONS(FFTW, R,
C,
MPI_RNUM, MPI_CNUM) \
#define FLUID_SOLVER_BASE_DEFINITIONS(FFTW, R, MPI_RNUM, MPI_CNUM) \
\
template<> \
fluid_solver_base<R>::fluid_solver_base( \
...
...
@@ -246,7 +246,7 @@ fluid_solver_base<R>::~fluid_solver_base() \
} \
\
template<> \
R fluid_solver_base<R>::correl_vec(
C *a, C
*b) \
R fluid_solver_base<R>::correl_vec(
FFTW(complex) *a, FFTW(complex)
*b) \
{ \
double val_process = 0.0, val; \
double k2; \
...
...
@@ -275,7 +275,7 @@ R fluid_solver_base<R>::correl_vec(C *a, C *b) \
} \
\
template<> \
void fluid_solver_base<R>::low_pass_Fourier(
C
*a, const int howmany, const double kmax) \
void fluid_solver_base<R>::low_pass_Fourier(
FFTW(complex)
*a, const int howmany, const double kmax) \
{ \
double k2; \
const double km2 = kmax*kmax; \
...
...
@@ -303,7 +303,7 @@ void fluid_solver_base<R>::low_pass_Fourier(C *a, const int howmany, const doubl
} \
\
template<> \
void fluid_solver_base<R>::dealias(
C
*a, const int howmany) \
void fluid_solver_base<R>::dealias(
FFTW(complex)
*a, const int howmany) \
{ \
if (this->dealias_type == 0) \
{ \
...
...
@@ -326,10 +326,10 @@ void fluid_solver_base<R>::dealias(C *a, const int howmany) \
} \
\
template<> \
void fluid_solver_base<R>::force_divfree(
C
*a) \
void fluid_solver_base<R>::force_divfree(
FFTW(complex)
*a) \
{ \
double k2; \
C
tval; \
FFTW(complex)
tval; \
CLOOP( \
k2 = (this->kx[xindex]*this->kx[xindex] + \
this->ky[yindex]*this->ky[yindex] + \
...
...
@@ -354,7 +354,7 @@ void fluid_solver_base<R>::force_divfree(C *a) \
} \
\
template<> \
void fluid_solver_base<R>::symmetrize(
C
*data, const int howmany) \
void fluid_solver_base<R>::symmetrize(
FFTW(complex)
*data, const int howmany) \
{ \
ptrdiff_t ii, cc; \
MPI_Status *mpistatus = new MPI_Status[1]; \
...
...
@@ -370,7 +370,7 @@ void fluid_solver_base<R>::symmetrize(C *data, const int howmany) \
-(*(data + cc + howmany*( ii)*this->cd->sizes[2]))[1]; \
} \
} \
C
*buffer; \
FFTW(complex)
*buffer; \
buffer = FFTW(alloc_complex)(howmany*this->cd->sizes[1]); \
ptrdiff_t yy; \
/*ptrdiff_t tindex;*/
\
...
...
@@ -439,7 +439,7 @@ int fluid_solver_base<R>::read_base(const char *fname, R *data) \
} \
\
template<> \
int fluid_solver_base<R>::read_base(const char *fname,
C
*data) \
int fluid_solver_base<R>::read_base(const char *fname,
FFTW(complex)
*data) \
{ \
char full_name[512]; \
sprintf(full_name, "%s_%s_i%.5x", this->name, fname, this->iteration); \
...
...
@@ -455,7 +455,7 @@ int fluid_solver_base<R>::write_base(const char *fname, R *data) \
} \
\
template<> \
int fluid_solver_base<R>::write_base(const char *fname,
C
*data) \
int fluid_solver_base<R>::write_base(const char *fname,
FFTW(complex)
*data) \
{ \
char full_name[512]; \
sprintf(full_name, "%s_%s_i%.5x", this->name, fname, this->iteration); \
...
...
@@ -471,13 +471,11 @@ int fluid_solver_base<R>::write_base(const char *fname, C *data) \
FLUID_SOLVER_BASE_DEFINITIONS
(
FFTW_MANGLE_FLOAT
,
float
,
fftwf_complex
,
MPI_FLOAT
,
MPI_COMPLEX
)
FLUID_SOLVER_BASE_DEFINITIONS
(
FFTW_MANGLE_DOUBLE
,
double
,
fftw_complex
,
MPI_DOUBLE
,
BFPS_MPICXX_DOUBLE_COMPLEX
)
/*****************************************************************************/
...
...
This diff is collapsed.
Click to expand it.
bfps/cpp/tracers.cpp
+
1
−
3
View file @
4ecbfff3
...
...
@@ -104,7 +104,7 @@ void tracers<rnumber>::update_field(bool clip_on)
/*****************************************************************************/
/* macro for specializations to numeric types compatible with FFTW */
#define TRACERS_DEFINITIONS(FFTW, R,
C,
MPI_RNUM, MPI_CNUM) \
#define TRACERS_DEFINITIONS(FFTW, R, MPI_RNUM, MPI_CNUM) \
\
template <> \
tracers<R>::tracers( \
...
...
@@ -143,13 +143,11 @@ tracers<R>::~tracers() \
TRACERS_DEFINITIONS
(
FFTW_MANGLE_FLOAT
,
float
,
fftwf_complex
,
MPI_FLOAT
,
MPI_COMPLEX
)
TRACERS_DEFINITIONS
(
FFTW_MANGLE_DOUBLE
,
double
,
fftw_complex
,
MPI_DOUBLE
,
BFPS_MPICXX_DOUBLE_COMPLEX
)
/*****************************************************************************/
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment