Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pre-commit action workflow #928

Merged
merged 2 commits into from
May 20, 2024
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Lint

on:
pull_request:
push:
branches: [master]

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
11 changes: 11 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: check-toml
- id: check-yaml
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace
10 changes: 5 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@ more discussion).
+ add!(dh, :u, Lagrange{RefTriangle, 1}())
```

- **VTK export**: Ferrite no longer extends methods from `WriteVTK.jl`, instead the new types
`VTKFile` and `VTKFileCollection` should be used instead. New methods exists for writing to
- **VTK export**: Ferrite no longer extends methods from `WriteVTK.jl`, instead the new types
`VTKFile` and `VTKFileCollection` should be used instead. New methods exists for writing to
a `VTKFile`, e.g. `write_solution`, `write_cell_data`, `write_node_data`, and `write_projection`.
See [#692][github-692].

Expand Down Expand Up @@ -267,14 +267,14 @@ more discussion).

- VTK export now work with `QuadraticHexahedron` elements. ([#714][github-714])

- The function `bounding_box(::AbstractGrid)` has been added. It computes the bounding box for
a given grid (based on its node coordinates), and returns the minimum and maximum vertices
- The function `bounding_box(::AbstractGrid)` has been added. It computes the bounding box for
a given grid (based on its node coordinates), and returns the minimum and maximum vertices
of the bounding box. ([#880][github-880])

### Changed

- `create_sparsity_pattern` now supports cross-element dof coupling by passing kwarg
`topology` along with an optional `cross_coupling` matrix that behaves similar to
`topology` along with an optional `cross_coupling` matrix that behaves similar to
the `coupling` kwarg. ([#710][github-#710])

- The `AbstractCell` interface has been reworked. This change should not affect user code,
Expand Down
6 changes: 3 additions & 3 deletions benchmark/benchmarks-assembly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ for spatial_dim ∈ 1:3

LAGRANGE_SUITE["ritz-galerkin"]["face-flux"] = @benchmarkable FerriteAssemblyHelper._generalized_ritz_galerkin_assemble_local_matrix($grid, $fsv, shape_gradient, shape_value, *)
LAGRANGE_SUITE["petrov-galerkin"]["face-flux"] = @benchmarkable FerriteAssemblyHelper._generalized_petrov_galerkin_assemble_local_matrix($grid, $fsv, shape_gradient, $fsv2, shape_value, *)

ip = DiscontinuousLagrange{ref_type, order}()
isv = InterfaceValues(qr_facet, ip, ip_geo);
isv2 = InterfaceValues(qr_facet, ip, ip_geo);
Expand All @@ -77,10 +77,10 @@ for spatial_dim ∈ 1:3

LAGRANGE_SUITE["ritz-galerkin"]["interface-{grad}⋅[[val]]"] = @benchmarkable FerriteAssemblyHelper._generalized_ritz_galerkin_assemble_interfaces($dh, $isv, shape_gradient_average, shape_value_jump, ⋅)
LAGRANGE_SUITE["petrov-galerkin"]["interface-{grad}⋅[[val]]"] = @benchmarkable FerriteAssemblyHelper._generalized_petrov_galerkin_assemble_interfaces($dh, $isv, shape_gradient_average, $isv2, shape_value_jump, ⋅)

LAGRANGE_SUITE["ritz-galerkin"]["interface-interior-penalty"] = @benchmarkable FerriteAssemblyHelper._generalized_ritz_galerkin_assemble_interfaces($dh, $isv, shape_value_jump, shape_value_jump, ⋅)
LAGRANGE_SUITE["petrov-galerkin"]["interface-interior-penalty"] = @benchmarkable FerriteAssemblyHelper._generalized_petrov_galerkin_assemble_interfaces($dh, $isv, shape_value_jump, $isv2, shape_value_jump, ⋅)

end
end
end
Expand Down
2 changes: 1 addition & 1 deletion docs/old_examples/README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
The examples in this folder might be out of date.
For up to date examples, see the documentation.
For up to date examples, see the documentation.
2 changes: 1 addition & 1 deletion docs/src/assets/references.bib
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ @phdthesis{Cenanovic2017
year={2017},
}
@misc{Kirby2017,
title={A general approach to transforming finite elements},
title={A general approach to transforming finite elements},
author={Robert C. Kirby},
year={2017},
eprint={1706.09017},
Expand Down
6 changes: 3 additions & 3 deletions docs/src/devdocs/FEValues.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* [`FacetValues`](@ref)
* [`BCValues`](@ref)
* [`PointValues`](@ref)


## Internal types
```@docs
Expand All @@ -20,7 +20,7 @@ Ferrite.BCValues

## Custom FEValues
Custom FEValues, `fe_v::AbstractValues`, should normally implement the [`reinit!`](@ref) method. Subtypes of `AbstractValues` have default implementations for some functions, but require some lower-level access functions, specifically

* [`function_value`](@ref), requires
* [`shape_value`](@ref)
* [`getnquadpoints`](@ref)
Expand All @@ -33,7 +33,7 @@ Custom FEValues, `fe_v::AbstractValues`, should normally implement the [`reinit!
* [`geometric_value`](@ref)
* `getngeobasefunctions`
* [`getnquadpoints`](@ref)


### Array bounds
* Asking for the `n`th quadrature point must be inside array bounds if `1 <= n <= getnquadpoints(fe_v)`. (`checkquadpoint` can, alternatively, be dispatched to check that `n` is inbounds.)
Expand Down
4 changes: 2 additions & 2 deletions docs/src/devdocs/interpolations.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Ferrite.mapping_type
```

for all entities which exist on that reference element. The dof functions default to having no
dofs defined on a specific entity. Hence, not overloading of the dof functions will result in an
element with zero dofs. Also, it should always be double checked that everything is consistent as
dofs defined on a specific entity. Hence, not overloading of the dof functions will result in an
element with zero dofs. Also, it should always be double checked that everything is consistent as
specified in the docstring of the corresponding function, as inconsistent implementations can
lead to bugs which are really difficult to track down.
4 changes: 2 additions & 2 deletions docs/src/literate-gallery/helmholtz.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# ```math
# n \cdot \nabla u = g_2 \quad x \in \Gamma_2
# ```
#
#
# Here Γ₁ is the union of the top and the right boundary of the square,
# while Γ₂ is the union of the bottom and the left boundary.
#
Expand Down Expand Up @@ -150,7 +150,7 @@ function doassemble(cellvalues::CellValues, facetvalues::FacetValues,
end
end
end

celldofs!(global_dofs, cell)
assemble!(assembler, global_dofs, fe, Ke)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ function solve(interpolation_u, interpolation_p)
end;

## Save the solution fields
addstep!(pvd, t) do io
addstep!(pvd, t) do io
write_solution(io, dh, w)
end
end;
Expand Down
Loading
Loading