Skip to content

Commit 4047a7b

Browse files
authored
Various code fixes and simplifications (#3700)
* Simplifications * Clean up * Simplify * More simplifications * Fix nasty namespace code * Format fix * Format * Improve docs * Simplifications * macos fixes * Int type fix
1 parent fceb401 commit 4047a7b

File tree

16 files changed

+233
-236
lines changed

16 files changed

+233
-236
lines changed

cpp/dolfinx/common/MPI.h

-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
/// @brief MPI support functionality
3030
namespace dolfinx::MPI
3131
{
32-
3332
/// MPI communication tags
3433
enum class tag : int
3534
{

cpp/dolfinx/common/Scatterer.h

-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
#include <type_traits>
1919
#include <vector>
2020

21-
using namespace dolfinx;
22-
2321
namespace dolfinx::common
2422
{
2523
/// @brief A Scatterer supports the MPI scattering and gathering of data

cpp/dolfinx/fem/FunctionSpace.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class FunctionSpace
4444
FunctionSpace(std::shared_ptr<const mesh::Mesh<geometry_type>> mesh,
4545
std::shared_ptr<const FiniteElement<geometry_type>> element,
4646
std::shared_ptr<const DofMap> dofmap)
47-
: _mesh(mesh), _dofmaps{dofmap}, _elements{element},
47+
: _mesh(mesh), _elements{element}, _dofmaps{dofmap},
4848
_id(boost::uuids::random_generator()()), _root_space_id(_id)
4949
{
5050
// Do nothing

cpp/dolfinx/fem/discreteoperators.h

-1
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,6 @@ void interpolation_matrix(const FunctionSpace<U>& V0,
452452
const std::size_t dim0 = space_dim0 / bs0;
453453
const std::size_t value_size_ref0 = e0->reference_value_size();
454454
const std::size_t value_size0 = V0.element()->reference_value_size();
455-
const std::size_t value_size1 = V1.element()->reference_value_size();
456455

457456
// Get geometry data
458457
const CoordinateElement<U>& cmap = mesh->geometry().cmap();

cpp/dolfinx/io/HDF5Interface.cpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,8 @@ std::filesystem::path io::hdf5::get_filename(hid_t handle)
135135
if (length < 0)
136136
throw std::runtime_error("Failed to get HDF5 filename from handle.");
137137

138-
// Allocate memory
139-
std::vector<char> name(length + 1);
140-
141138
// Retrieve filename
139+
std::vector<char> name(length + 1);
142140
if (H5Fget_name(handle, name.data(), length + 1) < 0)
143141
throw std::runtime_error("Failed to get HDF5 filename from handle.");
144142

cpp/dolfinx/io/HDF5Interface.h

+4-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
namespace dolfinx::io::hdf5
2222
{
23-
2423
/// C++ type to HDF5 data type
2524
template <typename T>
2625
hid_t hdf5_type()
@@ -92,10 +91,13 @@ hid_t open_dataset(hid_t handle, const std::string& path);
9291
std::vector<std::int64_t> get_dataset_shape(hid_t handle,
9392
const std::string& dataset_path);
9493

95-
/// Set MPI atomicity. See
94+
/// Set MPI atomicity.
95+
///
96+
/// See
9697
/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5F.html#File-SetMpiAtomicity
9798
/// and
9899
/// https://www.open-mpi.org/doc/v2.0/man3/MPI_File_set_atomicity.3.php
100+
///
99101
/// Writes must be followed by an MPI_Barrier on the communicator before
100102
/// any subsequent reads are guaranteed to return the same data.
101103
void set_mpi_atomicity(hid_t handle, bool atomic);

0 commit comments

Comments
 (0)