Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Dmitri Naumov
ogs
Commits
e7aedb8d
Commit
e7aedb8d
authored
5 years ago
by
Karsten Rink
Committed by
Lars Bilke
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
fixing mac warnings
parent
1a792624
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Applications/Utils/FileConverter/CMakeLists.txt
+5
-2
5 additions, 2 deletions
Applications/Utils/FileConverter/CMakeLists.txt
Applications/Utils/FileConverter/NetCdfConverter.cpp
+5
-7
5 additions, 7 deletions
Applications/Utils/FileConverter/NetCdfConverter.cpp
with
10 additions
and
9 deletions
Applications/Utils/FileConverter/CMakeLists.txt
+
5
−
2
View file @
e7aedb8d
...
@@ -9,8 +9,11 @@ set(TOOLS
...
@@ -9,8 +9,11 @@ set(TOOLS
TecPlotTools
TecPlotTools
GocadSGridReader
GocadSGridReader
GocadTSurfaceReader
GocadTSurfaceReader
Mesh2Raster
Mesh2Raster
)
NetCdfConverter
)
if
(
OGS_USE_NETCDF
)
list
(
APPEND TOOLS NetCdfConverter
)
endif
()
if
(
OGS_BUILD_GUI
)
if
(
OGS_BUILD_GUI
)
if
(
Shapelib_FOUND
)
if
(
Shapelib_FOUND
)
...
...
This diff is collapsed.
Click to expand it.
Applications/Utils/FileConverter/NetCdfConverter.cpp
+
5
−
7
View file @
e7aedb8d
...
@@ -175,8 +175,8 @@ void flipRaster(std::vector<double>& data, std::size_t width,
...
@@ -175,8 +175,8 @@ void flipRaster(std::vector<double>& data, std::size_t width,
bool
canConvert
(
NcVar
const
&
var
)
bool
canConvert
(
NcVar
const
&
var
)
{
{
bool
ret
(
true
);
bool
ret
(
var
.
getDimCount
()
<
2
);
if
(
ret
=
(
var
.
getDimCount
()
<
2
)
)
if
(
ret
)
ERR
(
"Only 2+ dimensional variables can be converted into OGS Meshes.
\n
"
);
ERR
(
"Only 2+ dimensional variables can be converted into OGS Meshes.
\n
"
);
return
!
ret
;
return
!
ret
;
}
}
...
@@ -187,7 +187,8 @@ std::string arraySelectionLoop(NcFile const& dataset)
...
@@ -187,7 +187,8 @@ std::string arraySelectionLoop(NcFile const& dataset)
std
::
size_t
const
idx
=
std
::
size_t
const
idx
=
parseInput
(
"Enter data array index: "
,
dataset
.
getVarCount
(),
true
);
parseInput
(
"Enter data array index: "
,
dataset
.
getVarCount
(),
true
);
if
(
idx
==
dataset
.
getVarCount
()
||
!
canConvert
(
dataset
.
getVar
(
names
[
idx
])))
if
(
static_cast
<
int
>
(
idx
)
==
dataset
.
getVarCount
()
||
!
canConvert
(
dataset
.
getVar
(
names
[
idx
])))
return
arraySelectionLoop
(
dataset
);
return
arraySelectionLoop
(
dataset
);
return
names
[
idx
];
return
names
[
idx
];
...
@@ -246,7 +247,7 @@ bool dimensionSelectionLoop(NcVar const& var,
...
@@ -246,7 +247,7 @@ bool dimensionSelectionLoop(NcVar const& var,
" "
+
dim_comment
[
i
-
start_idx
]
+
": "
);
" "
+
dim_comment
[
i
-
start_idx
]
+
": "
);
std
::
size_t
const
idx
=
parseInput
(
request_str
,
var
.
getDimCount
(),
true
);
std
::
size_t
const
idx
=
parseInput
(
request_str
,
var
.
getDimCount
(),
true
);
if
(
idx
==
var
.
getDimCount
())
if
(
static_cast
<
int
>
(
idx
)
==
var
.
getDimCount
())
{
{
showArraysDims
(
var
);
showArraysDims
(
var
);
i
--
;
i
--
;
...
@@ -262,7 +263,6 @@ std::pair<std::size_t, std::size_t> timestepSelectionLoop(NcFile const& dataset,
...
@@ -262,7 +263,6 @@ std::pair<std::size_t, std::size_t> timestepSelectionLoop(NcFile const& dataset,
NcVar
const
&
var
,
NcVar
const
&
var
,
std
::
size_t
dim_idx
)
std
::
size_t
dim_idx
)
{
{
NcVar
const
&
dim_var
=
getDimVar
(
dataset
,
var
,
dim_idx
);
std
::
size_t
const
n_time_steps
=
var
.
getDim
(
dim_idx
).
getSize
();
std
::
size_t
const
n_time_steps
=
var
.
getDim
(
dim_idx
).
getSize
();
std
::
pair
<
std
::
size_t
,
std
::
size_t
>
bounds
(
std
::
pair
<
std
::
size_t
,
std
::
size_t
>
bounds
(
std
::
numeric_limits
<
std
::
size_t
>::
max
(),
std
::
numeric_limits
<
std
::
size_t
>::
max
(),
...
@@ -488,8 +488,6 @@ bool convert(NcFile const& dataset, NcVar const& var,
...
@@ -488,8 +488,6 @@ bool convert(NcFile const& dataset, NcVar const& var,
bool
const
use_single_file
,
MeshLib
::
MeshElemType
const
elem_type
)
bool
const
use_single_file
,
MeshLib
::
MeshElemType
const
elem_type
)
{
{
std
::
unique_ptr
<
MeshLib
::
Mesh
>
mesh
;
std
::
unique_ptr
<
MeshLib
::
Mesh
>
mesh
;
std
::
size_t
const
temp_offset
=
(
is_time_dep
)
?
1
:
0
;
std
::
size_t
const
n_dims
=
(
var
.
getDimCount
());
std
::
vector
<
std
::
size_t
>
length
;
std
::
vector
<
std
::
size_t
>
length
;
std
::
size_t
const
array_length
=
getLength
(
var
,
is_time_dep
,
length
);
std
::
size_t
const
array_length
=
getLength
(
var
,
is_time_dep
,
length
);
for
(
std
::
size_t
i
=
time_bounds
.
first
;
i
<=
time_bounds
.
second
;
++
i
)
for
(
std
::
size_t
i
=
time_bounds
.
first
;
i
<=
time_bounds
.
second
;
++
i
)
...
...
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