Skip to content

Commit 1bc3e8f

Browse files
Merge pull request #699 from davidrudlstorfer/update_pre_commit_hooks
Update pre commit hooks
2 parents 2c2aae1 + 73b03fb commit 1bc3e8f

File tree

65 files changed

+624
-651
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+624
-651
lines changed

.pre-commit-config.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/pre-commit/mirrors-clang-format
3-
rev: v19.1.6
3+
rev: v20.1.0
44
hooks:
55
- id: clang-format
66
name: Format C/C++
@@ -17,13 +17,13 @@ repos:
1717
additional_dependencies: [pyyaml>=5.1]
1818

1919
- repo: https://github.com/psf/black-pre-commit-mirror
20-
rev: 22.3.0
20+
rev: 25.1.0
2121
hooks:
2222
- id: black
2323
name: Format python
2424

2525
- repo: https://github.com/pamoller/xmlformatter
26-
rev: v0.2.6
26+
rev: v0.2.8
2727
hooks:
2828
- id: xml-formatter
2929
name: Format xml
@@ -32,14 +32,14 @@ repos:
3232
files: \.xml$
3333

3434
- repo: https://github.com/google/yamlfmt
35-
rev: v0.12.1
35+
rev: v0.16.0
3636
hooks:
3737
- id: yamlfmt
3838
name: Format yaml
3939
args: [-conf, utilities/code_checks/.yamlfmt.yaml]
4040

4141
- repo: https://github.com/pre-commit/pre-commit-hooks
42-
rev: v4.5.0
42+
rev: v5.0.0
4343
hooks:
4444
- id: trailing-whitespace
4545
name: Trim trailing whitespace
@@ -73,7 +73,7 @@ repos:
7373
- --detect-license-in-X-top-lines=3
7474

7575
- repo: https://github.com/crate-ci/typos
76-
rev: v1.28.4
76+
rev: v1.31.1
7777
hooks:
7878
- id: typos
7979
name: Check for typos in code

.typos.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ ue = "ue" # elastic stretch tensor
1111
ser = "ser" # "switched evolution relaxation" (used for pseudo transient continuation)
1212
ded = "ded" # derivative w.r.t. electrode variables
1313
uncomplete = "uncomplete" # used in the context of the uncomplete() call fo a sparse matrix
14+
Comput = "Comput" # abbreviation Comput. for Computational / Computing (typo fix cannot contain .)
1415

1516
# German words we want to keep as is.
1617
Interaktion = "Interaktion"

