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
ce1a45da
There was a problem fetching the pipeline summary.
Commit
ce1a45da
authored
7 years ago
by
Cristian Lalescu
Browse files
Options
Downloads
Patches
Plain Diff
add resize cpp files
parent
b1b5a27f
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!23
WIP: Feature/use cmake
Pipeline
#
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
bfps/cpp/full_code/resize.cpp
+74
-0
74 additions, 0 deletions
bfps/cpp/full_code/resize.cpp
bfps/cpp/full_code/resize.hpp
+67
-0
67 additions, 0 deletions
bfps/cpp/full_code/resize.hpp
setup.py
+1
-0
1 addition, 0 deletions
setup.py
with
142 additions
and
0 deletions
bfps/cpp/full_code/resize.cpp
0 → 100644
+
74
−
0
View file @
ce1a45da
#include
<string>
#include
<cmath>
#include
"resize.hpp"
#include
"scope_timer.hpp"
template
<
typename
rnumber
>
int
resize
<
rnumber
>::
initialize
(
void
)
{
this
->
NSVE_field_stats
<
rnumber
>::
initialize
();
DEBUG_MSG
(
"after NSVE_field_stats::initialize
\n
"
);
hid_t
parameter_file
=
H5Fopen
(
(
this
->
simname
+
std
::
string
(
".h5"
)).
c_str
(),
H5F_ACC_RDONLY
,
H5P_DEFAULT
);
this
->
niter_out
=
hdf5_tools
::
read_value
<
int
>
(
parameter_file
,
"/parameters/niter_out"
);
H5Fclose
(
parameter_file
);
parameter_file
=
H5Fopen
(
(
this
->
simname
+
std
::
string
(
"_post.h5"
)).
c_str
(),
H5F_ACC_RDONLY
,
H5P_DEFAULT
);
DEBUG_MSG
(
"before read_vector
\n
"
);
this
->
iteration_list
=
hdf5_tools
::
read_vector
<
int
>
(
parameter_file
,
"/resize/parameters/iteration_list"
);
this
->
new_nx
=
hdf5_tools
::
read_value
<
int
>
(
parameter_file
,
"/resize/parameters/new_nx"
);
this
->
new_ny
=
hdf5_tools
::
read_value
<
int
>
(
parameter_file
,
"/resize/parameters/new_ny"
);
this
->
new_nz
=
hdf5_tools
::
read_value
<
int
>
(
parameter_file
,
"/resize/parameters/new_nz"
);
this
->
new_simname
=
hdf5_tools
::
read_string
(
parameter_file
,
"/resize/parameters/new_simname"
);
H5Fclose
(
parameter_file
);
this
->
new_field
=
new
field
<
rnumber
,
FFTW
,
THREE
>
(
this
->
new_nx
,
this
->
new_ny
,
this
->
new_nz
,
this
->
comm
,
this
->
vorticity
->
fftw_plan_rigor
);
return
EXIT_SUCCESS
;
}
template
<
typename
rnumber
>
int
resize
<
rnumber
>::
work_on_current_iteration
(
void
)
{
DEBUG_MSG
(
"entered resize::work_on_current_iteration
\n
"
);
this
->
read_current_cvorticity
();
std
::
string
fname
=
(
this
->
new_simname
+
std
::
string
(
"_fields.h5"
));
this
->
new_field
=
this
->
vorticity
;
this
->
new_field
->
io
(
fname
,
"vorticity"
,
this
->
iteration
,
false
);
return
EXIT_SUCCESS
;
}
template
<
typename
rnumber
>
int
resize
<
rnumber
>::
finalize
(
void
)
{
delete
this
->
new_field
;
this
->
NSVE_field_stats
<
rnumber
>::
finalize
();
return
EXIT_SUCCESS
;
}
template
class
resize
<
float
>;
template
class
resize
<
double
>;
This diff is collapsed.
Click to expand it.
bfps/cpp/full_code/resize.hpp
0 → 100644
+
67
−
0
View file @
ce1a45da
/**********************************************************************
* *
* Copyright 2017 Max Planck Institute *
* for Dynamics and Self-Organization *
* *
* This file is part of bfps. *
* *
* bfps is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published *
* by the Free Software Foundation, either version 3 of the License, *
* or (at your option) any later version. *
* *
* bfps is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with bfps. If not, see <http://www.gnu.org/licenses/> *
* *
* Contact: Cristian.Lalescu@ds.mpg.de *
* *
**********************************************************************/
#ifndef RESIZE_HPP
#define RESIZE_HPP
#include
<cstdlib>
#include
<sys/types.h>
#include
<sys/stat.h>
#include
<vector>
#include
"base.hpp"
#include
"field.hpp"
#include
"field_binary_IO.hpp"
#include
"full_code/NSVE_field_stats.hpp"
template
<
typename
rnumber
>
class
resize
:
public
NSVE_field_stats
<
rnumber
>
{
public:
std
::
string
new_simname
;
int
new_nx
;
int
new_ny
;
int
new_nz
;
int
niter_out
;
field
<
rnumber
,
FFTW
,
THREE
>
*
new_field
;
resize
(
const
MPI_Comm
COMMUNICATOR
,
const
std
::
string
&
simulation_name
)
:
NSVE_field_stats
<
rnumber
>
(
COMMUNICATOR
,
simulation_name
){}
virtual
~
resize
(){}
int
initialize
(
void
);
int
work_on_current_iteration
(
void
);
int
finalize
(
void
);
};
#endif//RESIZE_HPP
This diff is collapsed.
Click to expand it.
setup.py
+
1
−
0
View file @
ce1a45da
...
@@ -94,6 +94,7 @@ src_file_list = ['full_code/joint_acc_vel_stats',
...
@@ -94,6 +94,7 @@ src_file_list = ['full_code/joint_acc_vel_stats',
'
full_code/field_test
'
,
'
full_code/field_test
'
,
'
hdf5_tools
'
,
'
hdf5_tools
'
,
'
full_code/get_rfields
'
,
'
full_code/get_rfields
'
,
'
full_code/resize
'
,
'
full_code/NSVE_field_stats
'
,
'
full_code/NSVE_field_stats
'
,
'
full_code/native_binary_to_hdf5
'
,
'
full_code/native_binary_to_hdf5
'
,
'
full_code/postprocess
'
,
'
full_code/postprocess
'
,
...
...
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