Skip to content

Commit d59842b

Browse files
authored
Merge branch 'gridap:master' into master
2 parents 9de0b0c + 3a8b4ef commit d59842b

7 files changed

Lines changed: 49 additions & 76 deletions

File tree

.github/dependabot.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
2+
version: 2
3+
updates:
4+
- package-ecosystem: "github-actions"
5+
directory: "/" # Location of package manifests
6+
schedule:
7+
interval: "monthly"

.github/workflows/ci.yml

Lines changed: 23 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,18 @@ jobs:
1212
fail-fast: false
1313
matrix:
1414
version:
15-
- '1.6'
15+
- '1.10'
1616
os:
1717
- ubuntu-latest
1818
arch:
1919
- x64
2020
steps:
21-
- uses: actions/checkout@v2
22-
- uses: julia-actions/setup-julia@v1
21+
- uses: actions/checkout@v4
22+
- uses: julia-actions/setup-julia@v2
2323
with:
2424
version: ${{ matrix.version }}
2525
arch: ${{ matrix.arch }}
26-
- uses: actions/cache@v1
27-
env:
28-
cache-name: cache-artifacts
29-
with:
30-
path: ~/.julia/artifacts
31-
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
32-
restore-keys: |
33-
${{ runner.os }}-test-${{ env.cache-name }}-
34-
${{ runner.os }}-test-
35-
${{ runner.os }}-
26+
- uses: julia-actions/cache@v2
3627
- uses: julia-actions/julia-buildpkg@v1
3728
- run: cd test/; julia --project=.. --color=yes --check-bounds=yes runtests.jl poisson.jl validation.jl elasticity.jl
3829
tutorials_set_2:
@@ -42,27 +33,18 @@ jobs:
4233
fail-fast: false
4334
matrix:
4435
version:
45-
- '1.6'
36+
- '1.10'
4637
os:
4738
- ubuntu-latest
4839
arch:
4940
- x64
5041
steps:
51-
- uses: actions/checkout@v2
52-
- uses: julia-actions/setup-julia@v1
42+
- uses: actions/checkout@v4
43+
- uses: julia-actions/setup-julia@v2
5344
with:
5445
version: ${{ matrix.version }}
5546
arch: ${{ matrix.arch }}
56-
- uses: actions/cache@v1
57-
env:
58-
cache-name: cache-artifacts
59-
with:
60-
path: ~/.julia/artifacts
61-
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
62-
restore-keys: |
63-
${{ runner.os }}-test-${{ env.cache-name }}-
64-
${{ runner.os }}-test-
65-
${{ runner.os }}-
47+
- uses: julia-actions/cache@v2
6648
- uses: julia-actions/julia-buildpkg@v1
6749
- run: cd test/; julia --project=.. --color=yes --check-bounds=yes runtests.jl p_laplacian.jl hyperelasticity.jl dg_discretization.jl fsi_tutorial.jl
6850
tutorials_set_3:
@@ -72,27 +54,18 @@ jobs:
7254
fail-fast: false
7355
matrix:
7456
version:
75-
- '1.6'
57+
- '1.10'
7658
os:
7759
- ubuntu-latest
7860
arch:
7961
- x64
8062
steps:
81-
- uses: actions/checkout@v2
82-
- uses: julia-actions/setup-julia@v1
63+
- uses: actions/checkout@v4
64+
- uses: julia-actions/setup-julia@v2
8365
with:
8466
version: ${{ matrix.version }}
8567
arch: ${{ matrix.arch }}
86-
- uses: actions/cache@v1
87-
env:
88-
cache-name: cache-artifacts
89-
with:
90-
path: ~/.julia/artifacts
91-
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
92-
restore-keys: |
93-
${{ runner.os }}-test-${{ env.cache-name }}-
94-
${{ runner.os }}-test-
95-
${{ runner.os }}-
68+
- uses: julia-actions/cache@v2
9669
- uses: julia-actions/julia-buildpkg@v1
9770
- run: cd test/; julia --project=.. --color=yes --check-bounds=yes runtests.jl darcy.jl inc_navier_stokes.jl stokes.jl poisson_dev_fe.jl emscatter.jl
9871
tutorials_set_4:
@@ -102,27 +75,18 @@ jobs:
10275
fail-fast: false
10376
matrix:
10477
version:
105-
- '1.6'
78+
- '1.10'
10679
os:
10780
- ubuntu-latest
10881
arch:
10982
- x64
11083
steps:
111-
- uses: actions/checkout@v2
112-
- uses: julia-actions/setup-julia@v1
84+
- uses: actions/checkout@v4
85+
- uses: julia-actions/setup-julia@v2
11386
with:
11487
version: ${{ matrix.version }}
11588
arch: ${{ matrix.arch }}
116-
- uses: actions/cache@v1
117-
env:
118-
cache-name: cache-artifacts
119-
with:
120-
path: ~/.julia/artifacts
121-
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
122-
restore-keys: |
123-
${{ runner.os }}-test-${{ env.cache-name }}-
124-
${{ runner.os }}-test-
125-
${{ runner.os }}-
89+
- uses: julia-actions/cache@v2
12690
- uses: julia-actions/julia-buildpkg@v1
12791
- run: cd test/; julia --project=.. --color=yes --check-bounds=yes runtests.jl isotropic_damage.jl validation_DrWatson.jl interpolation_fe.jl transient_linear.jl transient_nonlinear.jl TopOptEMFocus.jl
12892
tutorials_mpi:
@@ -132,37 +96,28 @@ jobs:
13296
fail-fast: false
13397
matrix:
13498
version:
135-
- '1.6'
99+
- '1.10'
136100
os:
137101
- ubuntu-latest
138102
arch:
139103
- x64
140104
steps:
141-
- uses: actions/checkout@v2
142-
- uses: julia-actions/setup-julia@v1
105+
- uses: actions/checkout@v4
106+
- uses: julia-actions/setup-julia@v2
143107
with:
144108
version: ${{ matrix.version }}
145109
arch: ${{ matrix.arch }}
146-
- uses: actions/cache@v1
147-
env:
148-
cache-name: cache-artifacts
149-
with:
150-
path: ~/.julia/artifacts
151-
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
152-
restore-keys: |
153-
${{ runner.os }}-test-${{ env.cache-name }}-
154-
${{ runner.os }}-test-
155-
${{ runner.os }}-
110+
- uses: julia-actions/cache@v2
156111
- uses: julia-actions/julia-buildpkg@v1
157112
- run: cd test/; julia --project=.. --color=yes --check-bounds=yes runtests_mpi.jl
158113
docs:
159114
name: Documentation
160115
runs-on: ubuntu-latest
161116
steps:
162-
- uses: actions/checkout@v2
163-
- uses: julia-actions/setup-julia@v1
117+
- uses: actions/checkout@v4
118+
- uses: julia-actions/setup-julia@v2
164119
with:
165-
version: '1.6'
120+
version: '1.10'
166121
- run: |
167122
julia --project=docs -e '
168123
using Pkg

