From 1be5a6d1ce7aa52abc9efcca5c04a8a93147efa6 Mon Sep 17 00:00:00 2001 From: itchinda Date: Sun, 31 May 2026 12:41:15 -0400 Subject: [PATCH] CHORE(CORE): add standard git hooks for code quality --- .githooks/commit-msg | 42 +++++ .githooks/post-commit | 21 +++ .githooks/pre-commit | 168 ++++++++++++++++++ CMakeLists.txt | 19 +- .../expressions/include/AlgebraicSimplifier.h | 3 +- libs/expressions/include/BinaryExpression.h | 11 +- libs/expressions/include/CachedExpression.h | 3 +- libs/expressions/include/CfemExpression.h | 13 +- libs/expressions/include/ConstantExpression.h | 15 +- .../include/DivergenceExpression.h | 11 +- .../expressions/include/EvalContext_Archive.h | 12 +- .../include/GeometricNormalExpression.h | 2 +- libs/expressions/include/GradExpression.h | 9 +- libs/expressions/include/LambdaExpression.h | 3 +- .../include/MagnitudeSqExpression.h | 11 +- libs/expressions/include/MathOperators.h | 5 +- libs/expressions/include/ScaledExpression.h | 5 +- libs/expressions/include/TensorExpression.h | 11 +- libs/expressions/include/UnaryExpression.h | 9 +- libs/expressions/include/UnaryExpression.tpp | 2 +- libs/expressions/include/VariableExpression.h | 11 +- libs/expressions/include/VectorExpression.h | 11 +- libs/expressions/include/ZeroExpression.h | 9 +- .../symengine/ScalarSymbolicExpression.h | 19 +- .../include/symengine/SymEngineSymbols.h | 15 +- .../include/symengine/SymbolicEvaluator.h | 4 +- .../symengine/TensorSymbolicExpression.h | 13 +- .../symengine/VectorSymbolicExpression.h | 11 +- libs/expressions/src/AlgebraicSimplifier.cpp | 13 +- libs/expressions/src/BinaryExpression.cpp | 2 +- libs/expressions/src/MathOperators.cpp | 15 +- libs/expressions/src/TensorExpression.cpp | 2 +- libs/expressions/src/UnaryExpression.cpp | 2 +- libs/expressions/src/VectorExpression.cpp | 17 +- .../symengine/ScalarSymbolicExpression.cpp | 2 +- .../symengine/TensorSymbolicExpression.cpp | 2 +- .../symengine/VectorSymbolicExpression.cpp | 6 +- .../include/MagneticCurlCurlWFTerm.h | 18 ++ .../src/MagneticCurlCurlWFTerm.cpp | 18 ++ .../include/FluidViscosityWFTerm.h | 18 ++ .../src/FluidViscosityWFTerm.cpp | 18 ++ .../terms/general/include/DiffusionWFTerm.h | 18 ++ .../terms/general/src/DiffusionWFTerm.cpp | 18 ++ .../include/ElasticStiffnessWFTerm.h | 18 ++ .../src/ElasticStiffnessWFTerm.cpp | 18 ++ libs/fem/exportation/include/MeshExporter.h | 7 +- libs/fem/exportation/include/VTKExporter.h | 5 +- .../exportation/include/VTKFamilyExporter.h | 5 +- libs/fem/exportation/include/VTUExporter.h | 5 +- libs/fem/exportation/src/MeshExporter.cpp | 9 +- libs/fem/exportation/src/VTKExporter.cpp | 7 +- .../fem/exportation/src/VTKFamilyExporter.cpp | 5 +- libs/fem/exportation/src/VTUExporter.cpp | 10 +- libs/fem/fefield/include/Argument.h | 11 +- libs/fem/fefield/include/FEField.h | 22 +-- libs/fem/fefield/include/FEField.tpp | 6 +- libs/fem/fefield/src/FEField.cpp | 8 +- libs/fem/fespace/include/DGSpace.h | 3 +- libs/fem/fespace/include/FESpace.h | 8 +- libs/fem/fespace/include/LagrangeSpace.h | 5 +- libs/fem/fespace/src/LagrangeSpace.cpp | 10 +- libs/fem/mesh/include/EntityOps.h | 7 +- libs/fem/mesh/include/GmshParser.h | 13 +- libs/fem/mesh/include/Mesh.h | 22 ++- libs/fem/mesh/include/Mesh.tpp | 2 +- libs/fem/mesh/include/MeshConformityChecker.h | 5 +- libs/fem/mesh/include/MeshEntity.h | 5 +- libs/fem/mesh/include/MeshQualityTool.h | 3 +- .../include/builders/AnnulusMeshBuilder.h | 5 +- .../mesh/include/builders/BlockMeshBuilder.h | 4 +- .../include/builders/CylinderMeshBuilder.h | 13 +- .../mesh/include/builders/DiskMeshBuilder.h | 11 +- .../builders/HollowCylinderMeshBuilder.h | 13 +- .../mesh/include/builders/LineMeshBuilder.h | 4 +- .../mesh/include/builders/QuadMeshBuilder.h | 4 +- .../include/builders/SolidSphereBuilder.h | 2 +- .../include/builders/SurfaceSphereBuilder.h | 2 +- libs/fem/mesh/src/GmshParser.cpp | 4 +- libs/fem/mesh/src/Mesh.cpp | 18 +- libs/fem/mesh/src/MeshConformityChecker.cpp | 7 +- libs/fem/mesh/src/MeshEntity.cpp | 6 +- libs/fem/mesh/src/MeshQualityTool.cpp | 2 +- .../mesh/src/builders/SolidSphereBuilder.cpp | 3 +- .../src/builders/SurfaceSphereBuilder.cpp | 3 +- libs/fem/quadrature/include/Quadrature.h | 7 +- .../include/ReferenceElement.h | 11 +- .../include/ReferenceElementFactory.h | 2 +- .../include/ReferenceElements.h | 8 +- .../include/ReferenceHexahedron.h | 4 +- .../include/ReferencePrism.h | 3 +- .../reference_element/include/ReferenceQuad.h | 3 +- .../include/ReferenceSegment.h | 3 +- .../include/ReferenceTetrahedron.h | 5 +- .../include/ReferenceTriangle.h | 8 +- .../src/ReferenceElementFactory.cpp | 2 +- libs/kernel/include/EvalContext.h | 60 +++---- libs/kernel/include/EvaluationFlags.h | 3 +- libs/kernel/include/MappingInfo.h | 31 +++- libs/kernel/include/MappingInfoBatch.h | 10 +- libs/kernel/include/MappingInfoBatchView.h | 5 +- libs/kernel/include/ShapeInfo.h | 7 +- libs/kernel/include/ShapeInfoBatch.h | 7 +- .../include/ScalarFunctionalEvaluator.h | 13 +- .../src/ScalarFunctionalEvaluator.cpp | 20 +-- libs/utils/include/CfemLogger.h | 3 +- libs/utils/include/ChronoManager.h | 7 +- libs/utils/include/ContractException.h | 6 +- libs/utils/include/DynamicMatrix.h | 13 +- libs/utils/include/DynamicVector.h | 11 +- libs/utils/include/FixedMatrix.h | 5 +- libs/utils/include/FixedVector.h | 7 +- libs/utils/include/Vector2D.h | 5 +- libs/utils/include/Vector3D.h | 5 +- libs/utils/include/cfem_algebra.h | 11 +- libs/utils/include/cfem_topology.h | 5 +- libs/utils/include/cfemutils.h | 8 +- libs/utils/include/numeric_policy.h | 1 + libs/wrappers/petsc/include/PetscKSPSolver.h | 1 + libs/wrappers/petsc/src/PetscKSPSolver.cpp | 8 +- libs/wrappers/petsc/src/PetscMatrix.cpp | 5 +- libs/wrappers/petsc/src/PetscVector.cpp | 2 +- scripts/format_legacy_code.py | 135 ++++++++++++++ .../test_symbolic_simplification.cpp | 3 +- tests/fem/test_domain_integrator.cpp | 7 +- tests/fem/test_fefield.cpp | 6 +- tests/fem/test_fields.cpp | 5 +- tests/fem/test_quadrature.cpp | 8 +- tests/fem/test_reference_element.cpp | 2 +- tests/grenier/old_main.cpp | 14 +- tests/mesh/test_gmsh_parser.cpp | 3 +- tests/mesh/test_mesh.cpp | 9 +- tests/test_main.cpp | 3 +- tests/utils/tensors/test_tensor_addition.cpp | 20 ++- tests/utils/tensors/test_tensor_product.cpp | 20 ++- .../tensors/test_tensor_substraction.cpp | 20 ++- tests/utils/test_dynamic_matrix.cpp | 3 +- tests/utils/test_dynamic_vector.cpp | 1 + tests/utils/test_fixed_matrix.cpp | 1 + tests/utils/test_fixed_vector.cpp | 1 + tests/utils/test_sym_tensor_o2.cpp | 1 + tests/utils/test_vector3d.cpp | 1 + tests/wrappers/test_petsc_wrappers.cpp | 4 +- 142 files changed, 1090 insertions(+), 449 deletions(-) create mode 100755 .githooks/commit-msg create mode 100755 .githooks/post-commit create mode 100755 .githooks/pre-commit create mode 100755 scripts/format_legacy_code.py diff --git a/.githooks/commit-msg b/.githooks/commit-msg new file mode 100755 index 0000000..671a0dc --- /dev/null +++ b/.githooks/commit-msg @@ -0,0 +1,42 @@ +#!/usr/bin/env bash + +# The file containing the temporary commit message +MSG_FILE=$1 +COMMIT_TITLE=$(head -n 1 "$MSG_FILE") + +# ANSI colors +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +CYAN='\033[0;36m' +BOLD='\033[1m' +NC='\033[0m' # No Color + +# Standard definition +TYPES="(FEAT|FIX|BUG|QA|REFACTOR|PERF|DOCS|TEST|CHORE)" +MODULES="(ASSEMBLY|CORE|GEOM|MATH|IO|SYM|MESH|HPC)" +PATTERN="^${TYPES}\(${MODULES}\): .+" + +if [[ ! $COMMIT_TITLE =~ $PATTERN ]]; then + echo -e "${RED}${BOLD}===============================================================${NC}" + echo -e "${RED}${BOLD} ERROR: Invalid commit message format.${NC}" + echo -e "${RED}${BOLD}===============================================================${NC}" + echo -e " Your message : '${YELLOW}$COMMIT_TITLE${NC}'\n" + echo -e " Required format is: ${CYAN}${BOLD}TYPE(MODULE): description${NC} (in lowercase)\n" + echo -e " Allowed ${CYAN}TYPES${NC}:" + echo -e " ${GREEN}FEAT${NC} : New feature (e.g., new element type)" + echo -e " ${GREEN}FIX / BUG${NC}: Bug fix or crash resolution (e.g., fixed segfault)" + echo -e " ${GREEN}QA${NC} : Quality Assurance (assertions, error handling)" + echo -e " ${GREEN}REFACTOR${NC} : Code restructuring without behavior change" + echo -e " ${GREEN}PERF${NC} : HPC Optimization (SIMD, Arena, Caching)" + echo -e " ${GREEN}DOCS${NC} : Documentation additions or changes (Doxygen)" + echo -e " ${GREEN}TEST${NC} : Adding unit tests (GTest)" + echo -e " ${GREEN}CHORE${NC} : Maintenance tasks (CMake, scripts, cleanup)\n" + echo -e " Allowed ${CYAN}MODULES${NC}:" + echo -e " ${YELLOW}ASSEMBLY, CORE, GEOM, MATH, IO, SYM, MESH, HPC${NC}\n" + echo -e " Valid example: ${GREEN}PERF(HPC): implement zero-copy Arena allocator${NC}" + echo -e "${RED}${BOLD}===============================================================${NC}" + exit 1 +fi + +exit 0 diff --git a/.githooks/post-commit b/.githooks/post-commit new file mode 100755 index 0000000..89ee299 --- /dev/null +++ b/.githooks/post-commit @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +# ANSI colors +GREEN='\033[0;32m' +CYAN='\033[0;36m' +YELLOW='\033[1;33m' +BOLD='\033[1m' +NC='\033[0m' # No Color + +echo "" +echo -e "${CYAN}${BOLD}========================================================================${NC}" +echo -e "${GREEN}${BOLD} SUCCESS: Commit successfully recorded! ${NC}" +echo -e "${CYAN}${BOLD}========================================================================${NC}" +echo -e " The CFEM++ code is clean, the includes are perfectly sorted," +echo -e " and the message strictly follows industrial standards." +echo -e "" +echo -e " ${YELLOW}${BOLD}Excellent work!${NC}" +echo -e "${CYAN}${BOLD}========================================================================${NC}" +echo "" + +exit 0 diff --git a/.githooks/pre-commit b/.githooks/pre-commit new file mode 100755 index 0000000..f41f478 --- /dev/null +++ b/.githooks/pre-commit @@ -0,0 +1,168 @@ +#!/usr/bin/env python3 +import sys +import subprocess + +# ANSI colors for Python +RED = '\033[91m' +GREEN = '\033[92m' +YELLOW = '\033[93m' +CYAN = '\033[96m' +BOLD = '\033[1m' +RESET = '\033[0m' + +COPYRIGHT_HEADER = [ + "//************************************************************************", + "// --- CFEM++ Library", + "// ---", + "// --- Copyright 2024-2026 Ismaël Tchinda Ngueyong et al.", + "// --- ALL RIGHTS RESERVED", + "// ---", + "// --- This software is protected by international copyright laws.", + "// --- Use, distribution, or modification of this software in any form,", + "// --- source or binary, for personal, academic, or non-commercial ", + "// --- purposes is permitted free of charge, provided that this ", + "// --- copyright notice and this permission notice appear in all ", + "// --- copies and supporting documentation.", + "// ---", + "// --- The authors and contributors provide this code \"as is\" without ", + "// --- any express or implied warranty. In no event shall they be ", + "// --- held liable for any damages arising from the use of this software.", + "//************************************************************************" +] + +def get_staged_cpp_files(): + """Retrieves modified C++ files staged for commit.""" + result = subprocess.run(['git', 'diff', '--cached', '--name-only', '--diff-filter=ACM'], + capture_output=True, text=True) + files = result.stdout.split('\n') + return [f for f in files if f.endswith(('.h', '.hpp', '.cpp', '.cc', '.cxx', '.tpp'))] + +def check_copyright(filepath, lines): + """Checks if the file starts with the exact copyright header.""" + if len(lines) < len(COPYRIGHT_HEADER): + has_error = True + else: + has_error = False + # Compare line by line, stripping trailing whitespaces/newlines to avoid OS formatting issues + for i, expected_line in enumerate(COPYRIGHT_HEADER): + if lines[i].rstrip() != expected_line.rstrip(): + has_error = True + break + + if has_error: + print(f"\n{RED}{BOLD} STANDARD ERROR: Missing or invalid copyright header in '{filepath}'{RESET}") + print(f" {YELLOW}Please place the following exact text at the very top of the file:{RESET}\n") + for line in COPYRIGHT_HEADER: + print(f"{GREEN}{line}{RESET}") + print(f"\n {CYAN}-------------------------------------------{RESET}") + return True + + return False + +def check_includes(filepath, lines): + """Smartly checks, groups, and sorts includes in the header block.""" + start_idx = -1 + end_idx = -1 + includes = [] + + # Extract the main include block at the top of the file + for i, line in enumerate(lines): + stripped = line.strip() + if stripped.startswith('#include'): + if start_idx == -1: + start_idx = i + end_idx = i + includes.append(stripped) + elif not stripped or stripped.startswith('//') or stripped.startswith('/*') or stripped.startswith('*'): + continue # Skip empty lines and comments (like the copyright) + elif stripped.startswith('#pragma') or stripped.startswith('#ifndef') or stripped.startswith('#define'): + continue # Skip header guards + else: + # We hit real code. Stop gathering includes. + if start_idx != -1: + break + + if not includes: + return False + + # Separate and remove duplicates using Sets + sys_includes = set() + loc_includes = set() + + for inc in includes: + if '<' in inc and '>' in inc: + sys_includes.add(inc) + else: + loc_includes.add(inc) + + # Sort intelligently (case-insensitive primary, case-sensitive secondary) + sys_list = sorted(list(sys_includes), key=lambda x: (x.lower(), x)) + loc_list = sorted(list(loc_includes), key=lambda x: (x.lower(), x)) + + # Build the ideal block + ideal_block = [] + if sys_list: + ideal_block.extend(sys_list) + if sys_list and loc_list: + ideal_block.append("") # Elegant empty line between system and local + if loc_list: + ideal_block.extend(loc_list) + + ideal_str = "\n".join(ideal_block) + + # Reconstruct the current block to compare + current_clean = [] + for line in lines[start_idx:end_idx+1]: + s = line.strip() + if s.startswith('#include'): + current_clean.append(s) + elif s == '' and current_clean and current_clean[-1] != '': + current_clean.append('') # Keep only one empty line maximum + + while current_clean and current_clean[-1] == '': + current_clean.pop() + + current_str = "\n".join(current_clean) + + # Compare and output + if ideal_str != current_str: + print(f"\n{RED}{BOLD} STANDARD ERROR: Unsorted, messy, or duplicate includes in '{filepath}'{RESET}") + print(f" {CYAN}--- Lines {start_idx + 1} to {end_idx + 1} ---{RESET}") + print(f" {YELLOW}Please replace them with this perfectly formatted block:{RESET}\n") + + for line in ideal_block: + if line == "": + print("") + else: + print(f"{GREEN}{line}{RESET}") + + print(f"\n {CYAN}-------------------------------------------{RESET}") + return True + + return False + +def main(): + files = get_staged_cpp_files() + if not files: + sys.exit(0) + + commit_blocked = False + for f in files: + with open(f, 'r', encoding='utf-8') as file_obj: + lines = file_obj.readlines() + + # Run all our quality checks + if check_copyright(f, lines): + commit_blocked = True + + if check_includes(f, lines): + commit_blocked = True + + if commit_blocked: + print(f"\n{RED}{BOLD} Commit aborted. Please fix the errors above and run 'git add ' again.{RESET}") + sys.exit(1) + + sys.exit(0) + +if __name__ == "__main__": + main() diff --git a/CMakeLists.txt b/CMakeLists.txt index 9cd07c4..4039e1e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -178,4 +178,21 @@ if(BUILD_TESTING) include(GoogleTest) add_subdirectory(tests) -endif() \ No newline at end of file +endif() + +# ============================================================================== +# Git Hooks Configuration +# ============================================================================== +# Automatically configure Git to use the custom hooks directory if it exists +if(EXISTS "${CMAKE_SOURCE_DIR}/.githooks") + execute_process( + COMMAND git config core.hooksPath .githooks + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + RESULT_VARIABLE GIT_HOOKS_RESULT + OUTPUT_QUIET + ERROR_QUIET + ) + if(GIT_HOOKS_RESULT EQUAL 0) + message(STATUS "Git hooks correctly configured to use .githooks/") + endif() +endif() diff --git a/libs/expressions/include/AlgebraicSimplifier.h b/libs/expressions/include/AlgebraicSimplifier.h index d66910f..58ab38e 100644 --- a/libs/expressions/include/AlgebraicSimplifier.h +++ b/libs/expressions/include/AlgebraicSimplifier.h @@ -18,8 +18,9 @@ #pragma once -#include #include +#include + #include "CfemExpression.h" namespace cfem::sym diff --git a/libs/expressions/include/BinaryExpression.h b/libs/expressions/include/BinaryExpression.h index 94994b1..b1a3b50 100644 --- a/libs/expressions/include/BinaryExpression.h +++ b/libs/expressions/include/BinaryExpression.h @@ -18,13 +18,14 @@ #pragma once -#include "cfemutils.h" -#include "Vector3D.h" -#include "Tensor3D.h" +#include +#include + #include "CfemExpression.h" +#include "cfemutils.h" #include "EvalContext.h" -#include -#include +#include "Tensor3D.h" +#include "Vector3D.h" namespace cfem::sym diff --git a/libs/expressions/include/CachedExpression.h b/libs/expressions/include/CachedExpression.h index cf41f9e..9260d9e 100644 --- a/libs/expressions/include/CachedExpression.h +++ b/libs/expressions/include/CachedExpression.h @@ -19,10 +19,11 @@ #pragma once -#include "CfemExpression.h" #include #include +#include "CfemExpression.h" + namespace cfem::sym { /** diff --git a/libs/expressions/include/CfemExpression.h b/libs/expressions/include/CfemExpression.h index 4c97087..2835517 100644 --- a/libs/expressions/include/CfemExpression.h +++ b/libs/expressions/include/CfemExpression.h @@ -18,15 +18,16 @@ #pragma once +#include +#include +#include +#include + #include "cfemutils.h" #include "EvalContext.h" -#include "Vector3D.h" -#include "Tensor3D.h" #include "FESpace.h" -#include -#include -#include -#include +#include "Tensor3D.h" +#include "Vector3D.h" namespace cfem::sym diff --git a/libs/expressions/include/ConstantExpression.h b/libs/expressions/include/ConstantExpression.h index be3a0c4..30d9893 100644 --- a/libs/expressions/include/ConstantExpression.h +++ b/libs/expressions/include/ConstantExpression.h @@ -18,16 +18,17 @@ #pragma once +#include +#include +#include +#include + +#include "CfemExpression.h" #include "cfemutils.h" -#include "Vector3D.h" -#include "Tensor3D.h" #include "EvalContext.h" -#include "CfemExpression.h" +#include "Tensor3D.h" +#include "Vector3D.h" #include "ZeroExpression.h" -#include -#include -#include -#include namespace cfem::sym diff --git a/libs/expressions/include/DivergenceExpression.h b/libs/expressions/include/DivergenceExpression.h index fcbc43d..3b07f84 100644 --- a/libs/expressions/include/DivergenceExpression.h +++ b/libs/expressions/include/DivergenceExpression.h @@ -18,14 +18,15 @@ #pragma once -#include "cfemutils.h" -#include "Vector3D.h" -#include "CfemExpression.h" -#include "EvalContext.h" -#include #include +#include #include +#include "CfemExpression.h" +#include "cfemutils.h" +#include "EvalContext.h" +#include "Vector3D.h" + namespace cfem::sym { /** ************************************************************************* diff --git a/libs/expressions/include/EvalContext_Archive.h b/libs/expressions/include/EvalContext_Archive.h index fa2b2ba..634468c 100644 --- a/libs/expressions/include/EvalContext_Archive.h +++ b/libs/expressions/include/EvalContext_Archive.h @@ -18,14 +18,14 @@ #pragma once -#include "cfemutils.h" -#include "Vector3D.h" -#include "ReferenceElement.h" -#include "DynamicVector.h" - #include -#include #include +#include + +#include "cfemutils.h" +#include "DynamicVector.h" +#include "ReferenceElement.h" +#include "Vector3D.h" namespace cfem { diff --git a/libs/expressions/include/GeometricNormalExpression.h b/libs/expressions/include/GeometricNormalExpression.h index a5a8472..8baefe4 100644 --- a/libs/expressions/include/GeometricNormalExpression.h +++ b/libs/expressions/include/GeometricNormalExpression.h @@ -20,8 +20,8 @@ #include "CfemExpression.h" #include "EvalContext.h" -#include "Vector3D.h" #include "EvaluationFlags.h" +#include "Vector3D.h" namespace cfem::sym { diff --git a/libs/expressions/include/GradExpression.h b/libs/expressions/include/GradExpression.h index abb5d02..9262e02 100644 --- a/libs/expressions/include/GradExpression.h +++ b/libs/expressions/include/GradExpression.h @@ -18,12 +18,13 @@ #pragma once -#include "cfemutils.h" -#include "Vector3D.h" +#include +#include + #include "CfemExpression.h" +#include "cfemutils.h" #include "LambdaExpression.h" -#include -#include +#include "Vector3D.h" namespace cfem::sym diff --git a/libs/expressions/include/LambdaExpression.h b/libs/expressions/include/LambdaExpression.h index 0384a21..1cae1d4 100644 --- a/libs/expressions/include/LambdaExpression.h +++ b/libs/expressions/include/LambdaExpression.h @@ -18,9 +18,10 @@ #pragma once -#include "LambdaExpressionBase.h" #include +#include "LambdaExpressionBase.h" + namespace cfem::sym { /** diff --git a/libs/expressions/include/MagnitudeSqExpression.h b/libs/expressions/include/MagnitudeSqExpression.h index 0688eb0..5845c9b 100644 --- a/libs/expressions/include/MagnitudeSqExpression.h +++ b/libs/expressions/include/MagnitudeSqExpression.h @@ -18,13 +18,14 @@ #pragma once -#include "cfemutils.h" -#include "Vector3D.h" -#include "Tensor3D.h" +#include +#include + #include "CfemExpression.h" +#include "cfemutils.h" #include "EvalContext.h" -#include -#include +#include "Tensor3D.h" +#include "Vector3D.h" namespace cfem::sym { diff --git a/libs/expressions/include/MathOperators.h b/libs/expressions/include/MathOperators.h index 4e76d44..b6c8e64 100644 --- a/libs/expressions/include/MathOperators.h +++ b/libs/expressions/include/MathOperators.h @@ -19,12 +19,9 @@ #pragma once #include + #include "CfemExpression.h" #include "ConstantExpression.h" -// #include "Argument.h" -// #include "FEField.h" -// #include "FESpace.h" - #include "symengine/SymEngineSymbols.h" namespace cfem diff --git a/libs/expressions/include/ScaledExpression.h b/libs/expressions/include/ScaledExpression.h index 64e8dc3..340d590 100644 --- a/libs/expressions/include/ScaledExpression.h +++ b/libs/expressions/include/ScaledExpression.h @@ -17,10 +17,11 @@ //************************************************************************ #pragma once -#include "CfemExpression.h" -#include "BinaryExpression.h" #include +#include "BinaryExpression.h" +#include "CfemExpression.h" + namespace cfem::sym { class ScaledExpression : public CfemExpression { diff --git a/libs/expressions/include/TensorExpression.h b/libs/expressions/include/TensorExpression.h index b7fab9d..586c91b 100644 --- a/libs/expressions/include/TensorExpression.h +++ b/libs/expressions/include/TensorExpression.h @@ -18,14 +18,15 @@ #pragma once -#include "cfemutils.h" -#include "Vector3D.h" -#include "CfemExpression.h" -#include "EvalContext.h" -#include #include +#include #include +#include "CfemExpression.h" +#include "cfemutils.h" +#include "EvalContext.h" +#include "Vector3D.h" + namespace cfem::sym { diff --git a/libs/expressions/include/UnaryExpression.h b/libs/expressions/include/UnaryExpression.h index 3b89590..4979af0 100644 --- a/libs/expressions/include/UnaryExpression.h +++ b/libs/expressions/include/UnaryExpression.h @@ -18,12 +18,13 @@ #pragma once -#include "cfemutils.h" -#include "Vector3D.h" +#include +#include + #include "CfemExpression.h" +#include "cfemutils.h" #include "EvalContext.h" -#include -#include +#include "Vector3D.h" namespace cfem::sym { diff --git a/libs/expressions/include/UnaryExpression.tpp b/libs/expressions/include/UnaryExpression.tpp index 8b96216..200c8d1 100644 --- a/libs/expressions/include/UnaryExpression.tpp +++ b/libs/expressions/include/UnaryExpression.tpp @@ -18,8 +18,8 @@ #pragma once -#include "UnaryExpression.h" #include "ConstantExpression.h" +#include "UnaryExpression.h" namespace cfem::sym { diff --git a/libs/expressions/include/VariableExpression.h b/libs/expressions/include/VariableExpression.h index 61ee593..e9f7918 100644 --- a/libs/expressions/include/VariableExpression.h +++ b/libs/expressions/include/VariableExpression.h @@ -18,14 +18,15 @@ #pragma once +#include +#include + +#include "CfemExpression.h" #include "cfemutils.h" -#include "Vector3D.h" +#include "EvalContext.h" #include "Tensor3D.h" -#include "CfemExpression.h" +#include "Vector3D.h" #include "ZeroExpression.h" -#include "EvalContext.h" -#include -#include namespace cfem::sym { diff --git a/libs/expressions/include/VectorExpression.h b/libs/expressions/include/VectorExpression.h index 3b5f6d1..06867fe 100644 --- a/libs/expressions/include/VectorExpression.h +++ b/libs/expressions/include/VectorExpression.h @@ -18,14 +18,15 @@ #pragma once -#include "cfemutils.h" -#include "Vector3D.h" -#include "CfemExpression.h" -#include "EvalContext.h" -#include #include +#include #include +#include "CfemExpression.h" +#include "cfemutils.h" +#include "EvalContext.h" +#include "Vector3D.h" + namespace cfem::sym { diff --git a/libs/expressions/include/ZeroExpression.h b/libs/expressions/include/ZeroExpression.h index 56fe191..9655d60 100644 --- a/libs/expressions/include/ZeroExpression.h +++ b/libs/expressions/include/ZeroExpression.h @@ -18,12 +18,13 @@ #pragma once -#include "cfemutils.h" -#include "Vector3D.h" +#include +#include + #include "CfemExpression.h" +#include "cfemutils.h" #include "EvalContext.h" -#include -#include +#include "Vector3D.h" namespace cfem::sym { diff --git a/libs/expressions/include/symengine/ScalarSymbolicExpression.h b/libs/expressions/include/symengine/ScalarSymbolicExpression.h index 1caa92d..ffca6a2 100644 --- a/libs/expressions/include/symengine/ScalarSymbolicExpression.h +++ b/libs/expressions/include/symengine/ScalarSymbolicExpression.h @@ -18,22 +18,21 @@ #pragma once -#include "cfemutils.h" -#include "Vector3D.h" -#include "CfemExpression.h" -#include "EvalContext.h" -#include -#include #include - +#include +#include +#include #include +#include #include #include -#include -#include +#include +#include "CfemExpression.h" +#include "cfemutils.h" +#include "EvalContext.h" #include "SymbolicEvaluator.h" -#include +#include "Vector3D.h" namespace cfem::sym { diff --git a/libs/expressions/include/symengine/SymEngineSymbols.h b/libs/expressions/include/symengine/SymEngineSymbols.h index 81a4b04..fa23d2a 100644 --- a/libs/expressions/include/symengine/SymEngineSymbols.h +++ b/libs/expressions/include/symengine/SymEngineSymbols.h @@ -18,18 +18,17 @@ #pragma once -#include "ScalarSymbolicExpression.h" -#include "VectorSymbolicExpression.h" -#include "TensorSymbolicExpression.h" - -#include #include - +#include #include +#include #include #include -#include -#include +#include + +#include "ScalarSymbolicExpression.h" +#include "TensorSymbolicExpression.h" +#include "VectorSymbolicExpression.h" namespace cfem::sym diff --git a/libs/expressions/include/symengine/SymbolicEvaluator.h b/libs/expressions/include/symengine/SymbolicEvaluator.h index 0ff554d..e7da447 100644 --- a/libs/expressions/include/symengine/SymbolicEvaluator.h +++ b/libs/expressions/include/symengine/SymbolicEvaluator.h @@ -18,10 +18,10 @@ #pragma once -#include +#include #include +#include #include -#include #include "cfemutils.h" diff --git a/libs/expressions/include/symengine/TensorSymbolicExpression.h b/libs/expressions/include/symengine/TensorSymbolicExpression.h index edad3a8..ef9099a 100644 --- a/libs/expressions/include/symengine/TensorSymbolicExpression.h +++ b/libs/expressions/include/symengine/TensorSymbolicExpression.h @@ -18,18 +18,17 @@ #pragma once -#include "cfemutils.h" -#include "Vector3D.h" -#include "CfemExpression.h" -#include "ScalarSymbolicExpression.h" -#include "EvalContext.h" -#include #include - +#include #include #include +#include "CfemExpression.h" +#include "cfemutils.h" +#include "EvalContext.h" +#include "ScalarSymbolicExpression.h" #include "SymbolicEvaluator.h" +#include "Vector3D.h" namespace cfem::sym diff --git a/libs/expressions/include/symengine/VectorSymbolicExpression.h b/libs/expressions/include/symengine/VectorSymbolicExpression.h index d0dbe2b..27e3303 100644 --- a/libs/expressions/include/symengine/VectorSymbolicExpression.h +++ b/libs/expressions/include/symengine/VectorSymbolicExpression.h @@ -18,13 +18,14 @@ #pragma once -#include "cfemutils.h" -#include "Vector3D.h" +#include +#include + #include "CfemExpression.h" -#include "ScalarSymbolicExpression.h" +#include "cfemutils.h" #include "EvalContext.h" -#include -#include +#include "ScalarSymbolicExpression.h" +#include "Vector3D.h" namespace cfem::sym diff --git a/libs/expressions/src/AlgebraicSimplifier.cpp b/libs/expressions/src/AlgebraicSimplifier.cpp index e99245c..a0046df 100644 --- a/libs/expressions/src/AlgebraicSimplifier.cpp +++ b/libs/expressions/src/AlgebraicSimplifier.cpp @@ -16,17 +16,18 @@ // --- held liable for any damages arising from the use of this software. //************************************************************************ -#include "AlgebraicSimplifier.h" -#include #include -#include "CfemExpression.h" -#include "ScaledExpression.h" +#include + +#include "AlgebraicSimplifier.h" #include "BinaryExpression.h" +#include "CfemExpression.h" #include "ConstantExpression.h" -#include "UnaryExpression.h" +#include "ScaledExpression.h" #include "symengine/ScalarSymbolicExpression.h" -#include "symengine/VectorSymbolicExpression.h" #include "symengine/TensorSymbolicExpression.h" +#include "symengine/VectorSymbolicExpression.h" +#include "UnaryExpression.h" namespace cfem::sym { diff --git a/libs/expressions/src/BinaryExpression.cpp b/libs/expressions/src/BinaryExpression.cpp index 643e489..b16b9f6 100644 --- a/libs/expressions/src/BinaryExpression.cpp +++ b/libs/expressions/src/BinaryExpression.cpp @@ -18,9 +18,9 @@ #include "BinaryExpression.h" #include "ConstantExpression.h" +#include "MathOperators.h" #include "UnaryExpression.h" #include "VectorExpression.h" -#include "MathOperators.h" namespace cfem::sym { diff --git a/libs/expressions/src/MathOperators.cpp b/libs/expressions/src/MathOperators.cpp index 9948c55..2d64d1a 100644 --- a/libs/expressions/src/MathOperators.cpp +++ b/libs/expressions/src/MathOperators.cpp @@ -16,8 +16,7 @@ // --- held liable for any damages arising from the use of this software. //************************************************************************ -#include "MathOperators.h" - +#include "AlgebraicSimplifier.h" #include "BinaryExpression.h" #include "CachedExpression.h" #include "ConstantExpression.h" @@ -26,17 +25,17 @@ #include "GradExpression.h" #include "LambdaExpression.h" #include "MagnitudeSqExpression.h" -#include "UnaryExpression.h" -#include "VariableExpression.h" +#include "MathOperators.h" +#include "ScaledExpression.h" #include "symengine/ScalarSymbolicExpression.h" #include "symengine/SymEngineSymbols.h" -#include "symengine/VectorSymbolicExpression.h" #include "symengine/TensorSymbolicExpression.h" -#include "VectorExpression.h" +#include "symengine/VectorSymbolicExpression.h" #include "TensorExpression.h" +#include "UnaryExpression.h" +#include "VariableExpression.h" +#include "VectorExpression.h" #include "ZeroExpression.h" -#include "ScaledExpression.h" -#include "AlgebraicSimplifier.h" using namespace cfem::sym::utils; diff --git a/libs/expressions/src/TensorExpression.cpp b/libs/expressions/src/TensorExpression.cpp index b2e51dd..adf14af 100644 --- a/libs/expressions/src/TensorExpression.cpp +++ b/libs/expressions/src/TensorExpression.cpp @@ -16,9 +16,9 @@ // --- held liable for any damages arising from the use of this software. //************************************************************************ +#include "MathOperators.h" #include "TensorExpression.h" #include "VectorExpression.h" -#include "MathOperators.h" namespace cfem::sym diff --git a/libs/expressions/src/UnaryExpression.cpp b/libs/expressions/src/UnaryExpression.cpp index e0410fe..70bd47e 100644 --- a/libs/expressions/src/UnaryExpression.cpp +++ b/libs/expressions/src/UnaryExpression.cpp @@ -19,9 +19,9 @@ #include "BinaryExpression.h" #include "ConstantExpression.h" #include "MathOperators.h" -#include "ZeroExpression.h" #include "UnaryExpression.h" #include "VectorExpression.h" +#include "ZeroExpression.h" namespace cfem::sym { diff --git a/libs/expressions/src/VectorExpression.cpp b/libs/expressions/src/VectorExpression.cpp index ae076cd..7dffbfc 100644 --- a/libs/expressions/src/VectorExpression.cpp +++ b/libs/expressions/src/VectorExpression.cpp @@ -16,18 +16,17 @@ // --- held liable for any damages arising from the use of this software. //************************************************************************ -#include "VectorExpression.h" -#include "TensorExpression.h" -#include "symengine/ScalarSymbolicExpression.h" -#include "symengine/VectorSymbolicExpression.h" -#include "symengine/TensorSymbolicExpression.h" #include "BinaryExpression.h" -#include "UnaryExpression.h" -#include "ScaledExpression.h" -#include "LambdaExpression.h" #include "GradExpression.h" - +#include "LambdaExpression.h" #include "MathOperators.h" +#include "ScaledExpression.h" +#include "symengine/ScalarSymbolicExpression.h" +#include "symengine/TensorSymbolicExpression.h" +#include "symengine/VectorSymbolicExpression.h" +#include "TensorExpression.h" +#include "UnaryExpression.h" +#include "VectorExpression.h" namespace cfem::sym { diff --git a/libs/expressions/src/symengine/ScalarSymbolicExpression.cpp b/libs/expressions/src/symengine/ScalarSymbolicExpression.cpp index bdeb1ad..0545edc 100644 --- a/libs/expressions/src/symengine/ScalarSymbolicExpression.cpp +++ b/libs/expressions/src/symengine/ScalarSymbolicExpression.cpp @@ -18,8 +18,8 @@ #include "symengine/ScalarSymbolicExpression.h" -#include "symengine/VectorSymbolicExpression.h" #include "symengine/SymEngineSymbols.h" +#include "symengine/VectorSymbolicExpression.h" namespace cfem::sym{ diff --git a/libs/expressions/src/symengine/TensorSymbolicExpression.cpp b/libs/expressions/src/symengine/TensorSymbolicExpression.cpp index ab690b0..6a7493a 100644 --- a/libs/expressions/src/symengine/TensorSymbolicExpression.cpp +++ b/libs/expressions/src/symengine/TensorSymbolicExpression.cpp @@ -16,8 +16,8 @@ // --- held liable for any damages arising from the use of this software. //************************************************************************ -#include "symengine/TensorSymbolicExpression.h" #include "symengine/SymEngineSymbols.h" +#include "symengine/TensorSymbolicExpression.h" namespace cfem::sym { diff --git a/libs/expressions/src/symengine/VectorSymbolicExpression.cpp b/libs/expressions/src/symengine/VectorSymbolicExpression.cpp index 0b8d22c..a559dc4 100644 --- a/libs/expressions/src/symengine/VectorSymbolicExpression.cpp +++ b/libs/expressions/src/symengine/VectorSymbolicExpression.cpp @@ -16,10 +16,10 @@ // --- held liable for any damages arising from the use of this software. //************************************************************************ -#include "symengine/VectorSymbolicExpression.h" -#include "symengine/TensorSymbolicExpression.h" -#include "symengine/SymEngineSymbols.h" #include "BinaryExpression.h" +#include "symengine/SymEngineSymbols.h" +#include "symengine/TensorSymbolicExpression.h" +#include "symengine/VectorSymbolicExpression.h" namespace cfem::sym { diff --git a/libs/fem/assembly/terms/electromagnetism/include/MagneticCurlCurlWFTerm.h b/libs/fem/assembly/terms/electromagnetism/include/MagneticCurlCurlWFTerm.h index e69de29..2dff2de 100644 --- a/libs/fem/assembly/terms/electromagnetism/include/MagneticCurlCurlWFTerm.h +++ b/libs/fem/assembly/terms/electromagnetism/include/MagneticCurlCurlWFTerm.h @@ -0,0 +1,18 @@ +//************************************************************************ +// --- CFEM++ Library +// --- +// --- Copyright 2024-2026 Ismaël Tchinda Ngueyong et al. +// --- ALL RIGHTS RESERVED +// --- +// --- This software is protected by international copyright laws. +// --- Use, distribution, or modification of this software in any form, +// --- source or binary, for personal, academic, or non-commercial +// --- purposes is permitted free of charge, provided that this +// --- copyright notice and this permission notice appear in all +// --- copies and supporting documentation. +// --- +// --- The authors and contributors provide this code "as is" without +// --- any express or implied warranty. In no event shall they be +// --- held liable for any damages arising from the use of this software. +//************************************************************************ + diff --git a/libs/fem/assembly/terms/electromagnetism/src/MagneticCurlCurlWFTerm.cpp b/libs/fem/assembly/terms/electromagnetism/src/MagneticCurlCurlWFTerm.cpp index e69de29..2dff2de 100644 --- a/libs/fem/assembly/terms/electromagnetism/src/MagneticCurlCurlWFTerm.cpp +++ b/libs/fem/assembly/terms/electromagnetism/src/MagneticCurlCurlWFTerm.cpp @@ -0,0 +1,18 @@ +//************************************************************************ +// --- CFEM++ Library +// --- +// --- Copyright 2024-2026 Ismaël Tchinda Ngueyong et al. +// --- ALL RIGHTS RESERVED +// --- +// --- This software is protected by international copyright laws. +// --- Use, distribution, or modification of this software in any form, +// --- source or binary, for personal, academic, or non-commercial +// --- purposes is permitted free of charge, provided that this +// --- copyright notice and this permission notice appear in all +// --- copies and supporting documentation. +// --- +// --- The authors and contributors provide this code "as is" without +// --- any express or implied warranty. In no event shall they be +// --- held liable for any damages arising from the use of this software. +//************************************************************************ + diff --git a/libs/fem/assembly/terms/fluid_mechanics/include/FluidViscosityWFTerm.h b/libs/fem/assembly/terms/fluid_mechanics/include/FluidViscosityWFTerm.h index e69de29..2dff2de 100644 --- a/libs/fem/assembly/terms/fluid_mechanics/include/FluidViscosityWFTerm.h +++ b/libs/fem/assembly/terms/fluid_mechanics/include/FluidViscosityWFTerm.h @@ -0,0 +1,18 @@ +//************************************************************************ +// --- CFEM++ Library +// --- +// --- Copyright 2024-2026 Ismaël Tchinda Ngueyong et al. +// --- ALL RIGHTS RESERVED +// --- +// --- This software is protected by international copyright laws. +// --- Use, distribution, or modification of this software in any form, +// --- source or binary, for personal, academic, or non-commercial +// --- purposes is permitted free of charge, provided that this +// --- copyright notice and this permission notice appear in all +// --- copies and supporting documentation. +// --- +// --- The authors and contributors provide this code "as is" without +// --- any express or implied warranty. In no event shall they be +// --- held liable for any damages arising from the use of this software. +//************************************************************************ + diff --git a/libs/fem/assembly/terms/fluid_mechanics/src/FluidViscosityWFTerm.cpp b/libs/fem/assembly/terms/fluid_mechanics/src/FluidViscosityWFTerm.cpp index e69de29..2dff2de 100644 --- a/libs/fem/assembly/terms/fluid_mechanics/src/FluidViscosityWFTerm.cpp +++ b/libs/fem/assembly/terms/fluid_mechanics/src/FluidViscosityWFTerm.cpp @@ -0,0 +1,18 @@ +//************************************************************************ +// --- CFEM++ Library +// --- +// --- Copyright 2024-2026 Ismaël Tchinda Ngueyong et al. +// --- ALL RIGHTS RESERVED +// --- +// --- This software is protected by international copyright laws. +// --- Use, distribution, or modification of this software in any form, +// --- source or binary, for personal, academic, or non-commercial +// --- purposes is permitted free of charge, provided that this +// --- copyright notice and this permission notice appear in all +// --- copies and supporting documentation. +// --- +// --- The authors and contributors provide this code "as is" without +// --- any express or implied warranty. In no event shall they be +// --- held liable for any damages arising from the use of this software. +//************************************************************************ + diff --git a/libs/fem/assembly/terms/general/include/DiffusionWFTerm.h b/libs/fem/assembly/terms/general/include/DiffusionWFTerm.h index e69de29..2dff2de 100644 --- a/libs/fem/assembly/terms/general/include/DiffusionWFTerm.h +++ b/libs/fem/assembly/terms/general/include/DiffusionWFTerm.h @@ -0,0 +1,18 @@ +//************************************************************************ +// --- CFEM++ Library +// --- +// --- Copyright 2024-2026 Ismaël Tchinda Ngueyong et al. +// --- ALL RIGHTS RESERVED +// --- +// --- This software is protected by international copyright laws. +// --- Use, distribution, or modification of this software in any form, +// --- source or binary, for personal, academic, or non-commercial +// --- purposes is permitted free of charge, provided that this +// --- copyright notice and this permission notice appear in all +// --- copies and supporting documentation. +// --- +// --- The authors and contributors provide this code "as is" without +// --- any express or implied warranty. In no event shall they be +// --- held liable for any damages arising from the use of this software. +//************************************************************************ + diff --git a/libs/fem/assembly/terms/general/src/DiffusionWFTerm.cpp b/libs/fem/assembly/terms/general/src/DiffusionWFTerm.cpp index e69de29..2dff2de 100644 --- a/libs/fem/assembly/terms/general/src/DiffusionWFTerm.cpp +++ b/libs/fem/assembly/terms/general/src/DiffusionWFTerm.cpp @@ -0,0 +1,18 @@ +//************************************************************************ +// --- CFEM++ Library +// --- +// --- Copyright 2024-2026 Ismaël Tchinda Ngueyong et al. +// --- ALL RIGHTS RESERVED +// --- +// --- This software is protected by international copyright laws. +// --- Use, distribution, or modification of this software in any form, +// --- source or binary, for personal, academic, or non-commercial +// --- purposes is permitted free of charge, provided that this +// --- copyright notice and this permission notice appear in all +// --- copies and supporting documentation. +// --- +// --- The authors and contributors provide this code "as is" without +// --- any express or implied warranty. In no event shall they be +// --- held liable for any damages arising from the use of this software. +//************************************************************************ + diff --git a/libs/fem/assembly/terms/solid_mechanics/include/ElasticStiffnessWFTerm.h b/libs/fem/assembly/terms/solid_mechanics/include/ElasticStiffnessWFTerm.h index e69de29..2dff2de 100644 --- a/libs/fem/assembly/terms/solid_mechanics/include/ElasticStiffnessWFTerm.h +++ b/libs/fem/assembly/terms/solid_mechanics/include/ElasticStiffnessWFTerm.h @@ -0,0 +1,18 @@ +//************************************************************************ +// --- CFEM++ Library +// --- +// --- Copyright 2024-2026 Ismaël Tchinda Ngueyong et al. +// --- ALL RIGHTS RESERVED +// --- +// --- This software is protected by international copyright laws. +// --- Use, distribution, or modification of this software in any form, +// --- source or binary, for personal, academic, or non-commercial +// --- purposes is permitted free of charge, provided that this +// --- copyright notice and this permission notice appear in all +// --- copies and supporting documentation. +// --- +// --- The authors and contributors provide this code "as is" without +// --- any express or implied warranty. In no event shall they be +// --- held liable for any damages arising from the use of this software. +//************************************************************************ + diff --git a/libs/fem/assembly/terms/solid_mechanics/src/ElasticStiffnessWFTerm.cpp b/libs/fem/assembly/terms/solid_mechanics/src/ElasticStiffnessWFTerm.cpp index e69de29..2dff2de 100644 --- a/libs/fem/assembly/terms/solid_mechanics/src/ElasticStiffnessWFTerm.cpp +++ b/libs/fem/assembly/terms/solid_mechanics/src/ElasticStiffnessWFTerm.cpp @@ -0,0 +1,18 @@ +//************************************************************************ +// --- CFEM++ Library +// --- +// --- Copyright 2024-2026 Ismaël Tchinda Ngueyong et al. +// --- ALL RIGHTS RESERVED +// --- +// --- This software is protected by international copyright laws. +// --- Use, distribution, or modification of this software in any form, +// --- source or binary, for personal, academic, or non-commercial +// --- purposes is permitted free of charge, provided that this +// --- copyright notice and this permission notice appear in all +// --- copies and supporting documentation. +// --- +// --- The authors and contributors provide this code "as is" without +// --- any express or implied warranty. In no event shall they be +// --- held liable for any damages arising from the use of this software. +//************************************************************************ + diff --git a/libs/fem/exportation/include/MeshExporter.h b/libs/fem/exportation/include/MeshExporter.h index 6bd1b05..4a1e6f3 100644 --- a/libs/fem/exportation/include/MeshExporter.h +++ b/libs/fem/exportation/include/MeshExporter.h @@ -19,13 +19,12 @@ #ifndef CFEM_MESH_EXPORTER_H #define CFEM_MESH_EXPORTER_H -#include "cfemutils.h" -#include "cfem_topology.h" - - #include #include +#include "cfem_topology.h" +#include "cfemutils.h" + namespace cfem { class Mesh; diff --git a/libs/fem/exportation/include/VTKExporter.h b/libs/fem/exportation/include/VTKExporter.h index a53e953..6f65241 100644 --- a/libs/fem/exportation/include/VTKExporter.h +++ b/libs/fem/exportation/include/VTKExporter.h @@ -24,9 +24,10 @@ #ifndef CFEM_VTKEXPORTER_H #define CFEM_VTKEXPORTER_H -#include -#include #include +#include +#include + #include "VTKFamilyExporter.h" namespace cfem diff --git a/libs/fem/exportation/include/VTKFamilyExporter.h b/libs/fem/exportation/include/VTKFamilyExporter.h index bf5c7f4..d366aee 100644 --- a/libs/fem/exportation/include/VTKFamilyExporter.h +++ b/libs/fem/exportation/include/VTKFamilyExporter.h @@ -23,10 +23,11 @@ #ifndef CFEM_VTKFAMILYEXPORTER_H #define CFEM_VTKFAMILYEXPORTER_H -#include "MeshExporter.h" -#include #include #include +#include + +#include "MeshExporter.h" namespace cfem { diff --git a/libs/fem/exportation/include/VTUExporter.h b/libs/fem/exportation/include/VTUExporter.h index ae897ca..4335f0e 100644 --- a/libs/fem/exportation/include/VTUExporter.h +++ b/libs/fem/exportation/include/VTUExporter.h @@ -24,9 +24,10 @@ #ifndef CFEM_VTUEXPORTER_H #define CFEM_VTUEXPORTER_H -#include -#include #include +#include +#include + #include "VTKFamilyExporter.h" namespace cfem diff --git a/libs/fem/exportation/src/MeshExporter.cpp b/libs/fem/exportation/src/MeshExporter.cpp index de3b01b..55e8ff9 100644 --- a/libs/fem/exportation/src/MeshExporter.cpp +++ b/libs/fem/exportation/src/MeshExporter.cpp @@ -16,13 +16,14 @@ // --- held liable for any damages arising from the use of this software. //************************************************************************ -#include "MeshExporter.h" -#include #include +#include + +#include "CfemExpression.h" +#include "FEField.h" #include "Mesh.h" #include "MeshEntity.h" -#include "FEField.h" -#include "CfemExpression.h" +#include "MeshExporter.h" namespace fs = std::filesystem; diff --git a/libs/fem/exportation/src/VTKExporter.cpp b/libs/fem/exportation/src/VTKExporter.cpp index 12f944d..bf7e308 100644 --- a/libs/fem/exportation/src/VTKExporter.cpp +++ b/libs/fem/exportation/src/VTKExporter.cpp @@ -16,11 +16,12 @@ // --- held liable for any damages arising from the use of this software. //************************************************************************ -#include "VTKExporter.h" -#include "CfemExpression.h" #include -#include #include +#include + +#include "CfemExpression.h" +#include "VTKExporter.h" namespace cfem { diff --git a/libs/fem/exportation/src/VTKFamilyExporter.cpp b/libs/fem/exportation/src/VTKFamilyExporter.cpp index 9df9347..469451a 100644 --- a/libs/fem/exportation/src/VTKFamilyExporter.cpp +++ b/libs/fem/exportation/src/VTKFamilyExporter.cpp @@ -16,14 +16,13 @@ // --- held liable for any damages arising from the use of this software. //************************************************************************ -#include "cfemutils.h" - -#include "VTKFamilyExporter.h" #include "CfemExpression.h" +#include "cfemutils.h" #include "FEField.h" #include "LagrangeSpace.h" #include "Mesh.h" #include "ReferenceElementFactory.h" +#include "VTKFamilyExporter.h" namespace cfem diff --git a/libs/fem/exportation/src/VTUExporter.cpp b/libs/fem/exportation/src/VTUExporter.cpp index f648e73..140caf7 100644 --- a/libs/fem/exportation/src/VTUExporter.cpp +++ b/libs/fem/exportation/src/VTUExporter.cpp @@ -16,14 +16,14 @@ // --- held liable for any damages arising from the use of this software. //************************************************************************ -#include "VTUExporter.h" -#include "CfemExpression.h" - #include -#include +#include #include +#include #include -#include + +#include "CfemExpression.h" +#include "VTUExporter.h" namespace cfem { diff --git a/libs/fem/fefield/include/Argument.h b/libs/fem/fefield/include/Argument.h index 153fcf5..9d99f60 100644 --- a/libs/fem/fefield/include/Argument.h +++ b/libs/fem/fefield/include/Argument.h @@ -18,13 +18,14 @@ #pragma once -#include "cfemutils.h" -#include "CfemExpression.h" -#include "FESpace.h" -#include "EvalContext.h" +#include #include #include -#include + +#include "CfemExpression.h" +#include "cfemutils.h" +#include "EvalContext.h" +#include "FESpace.h" namespace cfem::sym { diff --git a/libs/fem/fefield/include/FEField.h b/libs/fem/fefield/include/FEField.h index d6ef00e..fcd4d0a 100644 --- a/libs/fem/fefield/include/FEField.h +++ b/libs/fem/fefield/include/FEField.h @@ -19,23 +19,23 @@ #ifndef CFEM_FEFIELD_H_2 #define CFEM_FEFIELD_H_2 -#include "cfemutils.h" -#include "CfemExpression.h" -#include "Argument.h" -#include "GradExpression.h" -#include "EvalContext.h" -#include "FESpace.h" -#include "PetscVector.h" -#include -#include #include #include #include +#include +#include -#include "Vector2D.h" -#include "Vector3D.h" +#include "Argument.h" +#include "CfemExpression.h" +#include "cfemutils.h" +#include "EvalContext.h" +#include "FESpace.h" +#include "GradExpression.h" +#include "PetscVector.h" #include "Tensor2D.h" #include "Tensor3D.h" +#include "Vector2D.h" +#include "Vector3D.h" namespace cfem { diff --git a/libs/fem/fefield/include/FEField.tpp b/libs/fem/fefield/include/FEField.tpp index 83e4e44..f832885 100644 --- a/libs/fem/fefield/include/FEField.tpp +++ b/libs/fem/fefield/include/FEField.tpp @@ -18,11 +18,11 @@ #pragma once +#include + #include "FEField.h" -#include "ReferenceElementFactory.h" #include "Mesh.h" - -#include +#include "ReferenceElementFactory.h" namespace cfem { diff --git a/libs/fem/fefield/src/FEField.cpp b/libs/fem/fefield/src/FEField.cpp index 125171d..fe93c3c 100644 --- a/libs/fem/fefield/src/FEField.cpp +++ b/libs/fem/fefield/src/FEField.cpp @@ -16,14 +16,14 @@ // --- held liable for any damages arising from the use of this software. //************************************************************************ +#include +#include + +#include "DynamicVector.h" #include "FEField.h" #include "Mesh.h" -#include "DynamicVector.h" #include "ReferenceElementFactory.h" -#include -#include - namespace cfem { /** diff --git a/libs/fem/fespace/include/DGSpace.h b/libs/fem/fespace/include/DGSpace.h index 9cf6dfd..a94db0d 100644 --- a/libs/fem/fespace/include/DGSpace.h +++ b/libs/fem/fespace/include/DGSpace.h @@ -19,9 +19,10 @@ #ifndef CFEM_DGSPACE_H #define CFEM_DGSPACE_H -#include "FESpace.h" #include +#include "FESpace.h" + namespace cfem { /** diff --git a/libs/fem/fespace/include/FESpace.h b/libs/fem/fespace/include/FESpace.h index f20f88f..4732cab 100644 --- a/libs/fem/fespace/include/FESpace.h +++ b/libs/fem/fespace/include/FESpace.h @@ -19,13 +19,13 @@ #ifndef CFEM_FESPACE_H #define CFEM_FESPACE_H -#include "cfemutils.h" +#include +#include + #include "cfem_topology.h" +#include "cfemutils.h" #include "ReferenceElementFactory.h" -#include -#include - namespace cfem { /** diff --git a/libs/fem/fespace/include/LagrangeSpace.h b/libs/fem/fespace/include/LagrangeSpace.h index f1e6bad..90b2524 100644 --- a/libs/fem/fespace/include/LagrangeSpace.h +++ b/libs/fem/fespace/include/LagrangeSpace.h @@ -19,10 +19,11 @@ #ifndef CFEM_LAGRANGESPACE_H #define CFEM_LAGRANGESPACE_H -#include "FESpace.h" -#include "DynamicVector.h" #include +#include "DynamicVector.h" +#include "FESpace.h" + namespace cfem { /** diff --git a/libs/fem/fespace/src/LagrangeSpace.cpp b/libs/fem/fespace/src/LagrangeSpace.cpp index 4c6d560..61fc1fb 100644 --- a/libs/fem/fespace/src/LagrangeSpace.cpp +++ b/libs/fem/fespace/src/LagrangeSpace.cpp @@ -16,13 +16,13 @@ // --- held liable for any damages arising from the use of this software. //************************************************************************ +#include +#include + #include "LagrangeSpace.h" -#include "ReferenceElements.h" -#include "ReferenceElementFactory.h" #include "Mesh.h" - -#include -#include +#include "ReferenceElementFactory.h" +#include "ReferenceElements.h" namespace cfem { diff --git a/libs/fem/mesh/include/EntityOps.h b/libs/fem/mesh/include/EntityOps.h index e99ef66..47ea27d 100644 --- a/libs/fem/mesh/include/EntityOps.h +++ b/libs/fem/mesh/include/EntityOps.h @@ -19,11 +19,12 @@ #ifndef CFEM_ENTITY_OPS_H #define CFEM_ENTITY_OPS_H -#include "Mesh.h" -#include "MeshEntity.h" #include -#include #include +#include + +#include "Mesh.h" +#include "MeshEntity.h" namespace cfem { namespace EntityOps { diff --git a/libs/fem/mesh/include/GmshParser.h b/libs/fem/mesh/include/GmshParser.h index a9570bb..6f7b07e 100644 --- a/libs/fem/mesh/include/GmshParser.h +++ b/libs/fem/mesh/include/GmshParser.h @@ -53,17 +53,18 @@ #ifndef CFEM_GMSH_PARSER_H #define CFEM_GMSH_PARSER_H -#include "cfemutils.h" -#include "Vector3D.h" +#include #include #include -#include -#include -#include -#include #include #include #include +#include +#include +#include + +#include "cfemutils.h" +#include "Vector3D.h" namespace cfem{ /** diff --git a/libs/fem/mesh/include/Mesh.h b/libs/fem/mesh/include/Mesh.h index d269181..1c42769 100644 --- a/libs/fem/mesh/include/Mesh.h +++ b/libs/fem/mesh/include/Mesh.h @@ -42,25 +42,23 @@ #define CFEMPP_MESH #include -#include -#include -#include -#include -#include -#include #include +#include +#include #include #include -#include +#include +#include +#include +#include +#include -#include "cfemutils.h" #include "cfem_topology.h" -#include "MeshEntity.h" -#include "GmshParser.h" -#include "Vector3D.h" +#include "cfemutils.h" #include "DynamicVector.h" #include "GmshParser.h" - +#include "MeshEntity.h" +#include "Vector3D.h" constexpr CfemInt MAX_CELL_TYPES {static_cast(cfem::CellType::COUNT)}; namespace cfem{ diff --git a/libs/fem/mesh/include/Mesh.tpp b/libs/fem/mesh/include/Mesh.tpp index ac7a22a..62a0f6b 100644 --- a/libs/fem/mesh/include/Mesh.tpp +++ b/libs/fem/mesh/include/Mesh.tpp @@ -18,8 +18,8 @@ #ifndef CFEM_MESH_TPP #define CFEM_MESH_TPP -#include "Mesh.h" #include "DynamicVector.h" +#include "Mesh.h" #endif namespace cfem diff --git a/libs/fem/mesh/include/MeshConformityChecker.h b/libs/fem/mesh/include/MeshConformityChecker.h index 6054793..f744b65 100644 --- a/libs/fem/mesh/include/MeshConformityChecker.h +++ b/libs/fem/mesh/include/MeshConformityChecker.h @@ -19,10 +19,11 @@ #ifndef CFEMPP_MESH_CONFORMITY_CHECKER #define CFEMPP_MESH_CONFORMITY_CHECKER -#include "Mesh.h" +#include #include #include -#include + +#include "Mesh.h" namespace cfem { diff --git a/libs/fem/mesh/include/MeshEntity.h b/libs/fem/mesh/include/MeshEntity.h index e85eb9d..54d5fe0 100644 --- a/libs/fem/mesh/include/MeshEntity.h +++ b/libs/fem/mesh/include/MeshEntity.h @@ -19,9 +19,10 @@ #ifndef CFEM_MESHENTITY_ #define CFEM_MESHENTITY_ -#include -#include #include +#include +#include + #include "cfemutils.h" diff --git a/libs/fem/mesh/include/MeshQualityTool.h b/libs/fem/mesh/include/MeshQualityTool.h index e61a935..f0357f0 100644 --- a/libs/fem/mesh/include/MeshQualityTool.h +++ b/libs/fem/mesh/include/MeshQualityTool.h @@ -18,9 +18,10 @@ #pragma once -#include "cfemutils.h" #include +#include "cfemutils.h" + namespace cfem { class Mesh; diff --git a/libs/fem/mesh/include/builders/AnnulusMeshBuilder.h b/libs/fem/mesh/include/builders/AnnulusMeshBuilder.h index 7a8dbcf..0d00cfe 100644 --- a/libs/fem/mesh/include/builders/AnnulusMeshBuilder.h +++ b/libs/fem/mesh/include/builders/AnnulusMeshBuilder.h @@ -19,9 +19,10 @@ #ifndef ANNULUS_MESH_BUILDER_H #define ANNULUS_MESH_BUILDER_H -#include "Mesh.h" -#include #include +#include + +#include "Mesh.h" namespace cfem { diff --git a/libs/fem/mesh/include/builders/BlockMeshBuilder.h b/libs/fem/mesh/include/builders/BlockMeshBuilder.h index 7fc8c62..6609895 100644 --- a/libs/fem/mesh/include/builders/BlockMeshBuilder.h +++ b/libs/fem/mesh/include/builders/BlockMeshBuilder.h @@ -19,10 +19,10 @@ #ifndef CFEM_BLOCK_MESH_BUILDER_H #define CFEM_BLOCK_MESH_BUILDER_H -#include "cfemutils.h" -#include "Vector3D.h" #include "cfem_topology.h" +#include "cfemutils.h" #include "Mesh.h" +#include "Vector3D.h" namespace cfem { diff --git a/libs/fem/mesh/include/builders/CylinderMeshBuilder.h b/libs/fem/mesh/include/builders/CylinderMeshBuilder.h index 92236a2..c2f037f 100644 --- a/libs/fem/mesh/include/builders/CylinderMeshBuilder.h +++ b/libs/fem/mesh/include/builders/CylinderMeshBuilder.h @@ -19,14 +19,15 @@ #ifndef CFEM_UNIFORM_CYLINDER_MESH_BUILDER_H #define CFEM_UNIFORM_CYLINDER_MESH_BUILDER_H -#include "cfemutils.h" -#include "cfem_topology.h" -#include "Vector3D.h" -#include "Mesh.h" -#include -#include #include +#include #include +#include + +#include "cfem_topology.h" +#include "cfemutils.h" +#include "Mesh.h" +#include "Vector3D.h" namespace cfem { diff --git a/libs/fem/mesh/include/builders/DiskMeshBuilder.h b/libs/fem/mesh/include/builders/DiskMeshBuilder.h index 346915d..0725031 100644 --- a/libs/fem/mesh/include/builders/DiskMeshBuilder.h +++ b/libs/fem/mesh/include/builders/DiskMeshBuilder.h @@ -19,13 +19,14 @@ #ifndef CFEM_DISK_MESH_BUILDER_H #define CFEM_DISK_MESH_BUILDER_H -#include "cfemutils.h" -#include "cfem_topology.h" -#include "Vector3D.h" -#include "Mesh.h" +#include #include #include -#include + +#include "cfem_topology.h" +#include "cfemutils.h" +#include "Mesh.h" +#include "Vector3D.h" namespace cfem { diff --git a/libs/fem/mesh/include/builders/HollowCylinderMeshBuilder.h b/libs/fem/mesh/include/builders/HollowCylinderMeshBuilder.h index c30cffe..8c1cd52 100644 --- a/libs/fem/mesh/include/builders/HollowCylinderMeshBuilder.h +++ b/libs/fem/mesh/include/builders/HollowCylinderMeshBuilder.h @@ -19,14 +19,15 @@ #ifndef CFEM_HOLLOW_CYLINDER_MESH_BUILDER_H #define CFEM_HOLLOW_CYLINDER_MESH_BUILDER_H -#include "cfemutils.h" -#include "cfem_topology.h" -#include "Vector3D.h" -#include "Mesh.h" -#include -#include #include +#include #include +#include + +#include "cfem_topology.h" +#include "cfemutils.h" +#include "Mesh.h" +#include "Vector3D.h" namespace cfem { diff --git a/libs/fem/mesh/include/builders/LineMeshBuilder.h b/libs/fem/mesh/include/builders/LineMeshBuilder.h index f5417ac..6a7b158 100644 --- a/libs/fem/mesh/include/builders/LineMeshBuilder.h +++ b/libs/fem/mesh/include/builders/LineMeshBuilder.h @@ -19,10 +19,10 @@ #ifndef CFEM_LINE_MESH_BUILDER_H #define CFEM_LINE_MESH_BUILDER_H -#include "cfemutils.h" #include "cfem_topology.h" -#include "Vector3D.h" +#include "cfemutils.h" #include "Mesh.h" +#include "Vector3D.h" namespace cfem diff --git a/libs/fem/mesh/include/builders/QuadMeshBuilder.h b/libs/fem/mesh/include/builders/QuadMeshBuilder.h index 27b2324..c7521af 100644 --- a/libs/fem/mesh/include/builders/QuadMeshBuilder.h +++ b/libs/fem/mesh/include/builders/QuadMeshBuilder.h @@ -19,10 +19,10 @@ #ifndef CFEM_QUAD_MESH_BUILDER_H #define CFEM_QUAD_MESH_BUILDER_H -#include "cfemutils.h" -#include "Vector3D.h" #include "cfem_topology.h" +#include "cfemutils.h" #include "Mesh.h" +#include "Vector3D.h" namespace cfem{ using QuadElementType = Mesh::QuadElementType; /// Alias to Mesh element type for 2D quad meshes. diff --git a/libs/fem/mesh/include/builders/SolidSphereBuilder.h b/libs/fem/mesh/include/builders/SolidSphereBuilder.h index 7118699..b6d1f62 100644 --- a/libs/fem/mesh/include/builders/SolidSphereBuilder.h +++ b/libs/fem/mesh/include/builders/SolidSphereBuilder.h @@ -20,8 +20,8 @@ #define CFEM_SOLID_SPHERE_BUILDER_H #include "cfemutils.h" -#include "Vector3D.h" #include "Mesh.h" +#include "Vector3D.h" namespace cfem { diff --git a/libs/fem/mesh/include/builders/SurfaceSphereBuilder.h b/libs/fem/mesh/include/builders/SurfaceSphereBuilder.h index 8a3e508..ac04827 100644 --- a/libs/fem/mesh/include/builders/SurfaceSphereBuilder.h +++ b/libs/fem/mesh/include/builders/SurfaceSphereBuilder.h @@ -20,8 +20,8 @@ #define CFEM_SURFACE_SPHERE_BUILDER_H #include "cfemutils.h" -#include "Vector3D.h" #include "Mesh.h" +#include "Vector3D.h" namespace cfem { diff --git a/libs/fem/mesh/src/GmshParser.cpp b/libs/fem/mesh/src/GmshParser.cpp index 7746d3d..02299a6 100644 --- a/libs/fem/mesh/src/GmshParser.cpp +++ b/libs/fem/mesh/src/GmshParser.cpp @@ -16,11 +16,11 @@ // --- held liable for any damages arising from the use of this software. //************************************************************************ +#include + #include "GmshParser.h" #include "Mesh.h" -#include - namespace cfem{ /** diff --git a/libs/fem/mesh/src/Mesh.cpp b/libs/fem/mesh/src/Mesh.cpp index 2ba9585..9c080b5 100644 --- a/libs/fem/mesh/src/Mesh.cpp +++ b/libs/fem/mesh/src/Mesh.cpp @@ -16,23 +16,23 @@ // --- held liable for any damages arising from the use of this software. //************************************************************************ -#include "Mesh.h" -#include #include -#include #include +#include +#include #include -#include "QuadMeshBuilder.h" -#include "LineMeshBuilder.h" -#include "DiskMeshBuilder.h" +#include "AnnulusMeshBuilder.h" #include "BlockMeshBuilder.h" -#include "SolidSphereBuilder.h" -#include "SurfaceSphereBuilder.h" #include "CylinderMeshBuilder.h" -#include "AnnulusMeshBuilder.h" +#include "DiskMeshBuilder.h" #include "HollowCylinderMeshBuilder.h" +#include "LineMeshBuilder.h" +#include "Mesh.h" #include "MeshConformityChecker.h" +#include "QuadMeshBuilder.h" +#include "SolidSphereBuilder.h" +#include "SurfaceSphereBuilder.h" namespace cfem { diff --git a/libs/fem/mesh/src/MeshConformityChecker.cpp b/libs/fem/mesh/src/MeshConformityChecker.cpp index 02e197e..04508c9 100644 --- a/libs/fem/mesh/src/MeshConformityChecker.cpp +++ b/libs/fem/mesh/src/MeshConformityChecker.cpp @@ -16,11 +16,12 @@ // --- held liable for any damages arising from the use of this software. //************************************************************************ -#include "MeshConformityChecker.h" -#include #include -#include #include +#include +#include + +#include "MeshConformityChecker.h" namespace cfem { diff --git a/libs/fem/mesh/src/MeshEntity.cpp b/libs/fem/mesh/src/MeshEntity.cpp index 63fad6f..23ef11f 100644 --- a/libs/fem/mesh/src/MeshEntity.cpp +++ b/libs/fem/mesh/src/MeshEntity.cpp @@ -16,11 +16,11 @@ // --- held liable for any damages arising from the use of this software. //************************************************************************ -#include "MeshEntity.h" -#include "Mesh.h" - #include +#include "Mesh.h" +#include "MeshEntity.h" + namespace cfem { diff --git a/libs/fem/mesh/src/MeshQualityTool.cpp b/libs/fem/mesh/src/MeshQualityTool.cpp index 1baa56b..f812939 100644 --- a/libs/fem/mesh/src/MeshQualityTool.cpp +++ b/libs/fem/mesh/src/MeshQualityTool.cpp @@ -16,8 +16,8 @@ // --- held liable for any damages arising from the use of this software. //************************************************************************ -#include "MeshQualityTool.h" #include "Mesh.h" +#include "MeshQualityTool.h" namespace cfem { diff --git a/libs/fem/mesh/src/builders/SolidSphereBuilder.cpp b/libs/fem/mesh/src/builders/SolidSphereBuilder.cpp index a0e0759..965e145 100644 --- a/libs/fem/mesh/src/builders/SolidSphereBuilder.cpp +++ b/libs/fem/mesh/src/builders/SolidSphereBuilder.cpp @@ -16,9 +16,8 @@ // --- held liable for any damages arising from the use of this software. //************************************************************************ -#include "SolidSphereBuilder.h" - #include "Mesh.h" +#include "SolidSphereBuilder.h" namespace cfem { diff --git a/libs/fem/mesh/src/builders/SurfaceSphereBuilder.cpp b/libs/fem/mesh/src/builders/SurfaceSphereBuilder.cpp index e71543a..f033149 100644 --- a/libs/fem/mesh/src/builders/SurfaceSphereBuilder.cpp +++ b/libs/fem/mesh/src/builders/SurfaceSphereBuilder.cpp @@ -17,9 +17,10 @@ //************************************************************************ -#include "SurfaceSphereBuilder.h" #include +#include "SurfaceSphereBuilder.h" + namespace cfem { std::shared_ptr SurfaceSphereBuilder::create( diff --git a/libs/fem/quadrature/include/Quadrature.h b/libs/fem/quadrature/include/Quadrature.h index 7a3c70e..827584e 100644 --- a/libs/fem/quadrature/include/Quadrature.h +++ b/libs/fem/quadrature/include/Quadrature.h @@ -20,12 +20,13 @@ #define CFEM_QUADRATURE_H #include -#include #include +#include + +#include "cfem_topology.h" #include "cfemutils.h" -#include "Vector3D.h" #include "DynamicVector.h" -#include "cfem_topology.h" +#include "Vector3D.h" namespace cfem { diff --git a/libs/fem/reference_element/include/ReferenceElement.h b/libs/fem/reference_element/include/ReferenceElement.h index 75dff1c..2563859 100644 --- a/libs/fem/reference_element/include/ReferenceElement.h +++ b/libs/fem/reference_element/include/ReferenceElement.h @@ -19,17 +19,16 @@ #pragma once #include "cfemutils.h" -#include "Vector3D.h" -#include "DynamicVector.h" #include "DynamicMatrix.h" -#include "Tensor3D.h" +#include "DynamicVector.h" #include "EvaluationFlags.h" - -#include "ShapeInfo.h" -#include "ShapeInfoBatch.h" #include "MappingInfo.h" #include "MappingInfoBatch.h" #include "MappingInfoBatchView.h" +#include "ShapeInfo.h" +#include "ShapeInfoBatch.h" +#include "Tensor3D.h" +#include "Vector3D.h" namespace cfem::reference_elem { diff --git a/libs/fem/reference_element/include/ReferenceElementFactory.h b/libs/fem/reference_element/include/ReferenceElementFactory.h index 195fc11..d04359f 100644 --- a/libs/fem/reference_element/include/ReferenceElementFactory.h +++ b/libs/fem/reference_element/include/ReferenceElementFactory.h @@ -24,8 +24,8 @@ #ifndef CFEM_REFERENCE_ELEMENT_FACTORY_H #define CFEM_REFERENCE_ELEMENT_FACTORY_H -#include "ReferenceElement.h" #include "cfem_topology.h" // For CellType definition +#include "ReferenceElement.h" namespace cfem { diff --git a/libs/fem/reference_element/include/ReferenceElements.h b/libs/fem/reference_element/include/ReferenceElements.h index c3987c4..8a434cf 100644 --- a/libs/fem/reference_element/include/ReferenceElements.h +++ b/libs/fem/reference_element/include/ReferenceElements.h @@ -18,9 +18,9 @@ #pragma once -#include "ReferenceSegment.h" -#include "ReferenceTriangle.h" +#include "ReferenceHexahedron.h" +#include "ReferencePrism.h" #include "ReferenceQuad.h" +#include "ReferenceSegment.h" #include "ReferenceTetrahedron.h" -#include "ReferencePrism.h" -#include "ReferenceHexahedron.h" \ No newline at end of file +#include "ReferenceTriangle.h" diff --git a/libs/fem/reference_element/include/ReferenceHexahedron.h b/libs/fem/reference_element/include/ReferenceHexahedron.h index d2b12a3..36da8e9 100644 --- a/libs/fem/reference_element/include/ReferenceHexahedron.h +++ b/libs/fem/reference_element/include/ReferenceHexahedron.h @@ -19,10 +19,12 @@ #ifndef CFEM_REFERENCE_HEXAHEDRON #define CFEM_REFERENCE_HEXAHEDRON -#include "ReferenceElement.h" #include +#include #include +#include "ReferenceElement.h" + namespace cfem::reference_elem::utils { diff --git a/libs/fem/reference_element/include/ReferencePrism.h b/libs/fem/reference_element/include/ReferencePrism.h index 5a620b0..55a1fc3 100644 --- a/libs/fem/reference_element/include/ReferencePrism.h +++ b/libs/fem/reference_element/include/ReferencePrism.h @@ -19,10 +19,11 @@ #ifndef CFEM_REFERENCE_PRISM #define CFEM_REFERENCE_PRISM -#include "ReferenceElement.h" #include #include +#include "ReferenceElement.h" + namespace cfem::reference_elem::utils{ inline Vector3D projectFacetRefCoordToPrismRefCoord(CfemInt localFacetId, diff --git a/libs/fem/reference_element/include/ReferenceQuad.h b/libs/fem/reference_element/include/ReferenceQuad.h index 3874a1b..a537232 100644 --- a/libs/fem/reference_element/include/ReferenceQuad.h +++ b/libs/fem/reference_element/include/ReferenceQuad.h @@ -19,10 +19,11 @@ #ifndef CFEM_REFERENCE_QUAD #define CFEM_REFERENCE_QUAD -#include "ReferenceElement.h" #include #include +#include "ReferenceElement.h" + namespace cfem::reference_elem::utils { inline Vector3D projectFacetRefCoordToQuadRefCoord(CfemInt localFacetId, const Vector3D &xiFacet) diff --git a/libs/fem/reference_element/include/ReferenceSegment.h b/libs/fem/reference_element/include/ReferenceSegment.h index 532a50b..18dd2d7 100644 --- a/libs/fem/reference_element/include/ReferenceSegment.h +++ b/libs/fem/reference_element/include/ReferenceSegment.h @@ -19,10 +19,11 @@ #ifndef CFEM_REFERENCE_SEGMENT_H #define CFEM_REFERENCE_SEGMENT_H -#include "ReferenceElement.h" #include #include +#include "ReferenceElement.h" + namespace cfem::reference_elem::utils { inline Vector3D projectFacetRefCoordToSegmentRefCoord(CfemInt localFacetId, const Vector3D &xiFacet) { diff --git a/libs/fem/reference_element/include/ReferenceTetrahedron.h b/libs/fem/reference_element/include/ReferenceTetrahedron.h index 166b73b..48f958f 100644 --- a/libs/fem/reference_element/include/ReferenceTetrahedron.h +++ b/libs/fem/reference_element/include/ReferenceTetrahedron.h @@ -19,11 +19,12 @@ #ifndef CFEM_REFERENCE_TETRAHEDRON #define CFEM_REFERENCE_TETRAHEDRON -#include "ReferenceElement.h" -#include #include +#include #include +#include "ReferenceElement.h" + namespace cfem::reference_elem::utils{ inline Vector3D projectFacetRefCoordToTetraRefCoord(CfemInt localFacetId, diff --git a/libs/fem/reference_element/include/ReferenceTriangle.h b/libs/fem/reference_element/include/ReferenceTriangle.h index fef8f28..d63db58 100644 --- a/libs/fem/reference_element/include/ReferenceTriangle.h +++ b/libs/fem/reference_element/include/ReferenceTriangle.h @@ -19,12 +19,12 @@ #ifndef CFEM_REFERENCE_TRIANGLE #define CFEM_REFERENCE_TRIANGLE -#include "ReferenceElement.h" -#include "Vector3D.h" - #include -#include #include +#include + +#include "ReferenceElement.h" +#include "Vector3D.h" namespace cfem::reference_elem::utils{ diff --git a/libs/fem/reference_element/src/ReferenceElementFactory.cpp b/libs/fem/reference_element/src/ReferenceElementFactory.cpp index 59e227b..bc57aeb 100644 --- a/libs/fem/reference_element/src/ReferenceElementFactory.cpp +++ b/libs/fem/reference_element/src/ReferenceElementFactory.cpp @@ -16,9 +16,9 @@ // --- held liable for any damages arising from the use of this software. //************************************************************************ +#include "FESpace.h" #include "ReferenceElementFactory.h" #include "ReferenceElements.h" -#include "FESpace.h" namespace cfem { diff --git a/libs/kernel/include/EvalContext.h b/libs/kernel/include/EvalContext.h index e772549..55a13ba 100644 --- a/libs/kernel/include/EvalContext.h +++ b/libs/kernel/include/EvalContext.h @@ -1,39 +1,39 @@ -// //************************************************************************ -// // --- CFEM++ Library -// // --- -// // --- Copyright 2024-2026 Ismaël Tchinda Ngueyong et al. -// // --- ALL RIGHTS RESERVED -// // --- -// // --- This software is protected by international copyright laws. -// // --- Use, distribution, or modification of this software in any form, -// // --- source or binary, for personal, academic, or non-commercial -// // --- purposes is permitted free of charge, provided that this -// // --- copyright notice and this permission notice appear in all -// // --- copies and supporting documentation. -// // --- -// // --- The authors and contributors provide this code "as is" without -// // --- any express or implied warranty. In no event shall they be -// // --- held liable for any damages arising from the use of this software. -// //************************************************************************ +//************************************************************************ +// --- CFEM++ Library +// --- +// --- Copyright 2024-2026 Ismaël Tchinda Ngueyong et al. +// --- ALL RIGHTS RESERVED +// --- +// --- This software is protected by international copyright laws. +// --- Use, distribution, or modification of this software in any form, +// --- source or binary, for personal, academic, or non-commercial +// --- purposes is permitted free of charge, provided that this +// --- copyright notice and this permission notice appear in all +// --- copies and supporting documentation. +// --- +// --- The authors and contributors provide this code "as is" without +// --- any express or implied warranty. In no event shall they be +// --- held liable for any damages arising from the use of this software. +//************************************************************************ #pragma once -#include "cfemutils.h" -#include "Vector3D.h" -#include "ShapeInfo.h" -#include "ShapeInfoBatch.h" -#include "MappingInfo.h" -#include "MappingInfoBatch.h" -#include "MappingInfoBatchView.h" -#include "DynamicVector.h" -#include "DynamicMatrix.h" - -#include -#include +#include #include #include #include -#include +#include +#include + +#include "cfemutils.h" +#include "DynamicMatrix.h" +#include "DynamicVector.h" +#include "MappingInfo.h" +#include "MappingInfoBatch.h" +#include "MappingInfoBatchView.h" +#include "ShapeInfo.h" +#include "ShapeInfoBatch.h" +#include "Vector3D.h" namespace cfem { diff --git a/libs/kernel/include/EvaluationFlags.h b/libs/kernel/include/EvaluationFlags.h index e3f15a6..420177e 100644 --- a/libs/kernel/include/EvaluationFlags.h +++ b/libs/kernel/include/EvaluationFlags.h @@ -18,9 +18,10 @@ #pragma once -#include "cfemutils.h" #include +#include "cfemutils.h" + namespace cfem { /** diff --git a/libs/kernel/include/MappingInfo.h b/libs/kernel/include/MappingInfo.h index f71bc9c..cb3dbfe 100644 --- a/libs/kernel/include/MappingInfo.h +++ b/libs/kernel/include/MappingInfo.h @@ -1,15 +1,29 @@ +//************************************************************************ +// --- CFEM++ Library +// --- +// --- Copyright 2024-2026 Ismaël Tchinda Ngueyong et al. +// --- ALL RIGHTS RESERVED +// --- +// --- This software is protected by international copyright laws. +// --- Use, distribution, or modification of this software in any form, +// --- source or binary, for personal, academic, or non-commercial +// --- purposes is permitted free of charge, provided that this +// --- copyright notice and this permission notice appear in all +// --- copies and supporting documentation. +// --- +// --- The authors and contributors provide this code "as is" without +// --- any express or implied warranty. In no event shall they be +// --- held liable for any damages arising from the use of this software. +//************************************************************************ + #pragma once #include "cfemutils.h" -#include "kernel_utils.h" #include "EvaluationFlags.h" -#include "DynamicMatrix.h" -#include "DynamicMatrix.h" -#include "Tensor3D.h" -#include "Tensor2D.h" - +#include "kernel_utils.h" #include "ShapeInfo.h" - +#include "Tensor2D.h" +#include "Tensor3D.h" namespace cfem { @@ -19,7 +33,8 @@ namespace cfem * * This structure implements a Structure-of-Arrays (SoA) layout to store physical gradients * and Hessians for a set of quadrature points. - * * ### Performance Design + * + * ### Performance Design * - **Contiguous Memory:** Derivatives are stored in a single `DynamicVector` allocation. * - **Cache Locality:** Optimized for L1/L2 cache prefetching by using padded strides. * - **Zero Overhead:** Accessors provide lightweight views (raw pointers) to data without diff --git a/libs/kernel/include/MappingInfoBatch.h b/libs/kernel/include/MappingInfoBatch.h index 761eca0..1ed6356 100644 --- a/libs/kernel/include/MappingInfoBatch.h +++ b/libs/kernel/include/MappingInfoBatch.h @@ -19,14 +19,12 @@ #pragma once #include "cfemutils.h" -#include "kernel_utils.h" -#include "EvaluationFlags.h" -#include "DynamicMatrix.h" #include "DynamicMatrix.h" -#include "Tensor3D.h" -#include "Tensor2D.h" - +#include "EvaluationFlags.h" +#include "kernel_utils.h" #include "MappingInfoBatchView.h" +#include "Tensor2D.h" +#include "Tensor3D.h" namespace cfem { diff --git a/libs/kernel/include/MappingInfoBatchView.h b/libs/kernel/include/MappingInfoBatchView.h index 2a6dc8d..5d3bb4f 100644 --- a/libs/kernel/include/MappingInfoBatchView.h +++ b/libs/kernel/include/MappingInfoBatchView.h @@ -18,10 +18,11 @@ #pragma once +#include + #include "cfemutils.h" -#include "kernel_utils.h" #include "EvaluationFlags.h" -#include +#include "kernel_utils.h" namespace cfem { diff --git a/libs/kernel/include/ShapeInfo.h b/libs/kernel/include/ShapeInfo.h index 4333294..796d73c 100644 --- a/libs/kernel/include/ShapeInfo.h +++ b/libs/kernel/include/ShapeInfo.h @@ -19,12 +19,11 @@ #pragma once #include "cfemutils.h" -#include "kernel_utils.h" - +#include "DynamicMatrix.h" +#include "DynamicVector.h" #include "EvaluationFlags.h" +#include "kernel_utils.h" #include "Tensor3D.h" -#include "DynamicVector.h" -#include "DynamicMatrix.h" namespace cfem { diff --git a/libs/kernel/include/ShapeInfoBatch.h b/libs/kernel/include/ShapeInfoBatch.h index 74f111b..8b60383 100644 --- a/libs/kernel/include/ShapeInfoBatch.h +++ b/libs/kernel/include/ShapeInfoBatch.h @@ -19,12 +19,11 @@ #pragma once #include "cfemutils.h" -#include "kernel_utils.h" - +#include "DynamicMatrix.h" +#include "DynamicVector.h" #include "EvaluationFlags.h" +#include "kernel_utils.h" #include "Tensor3D.h" -#include "DynamicVector.h" -#include "DynamicMatrix.h" namespace cfem { diff --git a/libs/prepostprocessing/numerical_integration/include/ScalarFunctionalEvaluator.h b/libs/prepostprocessing/numerical_integration/include/ScalarFunctionalEvaluator.h index 85accf5..c1c1ccf 100644 --- a/libs/prepostprocessing/numerical_integration/include/ScalarFunctionalEvaluator.h +++ b/libs/prepostprocessing/numerical_integration/include/ScalarFunctionalEvaluator.h @@ -18,14 +18,15 @@ #pragma once -#include "CfemExpression.h" -#include "Quadrature.h" -#include "cfem_topology.h" -#include "FESpace.h" -#include #include -#include +#include #include +#include + +#include "cfem_topology.h" +#include "CfemExpression.h" +#include "FESpace.h" +#include "Quadrature.h" namespace cfem { diff --git a/libs/prepostprocessing/numerical_integration/src/ScalarFunctionalEvaluator.cpp b/libs/prepostprocessing/numerical_integration/src/ScalarFunctionalEvaluator.cpp index 0e5df14..88e6d90 100644 --- a/libs/prepostprocessing/numerical_integration/src/ScalarFunctionalEvaluator.cpp +++ b/libs/prepostprocessing/numerical_integration/src/ScalarFunctionalEvaluator.cpp @@ -16,23 +16,21 @@ // --- held liable for any damages arising from the use of this software. //************************************************************************ -#include "ScalarFunctionalEvaluator.h" -#include "ReferenceElementFactory.h" +#include +#include + +#include "EvalContext.h" #include "LagrangeSpace.h" +#include "MappingInfo.h" +#include "MappingInfoBatch.h" +#include "MappingInfoBatchView.h" #include "MathOperators.h" #include "Mesh.h" #include "MeshEntity.h" -#include "EvalContext.h" - +#include "ReferenceElementFactory.h" +#include "ScalarFunctionalEvaluator.h" #include "ShapeInfo.h" #include "ShapeInfoBatch.h" -#include "MappingInfo.h" -#include "MappingInfoBatch.h" -#include "MappingInfoBatchView.h" - - -#include -#include namespace cfem { diff --git a/libs/utils/include/CfemLogger.h b/libs/utils/include/CfemLogger.h index 3601873..955742f 100644 --- a/libs/utils/include/CfemLogger.h +++ b/libs/utils/include/CfemLogger.h @@ -17,11 +17,12 @@ //************************************************************************ #pragma once +#include #include #include #include -#include #include + #include "ContractException.h" // Intégration de tes contrats namespace cfem { diff --git a/libs/utils/include/ChronoManager.h b/libs/utils/include/ChronoManager.h index f55bbbb..ba85b2c 100644 --- a/libs/utils/include/ChronoManager.h +++ b/libs/utils/include/ChronoManager.h @@ -19,12 +19,13 @@ #ifndef PROFILER_HPP #define PROFILER_HPP -#include +#include #include +#include #include -#include -#include #include +#include + #include "ContractException.h" namespace cfem diff --git a/libs/utils/include/ContractException.h b/libs/utils/include/ContractException.h index 5315163..fbc6d4d 100644 --- a/libs/utils/include/ContractException.h +++ b/libs/utils/include/ContractException.h @@ -19,11 +19,11 @@ #ifndef CFEM_CONTRACT_EXCEPTION_H #define CFEM_CONTRACT_EXCEPTION_H -#include -#include -#include #include #include +#include +#include +#include #include "cfemtypes.h" diff --git a/libs/utils/include/DynamicMatrix.h b/libs/utils/include/DynamicMatrix.h index 56f518e..35264f5 100644 --- a/libs/utils/include/DynamicMatrix.h +++ b/libs/utils/include/DynamicMatrix.h @@ -27,14 +27,15 @@ #ifndef CFEM_DYNAMIC_MATRIX #define CFEM_DYNAMIC_MATRIX -#include "cfemutils.h" -#include "FixedMatrix.h" -#include "DynamicVector.h" -#include -#include -#include #include +#include +#include #include +#include + +#include "cfemutils.h" +#include "DynamicVector.h" +#include "FixedMatrix.h" namespace cfem { diff --git a/libs/utils/include/DynamicVector.h b/libs/utils/include/DynamicVector.h index 2f9b8ff..6d77bbe 100644 --- a/libs/utils/include/DynamicVector.h +++ b/libs/utils/include/DynamicVector.h @@ -27,13 +27,14 @@ #ifndef CFEM_DYNAMIC_VECTOR_ #define CFEM_DYNAMIC_VECTOR_ -#include "cfemutils.h" -#include "FixedVector.h" -#include -#include -#include #include +#include +#include #include +#include + +#include "cfemutils.h" +#include "FixedVector.h" namespace cfem { diff --git a/libs/utils/include/FixedMatrix.h b/libs/utils/include/FixedMatrix.h index 7617a78..bae68a8 100644 --- a/libs/utils/include/FixedMatrix.h +++ b/libs/utils/include/FixedMatrix.h @@ -26,11 +26,12 @@ #ifndef CFEM_STATIC_MATRIX #define CFEM_STATIC_MATRIX -#include "cfemutils.h" -#include "FixedVector.h" #include #include +#include "cfemutils.h" +#include "FixedVector.h" + namespace cfem { diff --git a/libs/utils/include/FixedVector.h b/libs/utils/include/FixedVector.h index f403a76..4edb83c 100644 --- a/libs/utils/include/FixedVector.h +++ b/libs/utils/include/FixedVector.h @@ -27,11 +27,12 @@ #ifndef CFEM_STATIC_VECTOR #define CFEM_STATIC_VECTOR -#include "cfemutils.h" -#include "Vector3D.h" -#include #include #include +#include + +#include "cfemutils.h" +#include "Vector3D.h" namespace cfem{ diff --git a/libs/utils/include/Vector2D.h b/libs/utils/include/Vector2D.h index 72ff297..84ecf3e 100644 --- a/libs/utils/include/Vector2D.h +++ b/libs/utils/include/Vector2D.h @@ -29,10 +29,11 @@ #pragma once -#include "cfemutils.h" +#include #include #include -#include + +#include "cfemutils.h" namespace cfem { diff --git a/libs/utils/include/Vector3D.h b/libs/utils/include/Vector3D.h index 17607ac..60b8f67 100644 --- a/libs/utils/include/Vector3D.h +++ b/libs/utils/include/Vector3D.h @@ -29,10 +29,11 @@ #pragma once -#include "cfemutils.h" +#include #include #include -#include + +#include "cfemutils.h" namespace cfem { diff --git a/libs/utils/include/cfem_algebra.h b/libs/utils/include/cfem_algebra.h index 108e712..483cca4 100644 --- a/libs/utils/include/cfem_algebra.h +++ b/libs/utils/include/cfem_algebra.h @@ -19,15 +19,12 @@ #ifndef CFEM_ALGEBRA_H #define CFEM_ALGEBRA_H -#include "cfemutils.h" - -#include "FixedVector.h" +#include "cfemutils.h" #include "FixedMatrix.h" - -#include "Vector2D.h" -#include "Vector3D.h" - +#include "FixedVector.h" #include "Tensor2D.h" #include "Tensor3D.h" +#include "Vector2D.h" +#include "Vector3D.h" #endif \ No newline at end of file diff --git a/libs/utils/include/cfem_topology.h b/libs/utils/include/cfem_topology.h index adc2a84..b2c5ed1 100644 --- a/libs/utils/include/cfem_topology.h +++ b/libs/utils/include/cfem_topology.h @@ -19,13 +19,14 @@ #ifndef CFEM_TOPOLOGY_H #define CFEM_TOPOLOGY_H -#include "cfemutils.h" -#include "Vector3D.h" #include #include #include #include +#include "cfemutils.h" +#include "Vector3D.h" + namespace cfem{ enum class MeshOrder{ None, Linear = 1, Quadratic = 2}; diff --git a/libs/utils/include/cfemutils.h b/libs/utils/include/cfemutils.h index 0fab802..7de76f9 100644 --- a/libs/utils/include/cfemutils.h +++ b/libs/utils/include/cfemutils.h @@ -19,16 +19,16 @@ #ifndef CFEMUTILS_ #define CFEMUTILS_ +#include #include -#include -#include #include -#include +#include +#include -#include "ContractException.h" #include "CfemLogger.h" #include "cfemtypes.h" #include "ChronoManager.h" +#include "ContractException.h" //#include "numeric_policy.h" /** diff --git a/libs/utils/include/numeric_policy.h b/libs/utils/include/numeric_policy.h index a5f14f9..5262ed1 100644 --- a/libs/utils/include/numeric_policy.h +++ b/libs/utils/include/numeric_policy.h @@ -20,6 +20,7 @@ #define CFEM_NUMERIC_POLICY_H #include + #include "cfemutils.h" namespace cfem diff --git a/libs/wrappers/petsc/include/PetscKSPSolver.h b/libs/wrappers/petsc/include/PetscKSPSolver.h index 3230989..4879ef1 100644 --- a/libs/wrappers/petsc/include/PetscKSPSolver.h +++ b/libs/wrappers/petsc/include/PetscKSPSolver.h @@ -32,6 +32,7 @@ #include #include + #include "PetscMatrix.h" #include "PetscVector.h" diff --git a/libs/wrappers/petsc/src/PetscKSPSolver.cpp b/libs/wrappers/petsc/src/PetscKSPSolver.cpp index 6579d7b..9b6ef16 100644 --- a/libs/wrappers/petsc/src/PetscKSPSolver.cpp +++ b/libs/wrappers/petsc/src/PetscKSPSolver.cpp @@ -27,12 +27,12 @@ * *************************************************************************************** */ -#include "PetscKSPSolver.h" -#include "internal/petscUtils.h" -#include "cfemutils.h" - #include +#include "cfemutils.h" +#include "internal/petscUtils.h" +#include "PetscKSPSolver.h" + /** ************************************************************************************** * @brief Construct a new Solver with an optional PETSc prefix. * @param prefix Optional string to group options (e.g., "outer_") diff --git a/libs/wrappers/petsc/src/PetscMatrix.cpp b/libs/wrappers/petsc/src/PetscMatrix.cpp index 9a58c6a..fc70e21 100644 --- a/libs/wrappers/petsc/src/PetscMatrix.cpp +++ b/libs/wrappers/petsc/src/PetscMatrix.cpp @@ -25,10 +25,9 @@ * @copyright Copyright (c) 2026 *************************************************************************************** */ -#include "PetscMatrix.h" -#include "internal/petscUtils.h" - #include "cfemutils.h" +#include "internal/petscUtils.h" +#include "PetscMatrix.h" /** ************************************************************************************** * @brief Construct a new PetscMatrix and allocate memory. diff --git a/libs/wrappers/petsc/src/PetscVector.cpp b/libs/wrappers/petsc/src/PetscVector.cpp index 4d36a10..25afbf5 100644 --- a/libs/wrappers/petsc/src/PetscVector.cpp +++ b/libs/wrappers/petsc/src/PetscVector.cpp @@ -27,9 +27,9 @@ * *************************************************************************************** */ -#include "PetscVector.h" #include "cfemutils.h" #include "internal/petscUtils.h" +#include "PetscVector.h" /** ************************************************************************************** * @brief Construct a distributed PETSc vector. diff --git a/scripts/format_legacy_code.py b/scripts/format_legacy_code.py new file mode 100755 index 0000000..5a6f468 --- /dev/null +++ b/scripts/format_legacy_code.py @@ -0,0 +1,135 @@ +#!/usr/bin/env python3 +import os + +# --- Configuration --- +DIRECTORIES_TO_SCAN = ['src', 'include', 'libs', 'tests'] # Ajoute tes dossiers ici +EXTENSIONS = ('.h', '.hpp', '.cpp', '.cc', '.cxx', '.tpp') + +COPYRIGHT_HEADER = [ + "//************************************************************************\n", + "// --- CFEM++ Library\n", + "// ---\n", + "// --- Copyright 2024-2026 Ismaël Tchinda Ngueyong et al.\n", + "// --- ALL RIGHTS RESERVED\n", + "// ---\n", + "// --- This software is protected by international copyright laws.\n", + "// --- Use, distribution, or modification of this software in any form,\n", + "// --- source or binary, for personal, academic, or non-commercial \n", + "// --- purposes is permitted free of charge, provided that this \n", + "// --- copyright notice and this permission notice appear in all \n", + "// --- copies and supporting documentation.\n", + "// ---\n", + "// --- The authors and contributors provide this code \"as is\" without \n", + "// --- any express or implied warranty. In no event shall they be \n", + "// --- held liable for any damages arising from the use of this software.\n", + "//************************************************************************\n" +] + +def fix_copyright(lines): + """Add copyright notice if not already added.""" + # Si le fichier commence déjà par des étoiles ou 'CFEM++', on assume qu'il a un header + if lines and len(lines) > 5 and "CFEM++" in "".join(lines[:10]): + return lines, False + + # Sinon, on injecte le header avec une ligne vide + return COPYRIGHT_HEADER + ["\n"] + lines, True + +def fix_includes(lines): + """Sort and create two groups respectively for external library and local files.""" + start_idx = -1 + end_idx = -1 + includes = [] + + for i, line in enumerate(lines): + stripped = line.strip() + if stripped.startswith('#include'): + if start_idx == -1: + start_idx = i + end_idx = i + includes.append(stripped) + elif not stripped or stripped.startswith('//') or stripped.startswith('/*') or stripped.startswith('*'): + continue + elif stripped.startswith('#pragma') or stripped.startswith('#ifndef') or stripped.startswith('#define'): + continue + else: + if start_idx != -1: + break + + if not includes: + return lines, False + + sys_includes = set() + loc_includes = set() + + for inc in includes: + if '<' in inc and '>' in inc: + sys_includes.add(inc) + else: + loc_includes.add(inc) + + sys_list = sorted(list(sys_includes), key=lambda x: (x.lower(), x)) + loc_list = sorted(list(loc_includes), key=lambda x: (x.lower(), x)) + + ideal_block = [] + if sys_list: + ideal_block.extend(sys_list) + if sys_list and loc_list: + ideal_block.append("") + if loc_list: + ideal_block.extend(loc_list) + + ideal_str = "\n".join(ideal_block) + "\n" + + # Extraction du bloc actuel pour comparaison + current_clean = [] + for line in lines[start_idx:end_idx+1]: + s = line.strip() + if s.startswith('#include'): + current_clean.append(s) + elif s == '' and current_clean and current_clean[-1] != '': + current_clean.append('') + + while current_clean and current_clean[-1] == '': + current_clean.pop() + + current_str = "\n".join(current_clean) + "\n" + + if ideal_str != current_str: + # Remplacement + new_lines = lines[:start_idx] + [line + "\n" for line in ideal_block] + lines[end_idx+1:] + return new_lines, True + + return lines, False + +def process_file(filepath): + with open(filepath, 'r', encoding='utf-8') as f: + lines = f.readlines() + + original_lines = lines.copy() + + lines, copyright_fixed = fix_copyright(lines) + lines, includes_fixed = fix_includes(lines) + + if copyright_fixed or includes_fixed: + with open(filepath, 'w', encoding='utf-8') as f: + f.writelines(lines) + + actions = [] + if copyright_fixed: actions.append("Copyright") + if includes_fixed: actions.append("Includes") + print(f" Update ({' & '.join(actions)}) : {filepath}") + +def main(): + print("Starting the CFEM++ code standardization...\n") + for root_dir in DIRECTORIES_TO_SCAN: + if not os.path.exists(root_dir): + continue + for root, _, files in os.walk(root_dir): + for file in files: + if file.endswith(EXTENSIONS): + filepath = os.path.join(root, file) + process_file(filepath) + print("\n Standardization completed ! Track the changes using 'git diff'.") + +if __name__ == "__main__": + main() diff --git a/tests/expressions/test_symbolic_simplification.cpp b/tests/expressions/test_symbolic_simplification.cpp index 6ab7028..db2b702 100644 --- a/tests/expressions/test_symbolic_simplification.cpp +++ b/tests/expressions/test_symbolic_simplification.cpp @@ -17,8 +17,9 @@ //************************************************************************ #include -#include "VariableExpression.h" + #include "MathOperators.h" // Your symbolic headers +#include "VariableExpression.h" using namespace cfem::sym; using namespace cfem::sym::symengine; diff --git a/tests/fem/test_domain_integrator.cpp b/tests/fem/test_domain_integrator.cpp index 720e60e..64eff02 100644 --- a/tests/fem/test_domain_integrator.cpp +++ b/tests/fem/test_domain_integrator.cpp @@ -17,12 +17,13 @@ //************************************************************************ #include + #include "cfemutils.h" -#include "Mesh.h" -#include "ScalarFunctionalEvaluator.h" -#include "MathOperators.h" #include "FEField.h" #include "LagrangeSpace.h" +#include "MathOperators.h" +#include "Mesh.h" +#include "ScalarFunctionalEvaluator.h" using namespace cfem; using namespace cfem::sym; diff --git a/tests/fem/test_fefield.cpp b/tests/fem/test_fefield.cpp index 0c09d48..dc2e399 100644 --- a/tests/fem/test_fefield.cpp +++ b/tests/fem/test_fefield.cpp @@ -19,12 +19,12 @@ #include #include "cfemutils.h" -#include "Mesh.h" +#include "DGSpace.h" #include "FEField.h" +#include "LagrangeSpace.h" #include "MathOperators.h" +#include "Mesh.h" #include "ScalarFunctionalEvaluator.h" -#include "LagrangeSpace.h" -#include "DGSpace.h" using namespace cfem; using namespace cfem::sym; diff --git a/tests/fem/test_fields.cpp b/tests/fem/test_fields.cpp index 1fb826c..d900588 100644 --- a/tests/fem/test_fields.cpp +++ b/tests/fem/test_fields.cpp @@ -17,10 +17,11 @@ //************************************************************************ #include + #include "cfemutils.h" -#include "Vector3D.h" -#include "Tensor3D.h" #include "MathOperators.h" +#include "Tensor3D.h" +#include "Vector3D.h" using namespace cfem; using namespace cfem::sym; diff --git a/tests/fem/test_quadrature.cpp b/tests/fem/test_quadrature.cpp index 973a3a1..2ad5ec4 100644 --- a/tests/fem/test_quadrature.cpp +++ b/tests/fem/test_quadrature.cpp @@ -16,17 +16,17 @@ // --- held liable for any damages arising from the use of this software. //************************************************************************ +#include #include -#include #include -#include +#include +#include "Quadrature.h" #include "ReferenceElement.h" -#include "ReferenceTriangle.h" #include "ReferenceQuad.h" #include "ReferenceSegment.h" #include "ReferenceTetrahedron.h" -#include "Quadrature.h" +#include "ReferenceTriangle.h" using namespace cfem; diff --git a/tests/fem/test_reference_element.cpp b/tests/fem/test_reference_element.cpp index 207232b..49647ca 100644 --- a/tests/fem/test_reference_element.cpp +++ b/tests/fem/test_reference_element.cpp @@ -16,8 +16,8 @@ // --- held liable for any damages arising from the use of this software. //************************************************************************ -#include #include +#include #include "ReferenceElements.h" diff --git a/tests/grenier/old_main.cpp b/tests/grenier/old_main.cpp index 4d714ae..0457552 100644 --- a/tests/grenier/old_main.cpp +++ b/tests/grenier/old_main.cpp @@ -27,18 +27,18 @@ * 5. Exporting data to VTK for Paraview visualization. */ +#include +#include +#include + #include "cfemutils.h" -#include "Vector3D.h" +#include "FEField.h" +#include "LagrangeSpace.h" #include "Mesh.h" #include "MeshConformityChecker.h" -#include "LagrangeSpace.h" -#include "FEField.h" +#include "Vector3D.h" #include "VTKExporter.h" -#include -#include -#include - using namespace cfem; static char help[] = "CFEM Example: Field projection on a quadratic mesh.\n\n"; diff --git a/tests/mesh/test_gmsh_parser.cpp b/tests/mesh/test_gmsh_parser.cpp index 04f7eec..b71e21b 100644 --- a/tests/mesh/test_gmsh_parser.cpp +++ b/tests/mesh/test_gmsh_parser.cpp @@ -16,8 +16,9 @@ // --- held liable for any damages arising from the use of this software. //************************************************************************ -#include #include +#include + #include "Mesh.h" using namespace cfem; diff --git a/tests/mesh/test_mesh.cpp b/tests/mesh/test_mesh.cpp index e23329a..83fff2d 100644 --- a/tests/mesh/test_mesh.cpp +++ b/tests/mesh/test_mesh.cpp @@ -16,13 +16,14 @@ // --- held liable for any damages arising from the use of this software. //************************************************************************ +#include +#include +#include #include -#include #include #include -#include -#include -#include +#include + #include "cfemutils.h" #include "Mesh.h" diff --git a/tests/test_main.cpp b/tests/test_main.cpp index 4119ae0..34879d1 100644 --- a/tests/test_main.cpp +++ b/tests/test_main.cpp @@ -17,9 +17,10 @@ //************************************************************************ #include +#include #include + #include "cfemutils.h" -#include int main(int argc, char **argv) { // omp_set_num_threads(1); diff --git a/tests/utils/tensors/test_tensor_addition.cpp b/tests/utils/tensors/test_tensor_addition.cpp index 53a8e54..0641a40 100644 --- a/tests/utils/tensors/test_tensor_addition.cpp +++ b/tests/utils/tensors/test_tensor_addition.cpp @@ -1,6 +1,24 @@ -#include +//************************************************************************ +// --- CFEM++ Library +// --- +// --- Copyright 2024-2026 Ismaël Tchinda Ngueyong et al. +// --- ALL RIGHTS RESERVED +// --- +// --- This software is protected by international copyright laws. +// --- Use, distribution, or modification of this software in any form, +// --- source or binary, for personal, academic, or non-commercial +// --- purposes is permitted free of charge, provided that this +// --- copyright notice and this permission notice appear in all +// --- copies and supporting documentation. +// --- +// --- The authors and contributors provide this code "as is" without +// --- any express or implied warranty. In no event shall they be +// --- held liable for any damages arising from the use of this software. +//************************************************************************ + #include #include +#include #include "Tensor3D.h" diff --git a/tests/utils/tensors/test_tensor_product.cpp b/tests/utils/tensors/test_tensor_product.cpp index 36be064..36de75f 100644 --- a/tests/utils/tensors/test_tensor_product.cpp +++ b/tests/utils/tensors/test_tensor_product.cpp @@ -1,6 +1,24 @@ -#include +//************************************************************************ +// --- CFEM++ Library +// --- +// --- Copyright 2024-2026 Ismaël Tchinda Ngueyong et al. +// --- ALL RIGHTS RESERVED +// --- +// --- This software is protected by international copyright laws. +// --- Use, distribution, or modification of this software in any form, +// --- source or binary, for personal, academic, or non-commercial +// --- purposes is permitted free of charge, provided that this +// --- copyright notice and this permission notice appear in all +// --- copies and supporting documentation. +// --- +// --- The authors and contributors provide this code "as is" without +// --- any express or implied warranty. In no event shall they be +// --- held liable for any damages arising from the use of this software. +//************************************************************************ + #include #include +#include #include "Tensor3D.h" diff --git a/tests/utils/tensors/test_tensor_substraction.cpp b/tests/utils/tensors/test_tensor_substraction.cpp index 219f1f7..02de0a9 100644 --- a/tests/utils/tensors/test_tensor_substraction.cpp +++ b/tests/utils/tensors/test_tensor_substraction.cpp @@ -1,6 +1,24 @@ -#include +//************************************************************************ +// --- CFEM++ Library +// --- +// --- Copyright 2024-2026 Ismaël Tchinda Ngueyong et al. +// --- ALL RIGHTS RESERVED +// --- +// --- This software is protected by international copyright laws. +// --- Use, distribution, or modification of this software in any form, +// --- source or binary, for personal, academic, or non-commercial +// --- purposes is permitted free of charge, provided that this +// --- copyright notice and this permission notice appear in all +// --- copies and supporting documentation. +// --- +// --- The authors and contributors provide this code "as is" without +// --- any express or implied warranty. In no event shall they be +// --- held liable for any damages arising from the use of this software. +//************************************************************************ + #include #include +#include #include "Tensor3D.h" diff --git a/tests/utils/test_dynamic_matrix.cpp b/tests/utils/test_dynamic_matrix.cpp index fa84785..8692ce7 100644 --- a/tests/utils/test_dynamic_matrix.cpp +++ b/tests/utils/test_dynamic_matrix.cpp @@ -17,9 +17,10 @@ //************************************************************************ #include + #include "DynamicMatrix.h" -#include "FixedMatrix.h" #include "DynamicVector.h" +#include "FixedMatrix.h" using namespace cfem; diff --git a/tests/utils/test_dynamic_vector.cpp b/tests/utils/test_dynamic_vector.cpp index eabc04a..922d0d8 100644 --- a/tests/utils/test_dynamic_vector.cpp +++ b/tests/utils/test_dynamic_vector.cpp @@ -17,6 +17,7 @@ //************************************************************************ #include + #include "DynamicVector.h" #include "FixedVector.h" diff --git a/tests/utils/test_fixed_matrix.cpp b/tests/utils/test_fixed_matrix.cpp index 1b86199..9981238 100644 --- a/tests/utils/test_fixed_matrix.cpp +++ b/tests/utils/test_fixed_matrix.cpp @@ -17,6 +17,7 @@ //************************************************************************ #include + #include "FixedMatrix.h" using namespace cfem; diff --git a/tests/utils/test_fixed_vector.cpp b/tests/utils/test_fixed_vector.cpp index f61e6eb..93adf63 100644 --- a/tests/utils/test_fixed_vector.cpp +++ b/tests/utils/test_fixed_vector.cpp @@ -17,6 +17,7 @@ //************************************************************************ #include + #include "FixedVector.h" using namespace cfem; diff --git a/tests/utils/test_sym_tensor_o2.cpp b/tests/utils/test_sym_tensor_o2.cpp index 2ce8c47..47ebd9c 100644 --- a/tests/utils/test_sym_tensor_o2.cpp +++ b/tests/utils/test_sym_tensor_o2.cpp @@ -17,6 +17,7 @@ //************************************************************************ #include + #include "cfemutils.h" #include "Tensor3D.h" diff --git a/tests/utils/test_vector3d.cpp b/tests/utils/test_vector3d.cpp index be58491..ee058bb 100644 --- a/tests/utils/test_vector3d.cpp +++ b/tests/utils/test_vector3d.cpp @@ -17,6 +17,7 @@ //************************************************************************ #include + #include "Vector3D.h" using namespace cfem; diff --git a/tests/wrappers/test_petsc_wrappers.cpp b/tests/wrappers/test_petsc_wrappers.cpp index 79518ae..f202cfa 100644 --- a/tests/wrappers/test_petsc_wrappers.cpp +++ b/tests/wrappers/test_petsc_wrappers.cpp @@ -26,11 +26,11 @@ * @copyright Copyright (c) 2026 *************************************************************************************** */ -#include -#include "PetscKSPSolver.h" #include +#include #include "cfemutils.h" +#include "PetscKSPSolver.h" //------------------------------------------------------------- // Linear solver correctness: Identity matrix