diff --git a/Applications/FileIO/SWMM/SWMMInterface.cpp b/Applications/FileIO/SWMM/SWMMInterface.cpp index 982134cc35ece05d0cb97591505b3bc3e6501dde..f1dfafc4b9cf9b946af43e79c17ee8ae41da29b0 100644 --- a/Applications/FileIO/SWMM/SWMMInterface.cpp +++ b/Applications/FileIO/SWMM/SWMMInterface.cpp @@ -147,14 +147,13 @@ bool SwmmInterface::isSwmmInputFile(std::string const& inp_file_name) std::string line; bool header_found (false); - std::size_t pos_beg; std::size_t pos_end(0); while (!header_found) { if (!std::getline(in, line)) return false; - pos_beg = line.find_first_not_of(' ', pos_end); + std::size_t const pos_beg = line.find_first_not_of(' ', pos_end); pos_end = line.find_first_of(" \n", pos_beg); // skip empty or comment lines at the beginning of the file diff --git a/Applications/Utils/FileConverter/ConvertSHPToGLI.cpp b/Applications/Utils/FileConverter/ConvertSHPToGLI.cpp index 9d8c834950c48d79a212fb7efaec6eccd4d9019d..983d19dbc7aae338172b59853cefc3a91850ab5e 100644 --- a/Applications/Utils/FileConverter/ConvertSHPToGLI.cpp +++ b/Applications/Utils/FileConverter/ConvertSHPToGLI.cpp @@ -155,11 +155,11 @@ int main (int argc, char* argv[]) std::string fname (shapefile_arg.getValue()); int shape_type, number_of_elements; - double padfMinBound[4], padfMaxBound[4]; SHPHandle hSHP = SHPOpen(fname.c_str(),"rb"); if (hSHP) { - SHPGetInfo( hSHP, &number_of_elements, &shape_type, padfMinBound, padfMaxBound ); + SHPGetInfo(hSHP, &number_of_elements, &shape_type, + nullptr /*padfMinBound*/, nullptr /*padfMinBound*/); if ((shape_type - 1) % 10 == 0) INFO("Shape file contains %d points.", number_of_elements); diff --git a/Applications/Utils/ModelPreparation/PartitionMesh/NodeWiseMeshPartitioner.cpp b/Applications/Utils/ModelPreparation/PartitionMesh/NodeWiseMeshPartitioner.cpp index 2c9493012d32337094252e4f37496d4b6acfb2a3..ae018e617a0e894ac907c2e301cd6d43521344ed 100644 --- a/Applications/Utils/ModelPreparation/PartitionMesh/NodeWiseMeshPartitioner.cpp +++ b/Applications/Utils/ModelPreparation/PartitionMesh/NodeWiseMeshPartitioner.cpp @@ -611,50 +611,47 @@ std::vector<Partition> NodeWiseMeshPartitioner::partitionOtherMesh( { auto& partition = partitions[part_id]; INFO("Processing partition: %d", part_id); - { - // Set the node numbers of base and all mesh nodes. - partition.number_of_mesh_base_nodes = mesh.getNumberOfBaseNodes(); - partition.number_of_mesh_all_nodes = mesh.getNumberOfNodes(); - - std::vector<MeshLib::Node*> higher_order_regular_nodes; - std::tie(partition.nodes, higher_order_regular_nodes) = - findNonGhostNodesInPartition( - part_id, is_mixed_high_order_linear_elems, - mesh.getNumberOfBaseNodes(), mesh.getNodes(), - _nodes_partition_ids, bulk_node_ids); - - partition.number_of_non_ghost_base_nodes = partition.nodes.size(); - partition.number_of_non_ghost_nodes = - partition.number_of_non_ghost_base_nodes + - higher_order_regular_nodes.size(); - - std::tie(partition.regular_elements, partition.ghost_elements) = - findElementsInPartition(part_id, mesh.getElements(), - _nodes_partition_ids, bulk_node_ids); - - std::vector<MeshLib::Node*> base_ghost_nodes; - std::vector<MeshLib::Node*> higher_order_ghost_nodes; - std::tie(base_ghost_nodes, higher_order_ghost_nodes) = - findGhostNodesInPartition( - part_id, is_mixed_high_order_linear_elems, - mesh.getNumberOfBaseNodes(), mesh.getNodes(), - partition.ghost_elements, _nodes_partition_ids, - bulk_node_ids); - - std::copy(begin(base_ghost_nodes), end(base_ghost_nodes), - std::back_inserter(partition.nodes)); + // Set the node numbers of base and all mesh nodes. + partition.number_of_mesh_base_nodes = mesh.getNumberOfBaseNodes(); + partition.number_of_mesh_all_nodes = mesh.getNumberOfNodes(); + + std::vector<MeshLib::Node*> higher_order_regular_nodes; + std::tie(partition.nodes, higher_order_regular_nodes) = + findNonGhostNodesInPartition( + part_id, is_mixed_high_order_linear_elems, + mesh.getNumberOfBaseNodes(), mesh.getNodes(), + _nodes_partition_ids, bulk_node_ids); + + partition.number_of_non_ghost_base_nodes = partition.nodes.size(); + partition.number_of_non_ghost_nodes = + partition.number_of_non_ghost_base_nodes + + higher_order_regular_nodes.size(); + + std::tie(partition.regular_elements, partition.ghost_elements) = + findElementsInPartition(part_id, mesh.getElements(), + _nodes_partition_ids, bulk_node_ids); + + std::vector<MeshLib::Node*> base_ghost_nodes; + std::vector<MeshLib::Node*> higher_order_ghost_nodes; + std::tie(base_ghost_nodes, higher_order_ghost_nodes) = + findGhostNodesInPartition(part_id, is_mixed_high_order_linear_elems, + mesh.getNumberOfBaseNodes(), + mesh.getNodes(), partition.ghost_elements, + _nodes_partition_ids, bulk_node_ids); + + std::copy(begin(base_ghost_nodes), end(base_ghost_nodes), + std::back_inserter(partition.nodes)); - partition.number_of_base_nodes = partition.nodes.size(); + partition.number_of_base_nodes = partition.nodes.size(); - if (is_mixed_high_order_linear_elems) - { - std::copy(begin(higher_order_regular_nodes), - end(higher_order_regular_nodes), - std::back_inserter(partition.nodes)); - std::copy(begin(higher_order_ghost_nodes), - end(higher_order_ghost_nodes), - std::back_inserter(partition.nodes)); - } + if (is_mixed_high_order_linear_elems) + { + std::copy(begin(higher_order_regular_nodes), + end(higher_order_regular_nodes), + std::back_inserter(partition.nodes)); + std::copy(begin(higher_order_ghost_nodes), + end(higher_order_ghost_nodes), + std::back_inserter(partition.nodes)); } } diff --git a/NumLib/Fem/ShapeFunction/ShapeHex20-impl.h b/NumLib/Fem/ShapeFunction/ShapeHex20-impl.h index 51be47245250dc52d07cd47ba7333504abb5c14f..bd6582827a05f6726acd3404416bc4d6acb80c5d 100644 --- a/NumLib/Fem/ShapeFunction/ShapeHex20-impl.h +++ b/NumLib/Fem/ShapeFunction/ShapeHex20-impl.h @@ -88,7 +88,6 @@ void ShapeHex20::computeShapeFunction(const T_X &rst, T_N &N) template <class T_X, class T_N> void ShapeHex20::computeGradShapeFunction(const T_X &rst, T_N &dNdr) { - int co; const double r = rst[0]; const double s = rst[1]; const double t = rst[2]; @@ -111,17 +110,27 @@ void ShapeHex20::computeGradShapeFunction(const T_X &rst, T_N &dNdr) dNdr[20 * i + 14] = sign2[i] * sign3[i] * dShapeFunctionHexHQ_Middle(r,-s,-t,i); dNdr[20 * i + 12] = sign3[i] * dShapeFunctionHexHQ_Middle(r,s,-t,i); - co = (i + 2) % 3; - dNdr[20 * i + 11] = dShapeFunctionHexHQ_Middle(s,t,r,co); - dNdr[20 * i + 15] = sign3[i] * dShapeFunctionHexHQ_Middle(s,-t,r,co); - dNdr[20 * i + 13] = sign1[i] * sign3[i] * dShapeFunctionHexHQ_Middle(s,-t,-r,co); - dNdr[20 * i + 9] = sign1[i] * dShapeFunctionHexHQ_Middle(s,t,-r,co); - - co = (i + 1) % 3; - dNdr[20 * i + 16] = dShapeFunctionHexHQ_Middle(t,r,s,co); - dNdr[20 * i + 17] = sign1[i] * dShapeFunctionHexHQ_Middle(t,-r,s,co); - dNdr[20 * i + 18] = sign1[i] * sign2[i] * dShapeFunctionHexHQ_Middle(t,-r,-s,co); - dNdr[20 * i + 19] = sign2[i] * dShapeFunctionHexHQ_Middle(t,r,-s,co); + { + int const co = (i + 2) % 3; + dNdr[20 * i + 11] = dShapeFunctionHexHQ_Middle(s, t, r, co); + dNdr[20 * i + 15] = + sign3[i] * dShapeFunctionHexHQ_Middle(s, -t, r, co); + dNdr[20 * i + 13] = + sign1[i] * sign3[i] * dShapeFunctionHexHQ_Middle(s, -t, -r, co); + dNdr[20 * i + 9] = + sign1[i] * dShapeFunctionHexHQ_Middle(s, t, -r, co); + } + + { + int const co = (i + 1) % 3; + dNdr[20 * i + 16] = dShapeFunctionHexHQ_Middle(t, r, s, co); + dNdr[20 * i + 17] = + sign1[i] * dShapeFunctionHexHQ_Middle(t, -r, s, co); + dNdr[20 * i + 18] = + sign1[i] * sign2[i] * dShapeFunctionHexHQ_Middle(t, -r, -s, co); + dNdr[20 * i + 19] = + sign2[i] * dShapeFunctionHexHQ_Middle(t, r, -s, co); + } } } diff --git a/ProcessLib/TimeLoop.cpp b/ProcessLib/TimeLoop.cpp index ba4850a7fc03c263b445da3183bc325e809f5140..b8c3e4756e52dabb486775355f17653cfd5bb45f 100644 --- a/ProcessLib/TimeLoop.cpp +++ b/ProcessLib/TimeLoop.cpp @@ -354,11 +354,10 @@ double TimeLoop::computeTimeStepping(const double prev_dt, double& t, } auto& time_disc = ppd.time_disc; - auto& mat_strg = *ppd.mat_strg; auto& x = *_process_solutions[i]; if (all_process_steps_accepted) { - time_disc->pushState(t, x, mat_strg); + time_disc->pushState(t, x, *ppd.mat_strg); } else {