Project.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,8 @@ GridapGmsh = "0.7"
3939
GridapP4est = "0.3"
4040
GridapPETSc = "0.5"
4141
MPI = "0.20"
42-
PartitionedArrays = "=0.3.3"
4342
SpecialFunctions = "1"
44-
julia = "1.3"
43+
julia = "1.6"
4544

4645
[extras]
4746
MPIPreferences = "3da0fdf6-3ccc-4f1b-acd9-58baa6c99267"

src/darcy.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ uD = VectorValue(0.0,0.0)
7878
U = TrialFESpace(V,uD)
7979
P = TrialFESpace(Q)
8080

81-
# When the singe-field spaces have been designed, the multi-field test and trial spaces are expressed as arrays of single-field ones in a natural way.
81+
# When the sinlge-field spaces have been designed, the multi-field test and trial spaces are expressed as arrays of single-field ones in a natural way.
8282

8383
Y = MultiFieldFESpace([V, Q])
8484
X = MultiFieldFESpace([U, P])

src/elasticity.jl

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,9 @@ end
177177

178178
a(u,v) = ( ε(v) (σ_bimat(ε(u),tags)) )*
179179

180-
# In previous line, pay attention in the usage of the new constitutive law `σ_bimat`. Note that we have passed the vector `tags` containing the material identifiers in the last argument of the function`.
180+
# In previous line, pay attention in the usage of the new constitutive law `σ_bimat`. Note that we have passed the vector `tags` containing the material identifiers in the last argument of the function.
181181
#
182-
# At this point, we can build the FE problem again and solve it
182+
# At this point, we can build the FE problem again and solve it:
183183

