Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
227 changes: 227 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,227 @@
---
Language: Cpp
Standard: Auto
BasedOnStyle: ''
DisableFormat: false
# do not indent modifiers, i.e., public,protected,private,...
AccessModifierOffset: -1
# maximum number of columns per line
ColumnLimit : 120

AlignAfterOpenBracket: AlwaysBreak
AlignArrayOfStructures: Left

# do not align consecutive assignments
AlignConsecutiveAssignments: None

# align macros definition
AlignConsecutiveMacros: AcrossEmptyLinesAndComments

# do not align consecutive declarations
AlignConsecutiveDeclarations: None

# aligning backslashes in escaped newlines
AlignEscapedNewlines: Right

# align operands of expressions that need to split over multiple lines
AlignOperands: Align

# align trailing comments, stop to align if there are more than 1 empty line
AlignTrailingComments: true

# do not put each argument of a function call on a separate line
AllowAllArgumentsOnNextLine: true

# do not put each parameter of a function declaration on a separate line
AllowAllParametersOfDeclarationOnNextLine: true

# contract on a single lines the following
AllowShortBlocksOnASingleLine: Always
AllowShortEnumsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: WithoutElse
AllowShortLambdasOnASingleLine: All
AllowShortLoopsOnASingleLine: true

# do not contract switch case statments
AllowShortCaseLabelsOnASingleLine: false

AlwaysBreakAfterReturnType: None
# go to newline after template declaration only if it cannot fit one line
AlwaysBreakTemplateDeclarations: MultiLine

AttributeMacros: ['__capability']

# put function call's arguments and function declaration's parameters all on the same line
BinPackArguments: true
BinPackParameters: true

# add one space on each side of : in a bit field
BitFieldColonSpacing: Both

# control of individual brace wrapping cases
BreakBeforeBraces: Custom # brace breaking style
BraceWrapping:
AfterCaseLabel: false
AfterClass: false
AfterControlStatement: Never
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
BeforeLambdaBody: false
BeforeWhile: false
IndentBraces: false

# other breaking rules
BreakBeforeBinaryOperators: None
BreakBeforeConceptDeclarations: Always
BreakBeforeInheritanceComma: false
BreakInheritanceList: AfterColon
BreakBeforeTernaryOperators: false
BreakConstructorInitializers: AfterColon
BreakStringLiterals: true

# a regular expression that describes comments with special meaning, which should not be split into lines or otherwise changed.
CommentPragmas: '^ fdaPDE pragma:'

QualifierAlignment: Leave

# put each namespace on its line
CompactNamespaces: false
# number of characters to use for indentation of constructor initializer lists as well as inheritance lists.
ConstructorInitializerIndentWidth: 4
ConstructorInitializerAllOnOneLineOrOnePerLine: false
# if constructor initializers do not fit current line, try to fit them on the next line
PackConstructorInitializers: NextLine

# indent with for all continuations
ContinuationIndentWidth: 2

# use c++11 braced list style: No spaces inside the braced list, no line break before the closing brace, indentation with the continuation indent
Cpp11BracedListStyle: true

# never put an empty line after and before public, protected, private
EmptyLineAfterAccessModifier: Never
EmptyLineBeforeAccessModifier: Never

# add a namespace foo at closing namespace brace
FixNamespaceComments: true

# put first system includes starting with <, then internal includes
IncludeBlocks: Regroup
IncludeCategories:
- Regex: '^<.*\.h>'
Priority: 1
CaseSensitive: false
- Regex: '^<.*'
Priority: 2
CaseSensitive: false
- Regex: '.*'
Priority: 3
CaseSensitive: false
SortIncludes: CaseSensitive
SortUsingDeclarations: true

# indentation rules
IndentAccessModifiers: false
IndentCaseLabels: false
IndentCaseBlocks: false
IndentGotoLabels: true
IndentPPDirectives: AfterHash
IndentExternBlock: AfterExternBlock
IndentRequiresClause: true
IndentWrappedFunctionNames: false

# indentation with
IndentWidth: 4
TabWidth: 4

# always insert braces after control statments
InsertBraces: false
InsertTrailingCommas: None

# remove empty lines at start of new block
KeepEmptyLinesAtTheStartOfBlocks: false

# align lambda body relative to the lambda signature
LambdaBodyIndentation: Signature

MacroBlockBegin: ''
MacroBlockEnd: ''

# do not keep more than one empty line
MaxEmptyLinesToKeep: 1

# indent namespaces, but only the inner block is indented
NamespaceIndentation: None

# align pointer * to left, i.e., int* a instead of int *a. references follows same style
PointerAlignment: Left
ReferenceAlignment: Pointer

# do not format comments
ReflowComments: true
RemoveBracesLLVM: false

RequiresClausePosition: OwnLine

SeparateDefinitionBlocks: Leave
ShortNamespaceLines: 1

SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false

