Skip to content
Snippets Groups Projects
Commit 785da38a authored by Tom Fischer's avatar Tom Fischer
Browse files

[MaL] Fix google-readability-braces-around-statements.

parent e9d5bec2
No related branches found
No related tags found
No related merge requests found
......@@ -55,9 +55,13 @@ public:
/// get dimension size
unsigned getDimension() const {
if (hasZ())
{
return 3;
}
if (hasY())
{
return 2;
}
return 1;
}
......
......@@ -49,14 +49,20 @@ bool VtuInterface::writeVTU(std::string const& file_name,
vtkSource->Update();
vtuWriter->SetInputData(vtkSource->GetOutput());
if(_use_compressor)
if (_use_compressor)
{
vtuWriter->SetCompressorTypeToZLib();
}
else
{
vtuWriter->SetCompressorTypeToNone();
}
vtuWriter->SetDataMode(_data_mode);
if (_data_mode == vtkXMLWriter::Appended)
{
vtuWriter->SetEncodeAppendedData(1);
}
if (_data_mode == vtkXMLWriter::Ascii)
{
vtkSource->Update();
......
......@@ -43,8 +43,10 @@ namespace IO
VtuInterface::VtuInterface(const MeshLib::Mesh* mesh, int dataMode, bool compress) :
_mesh(mesh), _data_mode(dataMode), _use_compressor(compress)
{
if(_data_mode == vtkXMLWriter::Ascii && compress)
if (_data_mode == vtkXMLWriter::Ascii && compress)
{
WARN("Ascii data cannot be compressed, ignoring compression flag.");
}
}
MeshLib::Mesh* VtuInterface::readVTUFile(std::string const &file_name)
......
......@@ -66,7 +66,9 @@ private:
}
}
if (!exists)
{
value_mapping.push_back(value);
}
}
std::sort(value_mapping.begin(), value_mapping.end());
......
......@@ -117,8 +117,11 @@ MeshLib::Mesh* MeshRevision::simplifyMesh(const std::string &new_mesh_name,
}
new_material_vec->insert(new_material_vec->end(),
n_new_elements, (*material_vec)[k]);
} else
}
else
{
ERR ("Something is wrong, more unique nodes than actual nodes");
}
}
this->resetNodeIDs();
......
......@@ -42,8 +42,10 @@ MeshLib::Mesh* MeshLayerMapper::createStaticLayers(MeshLib::Mesh const& mesh, st
thickness.push_back(layer_thickness_vector[i]);
}
else
{
WARN("Ignoring layer {:d} with thickness {:f}.", i,
layer_thickness_vector[i]);
}
}
const std::size_t nLayers(thickness.size());
......
......@@ -97,8 +97,11 @@ private:
{
auto val(static_cast<T>(img[idx + j]));
prop_vec.push_back(val);
if (elem_type == MeshElemType::TRIANGLE || elem_type == MeshElemType::PRISM)
if (elem_type == MeshElemType::TRIANGLE ||
elem_type == MeshElemType::PRISM)
{
prop_vec.push_back(val); // because each pixel is represented by two cells
}
}
}
}
......
......@@ -79,7 +79,9 @@ private:
for (std::size_t j = 0; j < imgWidth; j++)
{
if (!pix_vis[i * imgWidth + j])
{
continue;
}
T val(static_cast<T>(pix_val[i * (imgWidth + 1) + j]));
if (elem_type == MeshElemType::TRIANGLE)
{
......@@ -87,7 +89,9 @@ private:
prop_vec.push_back(val);
}
else if (elem_type == MeshElemType::QUAD)
{
prop_vec.push_back(val);
}
}
}
}
......
......@@ -43,7 +43,9 @@ void ElementSizeMetric::calculateQuality()
_min,
_max);
if (error_count > 0)
{
WARN("Warning: {:d} elements with zero volume found.", error_count);
}
}
std::size_t ElementSizeMetric::calc1dQuality()
......
......@@ -104,13 +104,17 @@ std::vector<ElementErrorCode> MeshValidation::testElementGeometry(const MeshLib:
for (std::size_t i = 0; i < nErrorCodes; ++i)
{
if (error_count[i])
{
INFO("{:d} elements found with {:s}.",
error_count[i],
ElementErrorCode::toString(flags[i]));
}
}
}
else
{
INFO ("No errors found.");
}
return error_code_vector;
}
......
......@@ -96,7 +96,9 @@ public:
{
if ((*pv)[i] < min_property_value ||
(*pv)[i] > max_property_value)
{
matchedIDs.push_back(i);
}
}
}
else
......@@ -105,7 +107,9 @@ public:
{
if ((*pv)[i] >= min_property_value &&
(*pv)[i] <= max_property_value)
{
matchedIDs.push_back(i);
}
}
}
updateUnion(matchedIDs);
......
......@@ -257,7 +257,9 @@ void MeshSurfaceExtraction::get2DSurfaceElements(
const MathLib::Vector3& dir, double angle, unsigned mesh_dimension)
{
if (mesh_dimension < 2 || mesh_dimension > 3)
{
ERR("Cannot handle meshes of dimension {:i}", mesh_dimension);
}
bool const complete_surface = (MathLib::scalarProduct(dir, dir) == 0);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment