From 78f07cde3ec0c16b39f0c66b29778b00752ba5bc Mon Sep 17 00:00:00 2001
From: Wenqing Wang <wenqing.wang@ufz.de>
Date: Mon, 20 Nov 2017 15:15:49 +0100
Subject: [PATCH] clang-formatting the files that are changed in the previous
 commit

---
 ProcessLib/LiquidFlow/LiquidFlowProcess.cpp |  3 +-
 ProcessLib/LocalAssemblerInterface.cpp      |  3 +-
 ProcessLib/LocalAssemblerInterface.h        | 53 +++++++++++----------
 ProcessLib/Process.cpp                      | 37 +++++++-------
 ProcessLib/Process.h                        |  6 ++-
 ProcessLib/UncoupledProcessesTimeLoop.cpp   |  6 ++-
 6 files changed, 59 insertions(+), 49 deletions(-)

diff --git a/ProcessLib/LiquidFlow/LiquidFlowProcess.cpp b/ProcessLib/LiquidFlow/LiquidFlowProcess.cpp
index 7eba951fcbe..2d2d0740801 100644
--- a/ProcessLib/LiquidFlow/LiquidFlowProcess.cpp
+++ b/ProcessLib/LiquidFlow/LiquidFlowProcess.cpp
@@ -108,7 +108,8 @@ void LiquidFlowProcess::computeSecondaryVariableConcrete(const double t,
     DBUG("Compute the velocity for LiquidFlowProcess.");
     GlobalExecutor::executeMemberOnDereferenced(
         &LiquidFlowLocalAssemblerInterface::computeSecondaryVariable,
-        _local_assemblers, *_local_to_global_index_map, t, x, _coupled_solutions);
+        _local_assemblers, *_local_to_global_index_map, t, x,
+        _coupled_solutions);
 }
 
 void LiquidFlowProcess::setCoupledSolutionsForStaggeredSchemeToLocalAssemblers()
diff --git a/ProcessLib/LocalAssemblerInterface.cpp b/ProcessLib/LocalAssemblerInterface.cpp
index c9c6876dab4..910a73b311a 100644
--- a/ProcessLib/LocalAssemblerInterface.cpp
+++ b/ProcessLib/LocalAssemblerInterface.cpp
@@ -57,7 +57,8 @@ void LocalAssemblerInterface::assembleWithJacobianAndCoupling(
 void LocalAssemblerInterface::computeSecondaryVariable(
     std::size_t const mesh_item_id,
     NumLib::LocalToGlobalIndexMap const& dof_table, double const t,
-    GlobalVector const& x, CoupledSolutionsForStaggeredScheme const* coupled_term)
+    GlobalVector const& x,
+    CoupledSolutionsForStaggeredScheme const* coupled_term)
 {
     auto const indices = NumLib::getIndices(mesh_item_id, dof_table);
     auto const local_x = x.get(indices);
diff --git a/ProcessLib/LocalAssemblerInterface.h b/ProcessLib/LocalAssemblerInterface.h
index 28bf1188f21..bfb983f87d4 100644
--- a/ProcessLib/LocalAssemblerInterface.h
+++ b/ProcessLib/LocalAssemblerInterface.h
@@ -9,7 +9,6 @@
 
 #pragma once
 
-
 #include <unordered_map>
 #include <typeindex>
 
@@ -36,17 +35,18 @@ class LocalAssemblerInterface
 public:
     virtual ~LocalAssemblerInterface() = default;
 
-    virtual void assemble(
-        double const t, std::vector<double> const& local_x,
-        std::vector<double>& local_M_data, std::vector<double>& local_K_data,
-        std::vector<double>& local_b_data) = 0;
-
-    virtual void assembleWithCoupledTerm(double const t,
-                                   std::vector<double> const& local_x,
-                                   std::vector<double>& local_M_data,
-                                   std::vector<double>& local_K_data,
-                                   std::vector<double>& local_b_data,
-                                   LocalCoupledSolutions const& coupled_solutions);
+    virtual void assemble(double const t, std::vector<double> const& local_x,
+                          std::vector<double>& local_M_data,
+                          std::vector<double>& local_K_data,
+                          std::vector<double>& local_b_data) = 0;
+
+    virtual void assembleWithCoupledTerm(
+        double const t,
+        std::vector<double> const& local_x,
+        std::vector<double>& local_M_data,
+        std::vector<double>& local_K_data,
+        std::vector<double>& local_b_data,
+        LocalCoupledSolutions const& coupled_solutions);
 
     virtual void assembleWithJacobian(double const t,
                                       std::vector<double> const& local_x,
@@ -65,10 +65,11 @@ public:
         std::vector<double>& local_Jac_data,
         LocalCoupledSolutions const& coupled_solutions);
 
-    virtual void computeSecondaryVariable(std::size_t const mesh_item_id,
-                              NumLib::LocalToGlobalIndexMap const& dof_table,
-                              const double t, GlobalVector const& x,
-                              CoupledSolutionsForStaggeredScheme const* coupled_term);
+    virtual void computeSecondaryVariable(
+        std::size_t const mesh_item_id,
+        NumLib::LocalToGlobalIndexMap const& dof_table, const double t,
+        GlobalVector const& x,
+        CoupledSolutionsForStaggeredScheme const* coupled_term);
 
     virtual void preTimestep(std::size_t const mesh_item_id,
                              NumLib::LocalToGlobalIndexMap const& dof_table,
@@ -95,15 +96,17 @@ private:
     }
 
     virtual void postTimestepConcrete(std::vector<double> const& /*local_x*/) {}
+    virtual void computeSecondaryVariableConcrete(
+        double const /*t*/, std::vector<double> const& /*local_x*/)
+    {
+    }
 
-    virtual void computeSecondaryVariableConcrete
-                (double const /*t*/, std::vector<double> const& /*local_x*/) {}
-
-    virtual void computeSecondaryVariableWithCoupledProcessConcrete
-            (double const /*t*/, std::vector<double> const& /*local_x*/,
-             std::unordered_map<std::type_index,
-             const std::vector<double>> const&
-             /*coupled_local_solutions*/) {}
+    virtual void computeSecondaryVariableWithCoupledProcessConcrete(
+        double const /*t*/, std::vector<double> const& /*local_x*/,
+        std::unordered_map<std::type_index, const std::vector<double>> const&
+        /*coupled_local_solutions*/)
+    {
+    }
 };
 