# insert a space after template keyword
SpaceAfterTemplateKeyword: true
# insert a space before assignment operator
SpaceBeforeAssignmentOperators: true
# no space before a case colon
SpaceBeforeCaseColon: false
# insert a space before braced list
SpaceBeforeCpp11BracedList: true
# insert a space after colon constructor initializer list
SpaceBeforeCtorInitializerColon: true
# insert a space after colon inheritance list
SpaceBeforeInheritanceColon: true

# other spacing definition
SpaceBeforeParens: Custom
SpaceBeforeParensOptions:
AfterControlStatements: true
AfterFunctionDefinitionName: false
AfterFunctionDeclarationName: false
AfterIfMacros: true
AfterOverloadedOperator: false
AfterRequiresInClause: false
AfterRequiresInExpression: false
BeforeNonEmptyParentheses: false

SpaceAroundPointerQualifiers: Default
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyBlock: true
SpaceInEmptyParentheses: false

SpacesBeforeTrailingComments: 3
# never put spaces in template parameter lists
SpacesInAngles: Never
# never put spaces in conditional statments
SpacesInConditionalStatement: false
SpacesInContainerLiterals: false
SpacesInCStyleCastParentheses: false
# one space is forced after // start of comment, but more are possible
SpacesInLineCommentPrefix:
Minimum: 1
Maximum: -1

# no spaces after and before round or square brakets
SpacesInParentheses: false
SpacesInSquareBrackets: false
SpaceBeforeSquareBrackets: false

# never use tab, always replace them with spaces
UseTab: Never
21 changes: 21 additions & 0 deletions .github/workflows/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# define base OS environment
FROM alpine:latest

# install base dependencies for compiling and testing fdaPDE

# base system dependencies
RUN apk --no-cache add --update \
g++ \
clang \
libstdc++ \
cmake \
git \
make

# c++ library dependencies
RUN apk add --update \
eigen-dev

# test dependencies
RUN apk add --update \
gtest-dev
29 changes: 29 additions & 0 deletions .github/workflows/test-linux-clang.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: test-linux-clang
on:
push:
branches: [ stable, develop ]

jobs:
build:
runs-on: ubuntu-latest
container:
image: alepalu/fdapde-docker-linux:latest
steps:
- name: checkout repository
uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: run_tests
run: |
cd test/
export Eigen3_DIR=/usr/share/cmake/Modules # reguired to let eigen3 work with CMake in alpine
chmod +x run_tests.sh
./run_tests.sh --compiler clang
echo "TEST_RESULT=$(echo $?)" >> $GITHUB_ENV
- name: check_tests_passed
run: |
if [ "$TEST_RESULT" -eq "0" ]; then
exit 0
else
exit 1
fi
29 changes: 29 additions & 0 deletions .github/workflows/test-linux-gcc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: test-linux-gcc
on:
push:
branches: [ stable, develop ]

jobs:
build:
runs-on: ubuntu-latest
container:
image: alepalu/fdapde-docker-linux:latest
steps:
- name: checkout repository
uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: run_tests
run: |
cd test/
export Eigen3_DIR=/usr/share/cmake/Modules # reguired to let eigen3 work with CMake in alpine
chmod +x run_tests.sh
./run_tests.sh --compiler gcc
echo "TEST_RESULT=$(echo $?)" >> $GITHUB_ENV
- name: check_tests_passed
run: |
if [ "$TEST_RESULT" -eq "0" ]; then
exit 0
else
exit 1
fi
29 changes: 29 additions & 0 deletions .github/workflows/test-macos-clang.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: test-macos-clang
on:
push:
branches: [ stable, develop ]

jobs:
build:
runs-on: macos-13
steps:
- name: checkout repository
uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: install_eigen
run: |
brew install eigen
- name: run_tests
run: |
cd test/
chmod +x run_tests.sh
./run_tests.sh --compiler clang
echo "TEST_RESULT=$(echo $?)" >> $GITHUB_ENV
- name: check_tests_passed
run: |
if [ "$TEST_RESULT" -eq "0" ]; then
exit 0
else
exit 1
fi
48 changes: 48 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@

*.json
*.cmake
*Makefile
*.Rhistory
*.tar.gz
*.RData
*.o
*.so
test/fdapde_test
test/.cache
test/build/
build/
.DS_Store
.bash_history
.idea/
cmake-build-debug-docker/
cmake-build-default/

cmake-build-debug/
experiments/test_RSVD/performances.csv
.vscode
**/results/


#plots
*.pdf
*.png
*.txt
*.eps
!CMakeLists.txt

!simulations/sphere_diff/plot_mesh.png
!simulations/sphere_diff/plot_solution.png

!simulations/torus_diff/plot_mesh.png
!simulations/torus_diff/plot_solution.png

#help files
*.csv
*.mtx

#docs files
*.puml
.Rproj.user

#some test directories
test_massimo/
Loading