184184
op = AffineFEOperator(a,l,U,V0)
185185
uh = solve(op)
@@ -189,5 +189,17 @@ uh = solve(op)
189189
writevtk(Ω,"results_bimat",cellfields=
190190
["uh"=>uh,"epsi"=>ε(uh),"sigma"=>σ_bimat(ε(uh),tags)])
191191

192+
# #### Constant multi-material law
193+
#
194+
# A material law depending on the model tags but not on the fields can be defined as follow:
195+
196+
tags_field = CellField(tags, Ω)
197+
σ_from_tag(tag) = tag==alu_tag ? 1. : 0.
198+
σ_bimat_cst = σ_from_tag tags_field
199+
200+
# `tags_field` is a field which value at $x$ is the tag of the cell containing $x$. `σ_bimat_cst` is used like a constant in (bi)linear form definition and solution export:
201+
202+
a(u,v) = ( σ_bimat_cst * (u)(v))*
203+
writevtk(Ω,"const_law",cellfields= ["sigma"=>σ_bimat_cst])
192204

193205
# Tutorial done!

src/fsi_tutorial.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
# <a name="geometry"></a>
6767
# ```
6868
# ### Geometry and Discrete model
69-
# In this tutorial we solve the benchmark descrived in [1], consisting on a flow over an elastic flag after a cylinder.
69+
# In this tutorial we solve the benchmark described in [1], consisting on a flow over an elastic flag after a cylinder.
7070
# The computational domain is defined by a channel of size $\Omega \doteq (0,4.5)\times(0,0.41)$, with an embedded cylinder of radius $R=0.05$ and center at $C=(0.2,0.2)$. The associated FE triangulation is denoted by $\mathcal{T}$, the fluid and solid domain and their associated triangulations will be denoted by $\Omega_{\rm F}$, $\Omega_{\rm S}$, $\mathcal{T}_{\rm F}$ and $\mathcal{T}_{\rm S}$, respectively.
7171
#
7272
# In order to load the discrete model we first setup Gridap

src/transient_linear.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,10 @@ f(t) = x -> sin(t) * sinpi(x[1]) * sinpi(x[2])
7878
m(t, dtu, v) = (v * dtu)dΩ
7979
a(t, u, v) = (α(t) * (v) (u))dΩ
8080
l(t, v) = (v * f(t))dΩ
81-
op = TransientLinearFEOperator((m, a), l, Ug, V0)
81+
op = TransientLinearFEOperator((a, m), l, Ug, V0)
8282

8383
# In our case, the mass term ($m(t, \cdot, \cdot)$) is constant in time. We can take advantage of that to save some computational effort, and indicate it to Gridap as follows
84-
op_opt = TransientLinearFEOperator((m, a), l, Ug, V0, constant_forms=(true, false))
84+
op_opt = TransientLinearFEOperator((a, m), l, Ug, V0, constant_forms=(true, false))
8585

8686
# If the stiffness term ($a(t, \cdot, \cdot)$) had been constant in time, we could have set `constant_forms=(true, true)`.
8787

0 commit comments

Comments
 (0)