src/beam3/4C_beam3_euler_bernoulli.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ void Discret::Elements::Beam3eb::set_up_reference_geometry(
457457
std::fill(bending_moment_gp_.begin(), bending_moment_gp_.end(), 0.0);
458458

459459

460-
// create Matrix for the derivates of the shapefunctions at the GP
460+
// create Matrix for the derivatives of the shapefunctions at the GP
461461
Core::LinAlg::Matrix<1, nnode> shapefuncderiv;
462462

463463
// Loop through all GPs and compute jacobi at the GPs

src/beamcontact/4C_beamcontact_beam3contact.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4026,7 +4026,7 @@ void CONTACT::Beam3contact<numnodes, numnodalvalues>::compute_lin_eta_fix_xi(
40264026
// std::cout << "r2_xi: " << r2_xi << std::endl;
40274027
// std::cout << "r2_xixi: " << r2_xixi << std::endl;
40284028

4029-
if (fabs(Core::FADUtils::cast_to_double(L)) < COLINEARTOL)
4029+
if (fabs(Core::FADUtils::cast_to_double(L)) < COLLINEARTOL)
40304030
FOUR_C_THROW("Linearization of point to line projection is zero, choose tighter search boxes!");
40314031

40324032
for (int i = 0; i < 3; i++)
@@ -4080,7 +4080,7 @@ void CONTACT::Beam3contact<numnodes, numnodalvalues>::compute_lin_xi_fix_eta(
40804080
L = Core::FADUtils::scalar_product(r1_xi, r1_xi) +
40814081
Core::FADUtils::scalar_product(delta_r, r1_xixi);
40824082

4083-
if (fabs(Core::FADUtils::cast_to_double(L)) < COLINEARTOL)
4083+
if (fabs(Core::FADUtils::cast_to_double(L)) < COLLINEARTOL)
40844084
FOUR_C_THROW("Linearization of point to line projection is zero, choose tighter search boxes!");
40854085

40864086
for (int i = 0; i < 3; i++)
@@ -4895,7 +4895,7 @@ void CONTACT::Beam3contact<numnodes, numnodalvalues>::evaluate_lin_orthogonality
48954895
}
48964896

48974897
// Inverting (2x2) matrix df by hard coded formula, so that it is
4898-
// possible to handle colinear vectors, because they lead to det(df) =0
4898+
// possible to handle collinear vectors, because they lead to det(df) =0
48994899
TYPE det_df = df(0, 0) * df(1, 1) - df(1, 0) * df(0, 1);
49004900

49014901
//********************************************************************
@@ -4907,7 +4907,7 @@ void CONTACT::Beam3contact<numnodes, numnodalvalues>::evaluate_lin_orthogonality
49074907
//********************************************************************
49084908

49094909
// singular df
4910-
if (Core::FADUtils::cast_to_double(Core::FADUtils::norm(det_df)) < COLINEARTOL)
4910+
if (Core::FADUtils::cast_to_double(Core::FADUtils::norm(det_df)) < COLLINEARTOL)
49114911
{
49124912
// sort out
49134913
elementscolinear = true;
@@ -4998,7 +4998,7 @@ bool CONTACT::Beam3contact<numnodes, numnodalvalues>::evaluate_lin_ptl_orthogona
49984998
// check, if df=0: This can happen e.g. when the master beam 2 describes a circle geometry and the
49994999
// projectiong slave point coincides with the cetern of the circle
50005000

5001-
if (fabs(Core::FADUtils::cast_to_double(df)) < COLINEARTOL)
5001+
if (fabs(Core::FADUtils::cast_to_double(df)) < COLLINEARTOL)
50025002
return false;
50035003
else
50045004
return true;

src/beamcontact/4C_beamcontact_beam3contact_manager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2137,7 +2137,7 @@ void CONTACT::Beam3cmanager::transform_angle_to_triad(
21372137
for (int i = 0; i < 3; i++)
21382138
for (int j = 0; j < 3; j++)
21392139
R(i, j) = identity(i, j) + spin(i, j) * (sin(theta_abs)) / theta_abs +
2140-
(1 - (cos(theta_abs))) / (pow(theta_abs, 2))*spin2(i, j);
2140+
(1 - (cos(theta_abs))) / (pow(theta_abs, 2)) * spin2(i, j);
21412141

21422142
return;
21432143
}

src/beamcontact/4C_beamcontact_beam3contactnew.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ void CONTACT::Beam3contactnew<numnodes, numnodalvalues>::evaluate_stiffc_contact
577577

578578
// if the bool inactivestiff is true, the contact stiffness will always be applied in the first
579579
// Newton steps for pair which have been active in the last time step (even when they are
580-
// currentely not active) -> This makes the algorithm more robust.
580+
// currently not active) -> This makes the algorithm more robust.
581581
const bool inactivestiff = bcparams_.get<bool>("BEAMS_INACTIVESTIFF");
582582

583583
// In order to accelerate convergence, we only apply the basic stiffness part in case of very
@@ -2442,7 +2442,7 @@ void CONTACT::Beam3contactnew<numnodes, numnodalvalues>::calc_penalty_law()
24422442
{
24432443
// if the bool inactivestiff is true, the contact stiffness will always be applied in the first
24442444
// Newton steps for pair which have been active in the last time step (even when they are
2445-
// currentely not active) -> This makes the algorithm more robust.
2445+
// currently not active) -> This makes the algorithm more robust.
24462446
const bool inactivestiff = bcparams_.get<bool>("BEAMS_INACTIVESTIFF");
24472447

24482448
if (contactflag_ or (iter_ == 0 and inactivestiff and oldcontactflag_))
@@ -3069,7 +3069,7 @@ void CONTACT::Beam3contactnew<numnodes, numnodalvalues>::evaluate_lin_orthogonal
30693069
}
30703070

30713071
// Inverting (2x2) matrix df by hard coded formula, so that it is
3072-
// possible to handle colinear vectors, because they lead to det(df) =0
3072+
// possible to handle collinear vectors, because they lead to det(df) =0
30733073
TYPE det_df = df(0, 0) * df(1, 1) - df(1, 0) * df(0, 1);
30743074

30753075
//********************************************************************
@@ -3081,7 +3081,7 @@ void CONTACT::Beam3contactnew<numnodes, numnodalvalues>::evaluate_lin_orthogonal
30813081
//********************************************************************
30823082

30833083
// singular df
3084-
if (Core::FADUtils::cast_to_double(Core::FADUtils::norm(det_df)) < COLINEARTOL)
3084+
if (Core::FADUtils::cast_to_double(Core::FADUtils::norm(det_df)) < COLLINEARTOL)
30853085
{
30863086
// sort out
30873087
elementscolinear_ = true;

src/beamcontact/4C_beamcontact_beam3tosolidcontact.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1879,7 +1879,7 @@ void CONTACT::Beam3tosolidcontact<numnodessol, numnodes, numnodalvalues>::projec
18791879
TYPEBTS residual = 0.0;
18801880

18811881

1882-
// Local netwon iteration
1882+
// Local newton iteration
18831883
// -----------------------------------------------------------------
18841884

18851885
int iter;
@@ -1979,13 +1979,13 @@ void CONTACT::Beam3tosolidcontact<numnodessol, numnodes, numnodalvalues>::projec
19791979
#endif
19801980

19811981
// Inverting 2x2-matrix J by hard coded formula, so that it is possible
1982-
// to handle colinear vectors, because they lead to det(J) = 0
1982+
// to handle collinear vectors, because they lead to det(J) = 0
19831983
TYPEBTS det_J = J(0, 0) * J(1, 1) - J(1, 0) * J(0, 1);
19841984

19851985
// If det_J = 0 we assume, that the beam centerline and the surface edge are parallel.
19861986
// These projection is not needed due the fact that the contact interval can also be
19871987
// identified by two contact interval borders found with the GetContactLines method
1988-
parallel = Core::FADUtils::cast_to_double(Core::FADUtils::norm(det_J)) < COLINEARTOL;
1988+
parallel = Core::FADUtils::cast_to_double(Core::FADUtils::norm(det_J)) < COLLINEARTOL;
19891989

19901990
// Check if the local Newton iteration has converged
19911991
// If the start point fulfills the orthogonalty conditions (residual < BEAMCONTACTTOL), we also

src/beaminteraction/src/4C_beaminteraction_beam_to_beam_contact_defines.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ FOUR_C_NAMESPACE_OPEN
5353
#define SHIFTVALUE \
5454
1.0e-7 /* value, one contact point will be shiftet, if contact points are to close */
5555
// default: 1.0e-7
56-
#define COLINEARTOL 1.0e-12 /* tolerance when two elements are almost colinear */
56+
#define COLLINEARTOL 1.0e-12 /* tolerance when two elements are almost collinear */
5757
// default: 1.0e-12
5858
#define DETERMINANTTOL \
5959
1.0e-12 /* tolerance how small the determinant appearing in the contact point linearization is \

src/beaminteraction/src/4C_beaminteraction_beam_to_beam_contact_pair.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3981,7 +3981,7 @@ void BeamInteraction::BeamToBeamContactPair<numnodes, numnodalvalues>::compute_l
39813981
// std::cout << "r2_xi: " << r2_xi << std::endl;
39823982
// std::cout << "r2_xixi: " << r2_xixi << std::endl;
39833983

3984-
if (fabs(Core::FADUtils::cast_to_double(L)) < COLINEARTOL)
3984+
if (fabs(Core::FADUtils::cast_to_double(L)) < COLLINEARTOL)
39853985
FOUR_C_THROW("Linearization of point to line projection is zero, choose tighter search boxes!");
39863986

39873987
for (unsigned int i = 0; i < 3; i++)
@@ -4035,7 +4035,7 @@ void BeamInteraction::BeamToBeamContactPair<numnodes, numnodalvalues>::compute_l
40354035
L = Core::FADUtils::scalar_product(r1_xi, r1_xi) +
40364036
Core::FADUtils::scalar_product(delta_r, r1_xixi);
40374037

4038-
if (fabs(Core::FADUtils::cast_to_double(L)) < COLINEARTOL)
4038+
if (fabs(Core::FADUtils::cast_to_double(L)) < COLLINEARTOL)
40394039
FOUR_C_THROW("Linearization of point to line projection is zero, choose tighter search boxes!");
40404040

40414041
for (unsigned int i = 0; i < 3; i++)
@@ -4713,7 +4713,7 @@ void BeamInteraction::BeamToBeamContactPair<numnodes,
47134713

47144714

47154715
// Inverting (2x2) matrix df by hard coded formula, so that it is
4716-
// possible to handle colinear vectors, because they lead to det(df) =0
4716+
// possible to handle collinear vectors, because they lead to det(df) =0
47174717
TYPE det_df = df(0, 0) * df(1, 1) - df(1, 0) * df(0, 1);
47184718

47194719
//********************************************************************
@@ -4725,7 +4725,7 @@ void BeamInteraction::BeamToBeamContactPair<numnodes,
47254725
//********************************************************************
47264726

47274727
// singular df
4728-
if (Core::FADUtils::cast_to_double(Core::FADUtils::norm(det_df)) < COLINEARTOL)
4728+
if (Core::FADUtils::cast_to_double(Core::FADUtils::norm(det_df)) < COLLINEARTOL)
47294729
{
47304730
// sort out
47314731
elementscolinear = true;
@@ -4818,7 +4818,7 @@ bool BeamInteraction::BeamToBeamContactPair<numnodes,
48184818
// check, if df=0: This can happen e.g. when the master beam 2 describes a circle geometry and the
48194819
// projectiong slave point coincides with the cetern of the circle
48204820

4821-
if (fabs(Core::FADUtils::cast_to_double(df)) < COLINEARTOL)
4821+
if (fabs(Core::FADUtils::cast_to_double(df)) < COLLINEARTOL)
48224822
return false;
48234823
else
48244824
return true;

src/beaminteraction/src/4C_beaminteraction_beam_to_sphere_contact_pair.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ void BeamInteraction::BeamToSphereContactPair<numnodes, numnodalvalues>::closest
378378
evaluate_lin_orthogonality_condition(df, delta_x, norm_delta_x, dx1, ddx1);
379379

380380
// singular df
381-
if (abs(df) < COLINEARTOL)
381+
if (abs(df) < COLLINEARTOL)
382382
{
383383
FOUR_C_THROW("No solution for Closest Point Projection!");
384384
}

0 commit comments

Comments
 (0)