Skip to content

Commit

Permalink
Make fixes for vtu11.h 1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
MFraters committed Aug 19, 2024
1 parent 8c962d8 commit c8be6e3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
22 changes: 12 additions & 10 deletions include/vtu11/vtu11.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1306,6 +1306,7 @@ GHC_INLINE std::error_code make_error_code(portable_error err)
}
#else
switch (err) {
default:
case portable_error::none:
return std::error_code();
case portable_error::exists:
Expand Down Expand Up @@ -1735,6 +1736,7 @@ GHC_INLINE void path::postprocess_path_with_format(path::format fmt)
#else
case path::auto_format:
case path::native_format:
default:
case path::generic_format:
// nothing to do
break;
Expand Down Expand Up @@ -6106,15 +6108,15 @@ namespace vtu11

struct Vtu11UnstructuredMesh
{
const std::vector<double>& points_;
const std::vector<VtkIndexType>& connectivity_;
const std::vector<VtkIndexType>& offsets_;
const std::vector<VtkCellType>& types_;
std::vector<double>& points_;
std::vector<VtkIndexType>& connectivity_;
std::vector<VtkIndexType>& offsets_;
std::vector<VtkCellType>& types_;

const std::vector<double>& points( ){ return points_; }
const std::vector<VtkIndexType>& connectivity( ){ return connectivity_; }
const std::vector<VtkIndexType>& offsets( ){ return offsets_; }
const std::vector<VtkCellType>& types( ){ return types_; }
std::vector<double>& points( ){ return points_; }
std::vector<VtkIndexType>& connectivity( ){ return connectivity_; }
std::vector<VtkIndexType>& offsets( ){ return offsets_; }
std::vector<VtkCellType>& types( ){ return types_; }

size_t numberOfPoints( ){ return points_.size( ) / 3; }
size_t numberOfCells( ){ return types_.size( ); }
Expand Down Expand Up @@ -6286,13 +6288,13 @@ inline std::string base64Encode( Iterator begin, Iterator end )
// in steps of 3
for( size_t i = 0; i < rawBytes / 3; ++i )
{
encodeTriplet( { next( ), next( ), next( ) }, 0 );
encodeTriplet( {{ next( ), next( ), next( ) }}, 0 );
}

// cleanup
if( it != end )
{
std::array<char, 3> bytes { '\0', '\0', '\0' };
std::array<char, 3> bytes {{ '\0', '\0', '\0' }};

size_t remainder = static_cast<size_t>( std::distance( it, end ) ) * size - static_cast<size_t>( byteIndex );

Expand Down
2 changes: 1 addition & 1 deletion source/gwb-grid/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ void filter_vtu_mesh(int dim,
vertex_index_map[src_vid] = dst_vid;

for (unsigned int i=0; i<3; ++i)
output_mesh.points().push_back(input_mesh.points()[src_vid*3+i]);
output_mesh.points().emplace_back(input_mesh.points()[src_vid*3+i]);

for (unsigned int d=0; d<input_data.size(); ++d)
output_data[d].push_back(input_data[d][src_vid]);
Expand Down

0 comments on commit c8be6e3

Please sign in to comment.