Skip to content

Commit

Permalink
apply clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas-Ulrich committed Nov 6, 2024
1 parent 65fa69e commit c812a5f
Show file tree
Hide file tree
Showing 26 changed files with 1,401 additions and 1,022 deletions.
2 changes: 1 addition & 1 deletion app/common/PetscInterplMatrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ PetscInterplMatrix::PetscInterplMatrix(std::size_t rowBlockSize, std::size_t col
CHKERRTHROW(MatSetSizes(A_, localRows, localCols, PETSC_DETERMINE, PETSC_DETERMINE));
CHKERRTHROW(MatSetBlockSizes(A_, rowBlockSize, columnBlockSize));
CHKERRTHROW(MatSetType(A_, MATAIJ));
CHKERRTHROW(MatSetFromOptions(A_));
CHKERRTHROW(MatSetFromOptions(A_));

// Local to global mapping
PetscInt* l2g;
Expand Down
4 changes: 2 additions & 2 deletions app/common/PetscLinearSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ void PetscLinearSolver::setup_mg(AbstractDGOperator<DomainDimension>& dgop, PC p
CHKERRTHROW(PCMGSetInterpolation(pc, l + 1, I.mat()));

// Construct coarse level operator via A_c = Pt A P
//Mat A_l;
//CHKERRTHROW(MatPtAP(A_lp1, I.mat(), MAT_INITIAL_MATRIX, PETSC_DEFAULT, &A_l));
// Mat A_l;
// CHKERRTHROW(MatPtAP(A_lp1, I.mat(), MAT_INITIAL_MATRIX, PETSC_DEFAULT, &A_l));

// PETSc manpage for MatPtAP() states that For matrix types without a
// special implementation of PtAP, MatPtAP() fallbacks back to
Expand Down
2 changes: 1 addition & 1 deletion app/common/PetscUtil.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
} \
} while (false)

#define HASH_DEF(def) ::tndm::fnv1a((def), sizeof(def)-1)
#define HASH_DEF(def) ::tndm::fnv1a((def), sizeof(def) - 1)

namespace tndm {

Expand Down
2 changes: 1 addition & 1 deletion app/localoperator/DieterichRuinaAgeing.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class DieterichRuinaAgeing {
V = Finv(index, snAbs, tauAbs, psi);
} else {
if (snAbs <= 0.0) { /* Implies the fault is experiencing tension / opening */
snAbs = 0.0; /* Just to illustrate what we are doing */
snAbs = 0.0; /* Just to illustrate what we are doing */
/* Solve R(V) = T - sigma_n F(V,psi) - eta V with sigma_n = 0.0 */
V = tauAbs / eta;
} else {
Expand Down
12 changes: 6 additions & 6 deletions app/localoperator/RateAndState.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ template <class Law> class RateAndState : public RateAndStateBase {
std::function<std::array<double, 1>(std::array<double, DomainDimension + 1> const&)>;
using delta_tau_fun_t = std::function<std::array<double, TangentialComponents>(
std::array<double, DomainDimension + 1> const&)>;
using delta_sn_fun_t = std::function<std::array<double, 1>(std::array<double, DomainDimension + 1> const&)>;
using delta_sn_fun_t =
std::function<std::array<double, 1>(std::array<double, DomainDimension + 1> const&)>;

void set_constant_params(typename Law::ConstantParams const& cps) {
law_.set_constant_params(cps);
Expand Down Expand Up @@ -98,7 +99,6 @@ template <class Law> class RateAndState : public RateAndStateBase {
return (*delta_sn_)(xt)[0];
}


Law law_;
std::optional<source_fun_t> source_;
std::optional<delta_tau_fun_t> delta_tau_;
Expand Down Expand Up @@ -157,9 +157,9 @@ double RateAndState<Law>::rhs(double time, std::size_t faultNo,
auto t_mat = traction_mat(traction);
for (std::size_t node = 0; node < nbf; ++node) {
auto sn = t_mat(node, 0);
if (delta_sn_) {
if (delta_sn_) {
sn = sn + get_delta_sn(time, faultNo, node);
}
}
auto psi = s_mat(node, PsiIndex);
auto tau = get_tau(node, t_mat);
if (delta_tau_) {
Expand Down Expand Up @@ -218,9 +218,9 @@ void RateAndState<Law>::state(double time, std::size_t faultNo,
std::size_t index = faultNo * nbf;
for (std::size_t node = 0; node < nbf; ++node) {
auto sn = t_mat(node, 0);
if (delta_sn_) {
if (delta_sn_) {
sn = sn + get_delta_sn(time, faultNo, node);
}
}
auto tau = get_tau(node, t_mat);
if (delta_tau_) {
tau = tau + get_delta_tau(time, faultNo, node);
Expand Down
2 changes: 1 addition & 1 deletion app/pc/lspoly.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include <petsc/private/kspimpl.h>
#include <petsc/private/pcimpl.h>
#include <petscksp.h>
#include <petscsys.h>
#include <petscpc.h>
#include <petscsys.h>

typedef struct {
PetscReal alpha, beta; /* Coefficients of w(x) = (1-x)^\alpha (1+x)^\beta */
Expand Down
2 changes: 1 addition & 1 deletion app/pc/register.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ namespace tndm {

PetscErrorCode register_PCs();
PetscErrorCode register_KSPs();
}
} // namespace tndm

#endif // REGISTER_20210208_H
Loading

0 comments on commit c812a5f

Please sign in to comment.