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
Base64 I/O for Paraview and XML #634
base: stable
Are you sure you want to change the base?
Conversation
I think that adding base64 support for the knot vectors would be very good. We are planning to implement something similar to the |
ed3be6e
to
00c803f
Compare
Done and rebased |
- create new file - rename old gsIOUtils to gsGoTools - move actual utils into gsIOUtils
Very usefull ! |
@filiatra As discussed, I looked into the structure date is currently written to file. Adding a flag to gsFileData will not be sufficient. Streaming a file into |
OK then let's go on with this one as it is and let the writing for later. |
base_type_flag_.reserve(base_type_flag.size()); | ||
std::transform(base_type_flag.cbegin(), base_type_flag.cend(), | ||
std::back_inserter(base_type_flag_), | ||
[](unsigned char c) { return std::tolower(c); }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use "::tolower" instead of "std::tolower" because some windows compiles like it better.
std::string format_flag = format ? format->value() : "ascii"; | ||
std::transform(format_flag.cbegin(), format_flag.cend(), | ||
format_flag.begin(), | ||
[](unsigned char c) { return std::tolower(c); }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use "::tolower" instead of "std::tolower" because some windows compiles like it better.
Motivation
Although I was aware of the gismo-PR #236, I saw that there has not been an update since 2018 and it also relies on an external library. Further, it only acted on the XML-files without support for Paraview exports.
The need to redo the implementation of this feature originated as we had fields with very small magnitudes, which is very tedious with fixed-point string conversion.
Implementation
The implementation is based on this, which I implemented as an interface to @j042's python library splinepy. It relied on
c++17
features, so adaptations were required, and further overloads forgsMatrix
were added. TheToVTK
-function was updated accordingly.Details
GoTools
into a separate file, although it seems to be used nowhere (?)base64
option to Paraview collection and added argument totoVTK
Complementary
I would add the following, should there be a demand for it: