Skip to content

Commit 94cea34

Browse files
authored
Update clang-format to v0.20 (#1374)
* Update clang-format to v0.20. * Ignore warning in docs.
1 parent 59c7af5 commit 94cea34

File tree

100 files changed

+829
-603
lines changed

Some content is hidden

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

100 files changed

+829
-603
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ jobs:
1313
- name: Clone
1414
uses: actions/checkout@v4
1515
- name: Check formatting
16-
uses: DoozyX/clang-format-lint-action@v0.18.2
16+
uses: DoozyX/clang-format-lint-action@v0.20
1717
with:
1818
source: 'nalu.C unit_tests.C ./include ./src ./unit_tests'
1919
extensions: 'H,h,cpp,C'
20-
clangFormatVersion: 18
20+
clangFormatVersion: 20
2121
CPU-Trilinos:
2222
needs: Formatting
2323
runs-on: ubuntu-latest

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
- name: Report
4141
run: |
4242
echo "::add-matcher::.github/problem-matchers/sphinx.json"
43-
egrep "WARNING:|Warning:|ERROR:|Error:" build-output.txt | sort | uniq | \
43+
egrep "WARNING:|Warning:|ERROR:|Error:" build-output.txt | grep -v pkg_resources | sort | uniq | \
4444
awk 'BEGIN{i=0}{print $0}{i++}END{print "Warnings: "i}' > build-output-warnings.txt
4545
cat build-output-warnings.txt
4646
exit $(tail -n 1 build-output-warnings.txt | awk '{print $2}')

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,11 @@ enhancements, documentation updates, etc. All contributions are processed
8686
through pull-requests on GitHub. Please follow our [contributing
8787
guidelines](https://github.com/Exawind/nalu-wind/blob/master/CONTRIBUTING.md)
8888
when submitting pull-requests.
89+
90+
To pass the formatting check, use this with a new version of `clang-format`:
91+
```
92+
find nalu.C unit_tests.C ./include ./src ./unit_tests \( -name "*.cpp" -o -name "*.H" -o -name "*.h" -o -name "*.C" \) -exec clang-format -i {} +
93+
```
8994

9095
## License
9196

include/ElemDataRequestsGPU.h

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -235,14 +235,18 @@ inline ElemDataRequestsGPU::ElemDataRequestsGPU(
235235
totalNumFields(fieldMgr.size()),
236236
fields(),
237237
hostFields(),
238-
meFC_(MasterElementRepo::get_surface_dev_ptr_from_host_ptr(
239-
dataReq.get_cvfem_face_me())),
240-
meSCS_(MasterElementRepo::get_surface_dev_ptr_from_host_ptr(
241-
dataReq.get_cvfem_surface_me())),
242-
meSCV_(MasterElementRepo::get_volume_dev_ptr_from_host_ptr(
243-
dataReq.get_cvfem_volume_me())),
244-
meFEM_(MasterElementRepo::get_volume_dev_ptr_from_host_ptr(
245-
dataReq.get_fem_volume_me()))
238+
meFC_(
239+
MasterElementRepo::get_surface_dev_ptr_from_host_ptr(
240+
dataReq.get_cvfem_face_me())),
241+
meSCS_(
242+
MasterElementRepo::get_surface_dev_ptr_from_host_ptr(
243+
dataReq.get_cvfem_surface_me())),
244+
meSCV_(
245+
MasterElementRepo::get_volume_dev_ptr_from_host_ptr(
246+
dataReq.get_cvfem_volume_me())),
247+
meFEM_(
248+
MasterElementRepo::get_volume_dev_ptr_from_host_ptr(
249+
dataReq.get_fem_volume_me()))
246250
{
247251
fill_host_data_enums(dataReq, CURRENT_COORDINATES);
248252
fill_host_data_enums(dataReq, MODEL_COORDINATES);

include/HypreLinearSystem.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,9 @@ class HypreLinearSystem : public LinearSystem
177177
// Quiet "partially overridden" compiler warnings.
178178
using LinearSystem::buildDirichletNodeGraph;
179179
// Graph/Matrix Construction
180-
virtual void
181-
buildNodeGraph(const stk::mesh::PartVector&
182-
parts); // for nodal assembly (e.g., lumped mass and source)
180+
virtual void buildNodeGraph(
181+
const stk::mesh::PartVector&
182+
parts); // for nodal assembly (e.g., lumped mass and source)
183183
virtual void buildFaceToNodeGraph(
184184
const stk::mesh::PartVector& parts); // face->node assembly
185185
virtual void buildEdgeToNodeGraph(

include/HypreUVWLinearSystem.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ class HypreUVWLinearSystem : public HypreLinearSystem
2828
virtual ~HypreUVWLinearSystem();
2929

3030
// Graph/Matrix Construction
31-
virtual void
32-
buildNodeGraph(const stk::mesh::PartVector&
33-
parts); // for nodal assembly (e.g., lumped mass and source)
31+
virtual void buildNodeGraph(
32+
const stk::mesh::PartVector&
33+
parts); // for nodal assembly (e.g., lumped mass and source)
3434
virtual void buildFaceToNodeGraph(
3535
const stk::mesh::PartVector& parts); // face->node assembly
3636
virtual void buildEdgeToNodeGraph(

include/TpetraSegregatedLinearSystem.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ class TpetraSegregatedLinearSystem : public LinearSystem
5959
~TpetraSegregatedLinearSystem();
6060

6161
// Graph/Matrix Construction
62-
void
63-
buildNodeGraph(const stk::mesh::PartVector&
64-
parts); // for nodal assembly (e.g., lumped mass and source)
62+
void buildNodeGraph(
63+
const stk::mesh::PartVector&
64+
parts); // for nodal assembly (e.g., lumped mass and source)
6565
void buildFaceToNodeGraph(
6666
const stk::mesh::PartVector& parts); // face->node assembly
6767
void buildEdgeToNodeGraph(

include/master_element/Hex8CVFEM.h

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -323,36 +323,37 @@ class HexSCS : public MasterElement
323323
-0.50, 0.50, 0.00}; // surf 12 4->8
324324

325325
// exposed face
326-
const double intgExpFace_[6][4][3] = {// face 0; scs 0, 1, 2, 3
327-
{{-0.25, -0.50, -0.25},
328-
{0.25, -0.50, -0.25},
329-
{0.25, -0.50, 0.25},
330-
{-0.25, -0.50, 0.25}},
331-
// face 1; scs 0, 1, 2, 3
332-
{{0.50, -0.25, -0.25},
333-
{0.50, 0.25, -0.25},
334-
{0.50, 0.25, 0.25},
335-
{0.50, -0.25, 0.25}},
336-
// face 2; scs 0, 1, 2, 3
337-
{{0.25, 0.50, -0.25},
338-
{-0.25, 0.50, -0.25},
339-
{-0.25, 0.50, 0.25},
340-
{0.25, 0.50, 0.25}},
341-
// face 3; scs 0, 1, 2, 3
342-
{{-0.50, -0.25, -0.25},
343-
{-0.50, -0.25, 0.25},
344-
{-0.50, 0.25, 0.25},
345-
{-0.50, 0.25, -0.25}},
346-
// face 4; scs 0, 1, 2, 3
347-
{{-0.25, -0.25, -0.50},
348-
{-0.25, 0.25, -0.50},
349-
{0.25, 0.25, -0.50},
350-
{0.25, -0.25, -0.50}},
351-
// face 5; scs 0, 1, 2, 3
352-
{{-0.25, -0.25, 0.50},
353-
{0.25, -0.25, 0.50},
354-
{0.25, 0.25, 0.50},
355-
{-0.25, 0.25, 0.50}}};
326+
const double intgExpFace_[6][4][3] = {
327+
// face 0; scs 0, 1, 2, 3
328+
{{-0.25, -0.50, -0.25},
329+
{0.25, -0.50, -0.25},
330+
{0.25, -0.50, 0.25},
331+
{-0.25, -0.50, 0.25}},
332+
// face 1; scs 0, 1, 2, 3
333+
{{0.50, -0.25, -0.25},
334+
{0.50, 0.25, -0.25},
335+
{0.50, 0.25, 0.25},
336+
{0.50, -0.25, 0.25}},
337+
// face 2; scs 0, 1, 2, 3
338+
{{0.25, 0.50, -0.25},
339+
{-0.25, 0.50, -0.25},
340+
{-0.25, 0.50, 0.25},
341+
{0.25, 0.50, 0.25}},
342+
// face 3; scs 0, 1, 2, 3
343+
{{-0.50, -0.25, -0.25},
344+
{-0.50, -0.25, 0.25},
345+
{-0.50, 0.25, 0.25},
346+
{-0.50, 0.25, -0.25}},
347+
// face 4; scs 0, 1, 2, 3
348+
{{-0.25, -0.25, -0.50},
349+
{-0.25, 0.25, -0.50},
350+
{0.25, 0.25, -0.50},
351+
{0.25, -0.25, -0.50}},
352+
// face 5; scs 0, 1, 2, 3
353+
{{-0.25, -0.25, 0.50},
354+
{0.25, -0.25, 0.50},
355+
{0.25, 0.25, 0.50},
356+
{-0.25, 0.25, 0.50}}};
356357

357358
const double intgExpFaceShift_[6][4][3] = {
358359
{{-0.5, -0.5, -0.5},
@@ -372,15 +373,14 @@ class HexSCS : public MasterElement
372373
{{-0.5, -0.5, 0.5}, {0.5, -0.5, 0.5}, {0.5, 0.5, 0.5}, {-0.5, 0.5, 0.5}}};
373374

374375
// nodes for collocation calculations
375-
const double nodeLoc_[8][3] = {
376-
/* node 0 */ {-0.5, -0.5, -0.5},
377-
/* node 1 */ {0.5, -0.5, -0.5},
378-
/* node 2 */ {0.5, 0.5, -0.5},
379-
/* node 3 */ {-0.5, 0.5, -0.5},
380-
/* node 4 */ {-0.5, -0.5, 0.5},
381-
/* node 5 */ {0.5, -0.5, 0.5},
382-
/* node 6 */ {0.5, 0.5, 0.5},
383-
/* node 7 */ {-0.5, 0.5, 0.5}};
376+
const double nodeLoc_[8][3] = {/* node 0 */ {-0.5, -0.5, -0.5},
377+
/* node 1 */ {0.5, -0.5, -0.5},
378+
/* node 2 */ {0.5, 0.5, -0.5},
379+
/* node 3 */ {-0.5, 0.5, -0.5},
380+
/* node 4 */ {-0.5, -0.5, 0.5},
381+
/* node 5 */ {0.5, -0.5, 0.5},
382+
/* node 6 */ {0.5, 0.5, 0.5},
383+
/* node 7 */ {-0.5, 0.5, 0.5}};
384384

385385
// mapping from a side ordinal to the node ordinals on that side
386386
const int sideNodeOrdinals_[6][4] = {

include/master_element/Pyr5CVFEM.h

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -298,16 +298,17 @@ class PyrSCS : public MasterElement
298298

299299
// define opposing node
300300
// opposing node for node 4 is never uniquely defined: pick one
301-
const int oppNode_[20] = {// face 0; nodes 0,1,4
302-
3, 2, 2, -1,
303-
// face 1; nodes 1,2,4
304-
0, 3, 3, -1,
305-
// face 2; nodes 2,3,4
306-
1, 0, 0, -1,
307-
// face 3; nodes 0,4,3
308-
1, 1, 2, -1,
309-
// face 4; nodes 0,3,2,1
310-
4, 4, 4, 4};
301+
const int oppNode_[20] = {
302+
// face 0; nodes 0,1,4
303+
3, 2, 2, -1,
304+
// face 1; nodes 1,2,4
305+
0, 3, 3, -1,
306+
// face 2; nodes 2,3,4
307+
1, 0, 0, -1,
308+
// face 3; nodes 0,4,3
309+
1, 1, 2, -1,
310+
// face 4; nodes 0,3,2,1
311+
4, 4, 4, 4};
311312

312313
#if 0
313314
// define opposing face
@@ -408,16 +409,17 @@ class PyrSCS : public MasterElement
408409
// face 4, nodes 0,3,2,1, scs 0, 1, 2
409410
-0.5, -0.5, 0.0, -0.5, 0.5, 0.0, 0.5, 0.5, 0.0, 0.5, -0.5, 0.0};
410411

411-
const int ipNodeMap_[16] = {// Face 0
412-
0, 1, 4,
413-
// Face 1
414-
1, 2, 4,
415-
// Face 2
416-
2, 3, 4,
417-
// Face 3
418-
0, 4, 3,
419-
// Face 4 (quad face)
420-
0, 3, 2, 1};
412+
const int ipNodeMap_[16] = {
413+
// Face 0
414+
0, 1, 4,
415+
// Face 1
416+
1, 2, 4,
417+
// Face 2
418+
2, 3, 4,
419+
// Face 3
420+
0, 4, 3,
421+
// Face 4 (quad face)
422+
0, 3, 2, 1};
421423

422424
double intgExpFaceShift_[48] = {0};
423425

include/master_element/Quad42DCVFEM.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -285,11 +285,12 @@ class Quad42DSCS : public MasterElement
285285

286286
// boundary integration point ip node mapping (ip on an ordinal to local node
287287
// number)
288-
const int ipNodeMap_[4][2] = { // 2 ips * 4 faces
289-
{0, 1}, // face 0;
290-
{1, 2}, // face 1;
291-
{2, 3}, // face 2;
292-
{3, 0}}; // face 3;
288+
const int ipNodeMap_[4][2] = {
289+
// 2 ips * 4 faces
290+
{0, 1}, // face 0;
291+
{1, 2}, // face 1;
292+
{2, 3}, // face 2;
293+
{3, 0}}; // face 3;
293294

294295
const int sideNodeOrdinals_[4][2] = {{0, 1}, {1, 2}, {2, 3}, {3, 0}};
295296

0 commit comments

Comments
 (0)