Skip to content
Snippets Groups Projects
Commit 1dcb2422 authored by Dmitri Naumov's avatar Dmitri Naumov
Browse files

clang-tidy; readability-braces-around-statements.

parent 9d920d1e
No related branches found
No related tags found
No related merge requests found
......@@ -34,7 +34,9 @@ float DiagramList::calcMinXValue()
_coords.begin(), _coords.end(),
[](auto const& c0, auto const& c1) { return c0.first < c1.first; });
if (min != _coords.end())
{
return min->first;
}
return std::numeric_limits<float>::max();
}
......
......@@ -537,7 +537,9 @@ MeshLib::Mesh* createMesh(std::ifstream& in, DataType type,
return_val = parser(in, nodes, elems, node_id_map, mesh_prop);
if (return_val)
{
return new MeshLib::Mesh(mesh_name, nodes, elems, mesh_prop);
}
ERR("Error parsing %s %s.", dataType2ShortString(type).c_str(),
mesh_name.c_str());
clearData(nodes, elems);
......
......@@ -74,9 +74,13 @@ int main(int argc, char* argv[])
FileIO::Gocad::DataType t(FileIO::Gocad::DataType::ALL);
if (export_lines_arg.isSet())
{
t = FileIO::Gocad::DataType::PLINE;
}
if (export_surfaces_arg.isSet())
{
t = FileIO::Gocad::DataType::TSURF;
}
std::vector<std::unique_ptr<MeshLib::Mesh>> meshes;
if (!FileIO::Gocad::GocadAsciiReader::readFile(file_name, meshes, t))
{
......@@ -90,7 +94,9 @@ int main(int argc, char* argv[])
for (auto& mesh : meshes)
{
if (mesh == nullptr)
{
continue;
}
INFO("Writing mesh \"%s\"", mesh->getName().c_str());
int data_mode = (write_binary) ? 2 : 0;
bool compressed = (write_binary);
......
......@@ -46,6 +46,8 @@ int main(int argc, char* argv[])
std::unique_ptr<MeshLib::Mesh> const mesh(
MeshLib::IO::readMeshFromFile(file_name));
if (FileIO::SHPInterface::write2dMeshToSHP(output_arg.getValue(), *mesh))
{
return EXIT_SUCCESS;
}
return EXIT_FAILURE;
}
......@@ -56,7 +56,9 @@ int main(int argc, char* argv[])
FileIO::AsciiRasterInterface::readRaster(input2_arg.getValue()));
if (dem1 == nullptr || dem2 == nullptr)
{
return 1;
}
GeoLib::RasterHeader const& h1 = dem1->getHeader();
GeoLib::RasterHeader const& h2 = dem2->getHeader();
......@@ -89,7 +91,9 @@ int main(int argc, char* argv[])
}
if (errors_found)
{
return 2;
}
std::size_t const n = number_arg.getValue();
std::vector<std::vector<double>> raster;
......@@ -111,7 +115,9 @@ int main(int argc, char* argv[])
if (*it1 == h1.no_data || *it2 == h2.no_data)
{
for (std::size_t i = 0; i < n; ++i)
{
raster[i].push_back(h1.no_data);
}
}
else
{
......@@ -119,7 +125,9 @@ int main(int argc, char* argv[])
double const max = std::max(*it1, *it2);
double const step = (max - min) / static_cast<double>(n + 1);
for (std::size_t i = 0; i < n; ++i)
{
raster[i].push_back(min + ((i+1) * step));
}
}
it2++;
}
......
......@@ -17,11 +17,17 @@ namespace FluidType
Fluid_Type strToFluidType(std::string const& s)
{
if (s == "incompressible_fluid")
{
return Fluid_Type::INCOMPRESSIBLE_FLUID;
}
if (s == "compressible_fluid")
{
return Fluid_Type::COMPRESSIBLE_FLUID;
}
if (s == "ideal_gas")
{
return Fluid_Type::IDEAL_GAS;
}
OGS_FATAL("This fluid type is unavailable. The available types are \n"
"incompressible_fluid, compressible_fluid and ideal_gas.\n");
}
......
......@@ -433,7 +433,9 @@ void ThermoMechanicsProcess<DisplacementDim>::postTimestepConcreteProcess(
int const process_id)
{
if (process_id != _process_data.mechanics_process_id)
{
return;
}
DBUG("PostTimestep ThermoMechanicsProcess.");
......
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