From b76ae1f630d9472b4473a669a74c22472160b3af Mon Sep 17 00:00:00 2001 From: Lars Bilke <lars.bilke@ufz.de> Date: Wed, 28 Jul 2021 11:51:17 +0200 Subject: [PATCH] clang-format --- .../HeatTransportBHEProcess.cpp | 46 ++++++++++--------- ProcessLib/ProcessVariable.cpp | 10 ++-- ProcessLib/ProcessVariable.h | 3 +- ProcessLib/Utils/LocalDataInitializer.h | 11 ++--- 4 files changed, 38 insertions(+), 32 deletions(-) diff --git a/ProcessLib/HeatTransportBHE/HeatTransportBHEProcess.cpp b/ProcessLib/HeatTransportBHE/HeatTransportBHEProcess.cpp index 64eadb6851f..4276e9fcb2a 100644 --- a/ProcessLib/HeatTransportBHE/HeatTransportBHEProcess.cpp +++ b/ProcessLib/HeatTransportBHE/HeatTransportBHEProcess.cpp @@ -107,12 +107,12 @@ void HeatTransportBHEProcess::constructDofTable() _mesh_subset_BHE_nodes.push_back( std::make_unique<MeshLib::MeshSubset const>(_mesh, bhe_nodes)); - std::generate_n( - std::back_inserter(all_mesh_subsets), - // Here the number of components equals to the - // number of unknowns on the BHE - number_of_unknowns, - [&ms = _mesh_subset_BHE_nodes.back()]() { return *ms; }); + std::generate_n(std::back_inserter(all_mesh_subsets), + // Here the number of components equals to the + // number of unknowns on the BHE + number_of_unknowns, + [&ms = _mesh_subset_BHE_nodes.back()]() + { return *ms; }); vec_n_components.push_back(number_of_unknowns); vec_var_elements.push_back(&bhe_elements); @@ -284,9 +284,8 @@ void HeatTransportBHEProcess::createBHEBoundaryConditionTopBottom( // Count number of 1d elements connected with every BHE node. const std::size_t n_line_elements = std::count_if( bhe_node->getElements().begin(), bhe_node->getElements().end(), - [](MeshLib::Element const* elem) { - return (elem->getDimension() == 1); - }); + [](MeshLib::Element const* elem) + { return (elem->getDimension() == 1); }); if (n_line_elements == 1) { @@ -331,8 +330,9 @@ void HeatTransportBHEProcess::createBHEBoundaryConditionTopBottom( } } - auto get_global_index = [&](std::size_t const node_id, - int const component) { + auto get_global_index = + [&](std::size_t const node_id, int const component) + { return _local_to_global_index_map->getGlobalIndex( {_mesh.getID(), MeshLib::MeshItemType::Node, node_id}, variable_id, component); @@ -341,17 +341,19 @@ void HeatTransportBHEProcess::createBHEBoundaryConditionTopBottom( auto get_global_bhe_bc_indices = [&](std::array< std::pair<std::size_t /*node_id*/, int /*component*/>, 2> - nodes_and_components) { - return std::make_pair( - get_global_index(nodes_and_components[0].first, - nodes_and_components[0].second), - get_global_index(nodes_and_components[1].first, - nodes_and_components[1].second)); - }; - - auto createBCs = [&, bc_top_node_id = bhe_boundary_nodes[0]->getID(), - bc_bottom_node_id = - bhe_boundary_nodes[1]->getID()](auto& bhe) { + nodes_and_components) + { + return std::make_pair( + get_global_index(nodes_and_components[0].first, + nodes_and_components[0].second), + get_global_index(nodes_and_components[1].first, + nodes_and_components[1].second)); + }; + + auto createBCs = + [&, bc_top_node_id = bhe_boundary_nodes[0]->getID(), + bc_bottom_node_id = bhe_boundary_nodes[1]->getID()](auto& bhe) + { for (auto const& in_out_component_id : bhe.inflow_outflow_bc_component_ids) { diff --git a/ProcessLib/ProcessVariable.cpp b/ProcessLib/ProcessVariable.cpp index c1b5b0ef1b3..e9f4216da1c 100644 --- a/ProcessLib/ProcessVariable.cpp +++ b/ProcessLib/ProcessVariable.cpp @@ -76,7 +76,8 @@ MeshLib::Mesh const& findMeshInConfig( // auto const& mesh = *BaseLib::findElementOrError( begin(meshes), end(meshes), - [&mesh_name](auto const& mesh) { + [&mesh_name](auto const& mesh) + { assert(mesh != nullptr); return mesh->getName() == mesh_name; }, @@ -299,7 +300,8 @@ void ProcessVariable::updateDeactivatedSubdomains(double const time) auto const* const material_ids = MeshLib::materialIDs(_mesh); auto is_active_in_subdomain = [&](std::size_t const i, - DeactivatedSubdomain const& ds) -> bool { + DeactivatedSubdomain const& ds) -> bool + { if (!ds.isInTimeSupportInterval(time)) { return true; @@ -339,7 +341,9 @@ std::vector<std::unique_ptr<SourceTerm>> ProcessVariable::createSourceTerms( std::vector<std::unique_ptr<SourceTerm>> source_terms; transform(cbegin(_source_term_configs), cend(_source_term_configs), - back_inserter(source_terms), [&](auto const& config) { + back_inserter(source_terms), + [&](auto const& config) + { return createSourceTerm(config, dof_table, config.mesh, variable_id, integration_order, _shapefunction_order, parameters); diff --git a/ProcessLib/ProcessVariable.h b/ProcessLib/ProcessVariable.h index ffc0eda0289..3eabd2cf6fc 100644 --- a/ProcessLib/ProcessVariable.h +++ b/ProcessLib/ProcessVariable.h @@ -25,7 +25,7 @@ namespace MeshLib class Mesh; template <typename T> class PropertyVector; -} +} // namespace MeshLib namespace NumLib { class LocalToGlobalIndexMap; @@ -95,6 +95,7 @@ public: } unsigned getShapeFunctionOrder() const { return _shapefunction_order; } + private: std::string const _name; MeshLib::Mesh& _mesh; diff --git a/ProcessLib/Utils/LocalDataInitializer.h b/ProcessLib/Utils/LocalDataInitializer.h index df1733e6dd2..e5f18b1537c 100644 --- a/ProcessLib/Utils/LocalDataInitializer.h +++ b/ProcessLib/Utils/LocalDataInitializer.h @@ -136,8 +136,7 @@ public: if (shapefunction_order == 1) { -// /// Lines and points /////////////////////////////////// - + // /// Lines and points /////////////////////////////////// #if (OGS_ENABLED_ELEMENTS & ENABLED_ELEMENT_TYPE_LINE) != 0 && \ OGS_MAX_ELEMENT_DIM >= 1 && OGS_MAX_ELEMENT_ORDER >= 1 @@ -151,7 +150,7 @@ public: makeLocalAssemblerBuilder<NumLib::ShapeLine2>(); #endif -// /// Quads and Hexahedra /////////////////////////////////// + // /// Quads and Hexahedra /////////////////////////////////// #if (OGS_ENABLED_ELEMENTS & ENABLED_ELEMENT_TYPE_QUAD) != 0 && \ OGS_MAX_ELEMENT_DIM >= 2 && OGS_MAX_ELEMENT_ORDER >= 1 @@ -235,14 +234,13 @@ public: } else if (shapefunction_order == 2) { - #if (OGS_ENABLED_ELEMENTS & ENABLED_ELEMENT_TYPE_LINE) != 0 && \ OGS_MAX_ELEMENT_DIM >= 1 && OGS_MAX_ELEMENT_ORDER >= 2 _builder[std::type_index(typeid(MeshLib::Line3))] = makeLocalAssemblerBuilder<NumLib::ShapeLine3>(); #endif -// /// Quads and Hexahedra /////////////////////////////////// + // /// Quads and Hexahedra /////////////////////////////////// #if (OGS_ENABLED_ELEMENTS & ENABLED_ELEMENT_TYPE_QUAD) != 0 && \ OGS_MAX_ELEMENT_DIM >= 2 && OGS_MAX_ELEMENT_ORDER >= 2 @@ -359,7 +357,8 @@ private: { return [](MeshLib::Element const& e, std::size_t const local_matrix_size, - ConstructorArgs&&... args) { + ConstructorArgs&&... args) + { return LADataIntfPtr{new LAData<ShapeFunction>{ e, local_matrix_size, std::forward<ConstructorArgs>(args)...}}; }; -- GitLab