Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FileIO] Gocad TSurface interface #2547

Merged
merged 12 commits into from Jul 11, 2019

Conversation

@rinkk
Copy link
Member

commented Jun 28, 2019

Adds an interface that converts *.ts files into one or more OGS meshes.
Nodes, Elements and scalar properties are parsed, various geographical and geological information as well as border-information is ignored (borders could potentially be used as boundary conditions, so maybe this is worth looking into in the future).

The interface is integrated into the Data Explorer and a simple command line tool has been added

  1. Feature description was added to the changelog
  2. Tests covering your feature were added?
@@ -243,3 +243,13 @@ MeshTest(
REQUIREMENTS NOT OGS_USE_MPI
DIFF_DATA Back.vtu Back.vtu 1e-16
)

AddTest(

This comment has been minimized.

Copy link
@endJunction

endJunction Jun 28, 2019

Member

Better use MeshTest macro as above...

This comment has been minimized.

Copy link
@rinkk

rinkk Jul 4, 2019

Author Member

✔️

PVRTX
};

std::vector<MeshLib::Mesh*> _mesh_vec;

This comment has been minimized.

Copy link
@endJunction

endJunction Jun 28, 2019

Member

vector of unique pointers is recommended.

This comment has been minimized.

Copy link
@endJunction

endJunction Jul 9, 2019

Member

I'd like to merge the PR, but there still are memory leaks when executing the utility exe. Many of them are related to the meshes.

> bin/GocadTSurfaceReader -i ../s/Tests/Data/MeshLib/Top-Lower-Shaly.ts -o .
...
SUMMARY: AddressSanitizer: 4133962 byte(s) leaked in 71299 allocation(s).

output.log

This comment has been minimized.

Copy link
@rinkk

rinkk Jul 10, 2019

Author Member

✔️


#pragma once

#include <iostream>

This comment has been minimized.

Copy link
@endJunction

endJunction Jun 28, 2019

Member

include iosfwd in the header file, if possible, an only the needed stream headers in the cpp.

This comment has been minimized.

Copy link
@rinkk

rinkk Jul 4, 2019

Author Member

✔️

}
if (idx < _mesh_vec.size())
return _mesh_vec[idx];
ERR("Error: Mesh index (%d) out of range (0, %d).", idx, _mesh_vec.size());

This comment has been minimized.

Copy link
@TomFischer

TomFischer Jul 1, 2019

Member

The range has to be either [0, _mesh_vec.size() - 1] or [0, _mesh_vec.size() ).

This comment has been minimized.

Copy link
@rinkk

rinkk Jul 4, 2019

Author Member

✔️

return std::string();
}

void GocadTSurfaceReader::writeData(std::string const& file_name,

This comment has been minimized.

Copy link
@TomFischer

TomFischer Jul 1, 2019

Member

Why does the reader need the possibility to write the meshes? This could be done also by external functionality, for instance the DataExplorer.

This comment has been minimized.

Copy link
@rinkk

rinkk Jul 10, 2019

Author Member

✔️

else if (line.substr(0, 5) == "PVRTX" && t != NODE_TYPE::VRTX)
{
nodes.push_back(createNode(sstr));
for (std::string name : array_names)

This comment has been minimized.

Copy link
@TomFischer

TomFischer Jul 1, 2019

Member

Why access by value? Why not for (std::string const& name : array_names)?

This comment has been minimized.

Copy link
@rinkk

rinkk Jul 4, 2019

Author Member

✔️

@TomFischer
Copy link
Member

left a comment

If the small questions are answered:

@rinkk

This comment has been minimized.

Copy link
Member Author

commented Jul 10, 2019

Technically, the ctor isn't needed anymore...

@rinkk rinkk force-pushed the rinkk:TSurfaceInterface branch from dc9d8ca to e9934bf Jul 10, 2019

@TomFischer TomFischer force-pushed the rinkk:TSurfaceInterface branch from e9934bf to 0e3aaeb Jul 11, 2019

@endJunction endJunction merged commit f0f5765 into ufz:master Jul 11, 2019

3 checks passed

continuous-integration/jenkins/pr-merge This commit looks good
Details
deploy/netlify Deploy preview ready!
Details
ufz.ogs #20190711.9 succeeded
Details

@rinkk rinkk deleted the rinkk:TSurfaceInterface branch Jul 17, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.