-} // namespace ProcessLib
+}  // namespace ProcessLib
diff --git a/ProcessLib/Process.cpp b/ProcessLib/Process.cpp
index 69b15f52b2a..5840fccdf3c 100644
--- a/ProcessLib/Process.cpp
+++ b/ProcessLib/Process.cpp
@@ -65,12 +65,10 @@ void Process::initialize()
          ++variable_id)
     {
         ProcessVariable& pv = _process_variables[variable_id];
-        auto sts =
-            pv.createSourceTerms(*_local_to_global_index_map, variable_id,
-                                 _integration_order);
+        auto sts = pv.createSourceTerms(*_local_to_global_index_map,
+                                        variable_id, _integration_order);
 
-        std::move(sts.begin(), sts.end(),
-                  std::back_inserter(_source_terms));
+        std::move(sts.begin(), sts.end(), std::back_inserter(_source_terms));
     }
 }
 
@@ -109,13 +107,14 @@ void Process::setInitialConditions(double const t, GlobalVector& x)
                         std::abs(_local_to_global_index_map->getGlobalIndex(
                             l, variable_id, component_id));
 #ifdef USE_PETSC
-                    // The global indices of the ghost entries of the global matrix
-                    // or the global vectors need to be set as negative values for
-                    // equation assembly, however the global indices start from
-                    // zero. Therefore, any ghost entry with zero index is assigned
-                    // an negative value of the vector size or the matrix dimension.
-                    // To assign the initial value for the ghost entries, the
-                    // negative indices of the ghost entries are restored to zero.
+                    // The global indices of the ghost entries of the global
+                    // matrix or the global vectors need to be set as negative
+                    // values for equation assembly, however the global indices
+                    // start from zero. Therefore, any ghost entry with zero
+                    // index is assigned an negative value of the vector size
+                    // or the matrix dimension. To assign the initial value for
+                    // the ghost entries, the negative indices of the ghost
+                    // entries are restored to zero.
                     if (global_index == x.size())
                         global_index = 0;
 #endif
@@ -158,7 +157,7 @@ void Process::assembleWithJacobian(const double t, GlobalVector const& x,
     MathLib::LinAlg::setLocalAccessibleVector(xdot);
 
     assembleWithJacobianConcreteProcess(t, x, xdot, dxdot_dx, dx_dx, M, K, b,
-                                       Jac);
+                                        Jac);
 
     // TODO apply BCs to Jacobian.
     _boundary_conditions.applyNaturalBC(t, x, K, b);
@@ -233,7 +232,8 @@ void Process::finishNamedFunctionsInitialization()
     _named_function_caller.applyPlugs();
 
     for (auto const& named_function :
-         _named_function_caller.getNamedFunctions()) {
+         _named_function_caller.getNamedFunctions())
+    {
         auto const& name = named_function.getName();
         _secondary_variables.addSecondaryVariable(
             name,
@@ -254,7 +254,7 @@ void Process::computeSparsityPattern()
 }
 
 void Process::preTimestep(GlobalVector const& x, const double t,
-                 const double delta_t)
+                          const double delta_t)
 {
     for (auto& cached_var : _cached_secondary_variables)
     {
@@ -278,10 +278,11 @@ void Process::computeSecondaryVariable(const double t, GlobalVector const& x)
     computeSecondaryVariableConcrete(t, x);
 }
 
-void Process::preIteration(const unsigned iter, const GlobalVector &x)
+void Process::preIteration(const unsigned iter, const GlobalVector& x)
 {
     // In every new iteration cached values of secondary variables are expired.
-    for (auto& cached_var : _cached_secondary_variables) {
+    for (auto& cached_var : _cached_secondary_variables)
+    {
         cached_var->updateCurrentSolution(x, *_local_to_global_index_map);
     }
 
@@ -289,7 +290,7 @@ void Process::preIteration(const unsigned iter, const GlobalVector &x)
     preIterationConcreteProcess(iter, x);
 }
 
-NumLib::IterationResult Process::postIteration(const GlobalVector &x)
+NumLib::IterationResult Process::postIteration(const GlobalVector& x)
 {
     MathLib::LinAlg::setLocalAccessibleVector(x);
     return postIterationConcreteProcess(x);
diff --git a/ProcessLib/Process.h b/ProcessLib/Process.h
index e2ec183a596..dacd9a79f76 100644
--- a/ProcessLib/Process.h
+++ b/ProcessLib/Process.h
@@ -71,7 +71,8 @@ public:
 
     MathLib::MatrixSpecifications getMatrixSpecifications() const final;
 
-    void setCoupledSolutionsForStaggeredScheme(CoupledSolutionsForStaggeredScheme* const coupled_solutions)
+    void setCoupledSolutionsForStaggeredScheme(
+        CoupledSolutionsForStaggeredScheme* const coupled_solutions)
     {
         _coupled_solutions = coupled_solutions;
     }
@@ -202,7 +203,8 @@ protected:
 
     VectorMatrixAssembler _global_assembler;
 
-    /// Pointer to CoupledSolutionsForStaggeredScheme, which contains the references to the
+    /// Pointer to CoupledSolutionsForStaggeredScheme, which contains the
+    /// references to the
     /// coupled processes and the references to the solutions of the coupled
     /// processes.
     CoupledSolutionsForStaggeredScheme* _coupled_solutions;
diff --git a/ProcessLib/UncoupledProcessesTimeLoop.cpp b/ProcessLib/UncoupledProcessesTimeLoop.cpp
index f7fbd419d8a..e031137c704 100644
--- a/ProcessLib/UncoupledProcessesTimeLoop.cpp
+++ b/ProcessLib/UncoupledProcessesTimeLoop.cpp
@@ -920,7 +920,8 @@ bool UncoupledProcessesTimeLoop::solveCoupledEquationSystemsByStaggeredScheme(
                 spd->coupled_processes,
                 _solutions_of_coupled_processes[pcs_idx], dt);
 
-            spd->process.setCoupledSolutionsForStaggeredScheme(&coupled_solutions);
+            spd->process.setCoupledSolutionsForStaggeredScheme(
+                &coupled_solutions);
 
             const auto nonlinear_solver_succeeded = solveOneTimeStepOneProcess(
                 x, timestep_id, t, dt, *spd, *_output);
@@ -1038,7 +1039,8 @@ void UncoupledProcessesTimeLoop::outputSolutions(
                 spd->coupled_processes,
                 _solutions_of_coupled_processes[pcs_idx], 0.0);
 
-            spd->process.setCoupledSolutionsForStaggeredScheme(&coupled_solutions);
+            spd->process.setCoupledSolutionsForStaggeredScheme(
+                &coupled_solutions);
             spd->process
                 .setCoupledSolutionsForStaggeredSchemeToLocalAssemblers();
             (output_object.*output_class_member)(pcs, spd->process_output,
-- 
GitLab