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

JOSS paper #52

Merged
merged 44 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
5f65248
Added paper repository
JordiManyer Mar 22, 2024
b593712
Merge branch 'develop' of github.com:gridap/GridapSolvers.jl into jos…
JordiManyer Apr 7, 2024
c7e3551
Started writing paper
JordiManyer Apr 7, 2024
5e280ee
Added demo code
JordiManyer Apr 8, 2024
c1ea5f8
Merge branch 'develop' of github.com:gridap/GridapSolvers.jl into jos…
JordiManyer May 16, 2024
707fb07
Simplified demo
JordiManyer May 16, 2024
6c71e84
Merge branch 'main' of github.com:gridap/GridapSolvers.jl into joss-p…
JordiManyer May 16, 2024
60249d5
Added gadi drivers
JordiManyer May 16, 2024
c10a176
Fixed Gadi drivers
JordiManyer May 16, 2024
3785967
Reformated driver into a real module
JordiManyer Jun 13, 2024
9698fbf
Minor
JordiManyer Jun 14, 2024
4c4c83f
More fixes to driver
JordiManyer Jun 14, 2024
30562d1
Added gitignore
JordiManyer Jun 14, 2024
c1832e9
Further changes to scalability
JordiManyer Jun 19, 2024
98bd6aa
Minor
JordiManyer Jun 19, 2024
f899259
Minor
JordiManyer Jun 24, 2024
522ac8a
Merge branch 'remove-p4est' of github.com:gridap/GridapSolvers.jl int…
JordiManyer Jul 5, 2024
7cc0448
More modifications to the drivers
JordiManyer Jul 18, 2024
88aaade
Merge branch 'develop' of github.com:gridap/GridapSolvers.jl into jos…
JordiManyer Jul 18, 2024
ecdb14d
Minor
JordiManyer Jul 25, 2024
23e8514
Merge branch 'joss-paper' of github.com:gridap/GridapSolvers.jl into …
JordiManyer Jul 25, 2024
a7b6d1e
Merge branch 'develop' of github.com:gridap/GridapSolvers.jl into jos…
JordiManyer Jul 26, 2024
ae2d280
more changes
JordiManyer Jul 30, 2024
6e984df
Minor
JordiManyer Aug 6, 2024
ed8fff3
First finished draft on the paper
JordiManyer Aug 6, 2024
aa842f1
Update paper.md
amartinhuertas Aug 7, 2024
a93c2d3
Alberto comments
JordiManyer Aug 9, 2024
a4abb2e
Merge branch 'joss-paper' of github.com:gridap/GridapSolvers.jl into …
JordiManyer Aug 9, 2024
911512f
Update paper.md
amartinhuertas Aug 9, 2024
1d10628
Minor
JordiManyer Aug 9, 2024
530bf83
Merge branch 'joss-paper' of github.com:gridap/GridapSolvers.jl into …
JordiManyer Aug 9, 2024
58a9148
Minor
JordiManyer Aug 15, 2024
72af05a
Merge branch 'main' of github.com:gridap/GridapSolvers.jl into joss-p…
JordiManyer Aug 15, 2024
bd03b57
fixed Manifest.toml
JordiManyer Aug 17, 2024
1c79863
Added github action to automatically compile paper
JordiManyer Aug 21, 2024
afe9e61
First round of reviews
JordiManyer Aug 21, 2024
af93e9c
Minor
JordiManyer Aug 21, 2024
c55bf4f
Merge branch 'main' of github.com:gridap/GridapSolvers.jl into joss-p…
JordiManyer Sep 25, 2024
7e026de
Addressing first round of comments
JordiManyer Sep 25, 2024
1e204dd
Merge branch 'main' of github.com:gridap/GridapSolvers.jl into joss-p…
JordiManyer Oct 2, 2024
070bd46
minor changes in paper.md
danielskatz Oct 4, 2024
14a52ff
minor changes in paper.bib
danielskatz Oct 4, 2024
60194f7
Merge pull request #75 from danielskatz/patch-1
JordiManyer Oct 4, 2024
0cdcb13
Merge branch 'main' of github.com:gridap/GridapSolvers.jl into joss-p…
JordiManyer Dec 3, 2024
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
24 changes: 24 additions & 0 deletions .github/workflows/joss.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Joss Paper
on: [push]

jobs:
paper:
runs-on: ubuntu-latest
name: Paper Draft Compilation
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build draft PDF
uses: openjournals/openjournals-draft-action@master
with:
journal: joss
# This should be the path to the paper within your repo.
paper-path: joss_paper/paper.md
- name: Upload
uses: actions/upload-artifact@v4
with:
name: paper
# This is the output path where Pandoc will write the compiled
# PDF. Note, this should be the same directory as the input
# paper.md
path: joss_paper/paper.pdf
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.vscode
Manifest.toml
LocalPreferences.toml
data
data/*
3 changes: 3 additions & 0 deletions joss_paper/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
paper.crossref
paper.pdf
demo
96 changes: 96 additions & 0 deletions joss_paper/demo.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
using Gridap, Gridap.Algebra, Gridap.MultiField
using PartitionedArrays, GridapDistributed, GridapSolvers

using GridapSolvers.LinearSolvers
using GridapSolvers.MultilevelTools
using GridapSolvers.BlockSolvers

function get_bilinear_form(mh_lev,biform,qdegree)
model = get_model(mh_lev)
Ω = Triangulation(model)
dΩ = Measure(Ω,qdegree)
return (u,v) -> biform(u,v,dΩ)
end

function add_labels!(labels)
add_tag_from_tags!(labels,"top",[6])
add_tag_from_tags!(labels,"walls",[1,2,3,4,5,7,8])
end

with_mpi() do distribute
np_per_level = [(2,2),(1,1)] # Number of processors per GMG level
parts = distribute(LinearIndices((prod(np_per_level[1]),)))

# Create multi-level mesh
domain = (0,1,0,1) # Cartesian domain (xmin,xmax,ymin,ymax)
ncells = (10,10) # Number of cells
mh = CartesianModelHierarchy(parts,np_per_level,domain,ncells;add_labels!)
model = get_model(mh,1) # Finest mesh

# Create FESpaces
fe_order = 2
reffe_u = ReferenceFE(lagrangian,VectorValue{2,Float64},fe_order)
reffe_p = ReferenceFE(lagrangian,Float64,fe_order-1;space=:P)

tests_u = TestFESpace(mh,reffe_u,dirichlet_tags=["walls","top"])
trials_u = TrialFESpace(tests_u,[VectorValue(0.0,0.0),VectorValue(1.0,0.0)])
U, V = get_fe_space(trials_u,1), get_fe_space(tests_u,1)
Q = TestFESpace(model,reffe_p;conformity=:L2,constraint=:zeromean)

mfs = BlockMultiFieldStyle()
X = MultiFieldFESpace([U,Q];style=mfs)
Y = MultiFieldFESpace([V,Q];style=mfs)

# Weak formulation
f = VectorValue(1.0,1.0)
biform_u(u,v,dΩ) = ∫(∇(v)⊙∇(u))dΩ
biform((u,p),(v,q),dΩ) = biform_u(u,v,dΩ) - ∫((∇⋅v)*p)dΩ - ∫((∇⋅u)*q)dΩ
liform((v,q),dΩ) = ∫(v⋅f)dΩ

# Assemble linear system
qdegree = 2*(fe_order+1) # Quadrature degree
Ω = Triangulation(model)
dΩ = Measure(Ω,qdegree)
op = AffineFEOperator((u,v)->biform(u,v,dΩ),v->liform(v,dΩ),X,Y)
A, b = get_matrix(op), get_vector(op)

# GMG preconditioner for the velocity block
biforms = map(mh) do mhl
get_bilinear_form(mhl,biform_u,qdegree)
end
smoothers = map(view(mh,1:num_levels(mh)-1)) do mhl
RichardsonSmoother(JacobiLinearSolver(),10,2.0/3.0)
end
restrictions, prolongations = setup_transfer_operators(
trials_u, qdegree; mode=:residual, solver=CGSolver(JacobiLinearSolver())
)
solver_u = GMGLinearSolver(
mh,trials_u,tests_u,biforms,
prolongations,restrictions,
pre_smoothers=smoothers,
post_smoothers=smoothers,
coarsest_solver=LUSolver(),
maxiter=4,mode=:solver
)

# PCG solver for the pressure block
solver_p = CGSolver(JacobiLinearSolver();maxiter=20,atol=1e-14,rtol=1.e-6)

# 2x2 Block triangular preconditioner
blocks = [LinearSystemBlock() LinearSystemBlock();
LinearSystemBlock() BiformBlock((p,q) -> ∫(p*q)dΩ,Q,Q)]
P = BlockTriangularSolver(blocks,[solver_u,solver_p])

# Global solver
solver = FGMRESSolver(10,P;rtol=1.e-8,verbose=i_am_main(parts))
ns = numerical_setup(symbolic_setup(solver,A),A)

# Solve
x = allocate_in_domain(A)
fill!(x,0.0)
solve!(x,ns,b)

# Postprocess
uh, ph = FEFunction(X,x)
writevtk(Ω,"demo",cellfields=["uh"=>uh,"ph"=>ph])
end
1 change: 1 addition & 0 deletions joss_paper/docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sudo docker run -it --rm -v $(pwd):/data -u $(id -u):$(id -g) openjournals/inara -o pdf,crossref paper.md
25 changes: 25 additions & 0 deletions joss_paper/packages.dot
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# https://sketchviz.com/@JordiManyer/a34cdc3942aab5c0e011c05ce12bc2e5

digraph G {
graph [fontname = "Handlee"];
node [fontname = "Handlee"];
edge [fontname = "Handlee",arrowhead=vee,arrowtail=vee];

bgcolor=transparent;

"Gridap.jl" -> "GridapDistributed.jl" [dir=back]
"Gridap.jl" -> "GridapPETSC.jl" [dir=back]
"PartitionedArrays.jl" -> "GridapPETSC.jl" [dir=back]
"PartitionedArrays.jl" -> "GridapDistributed.jl" [dir=back]
"GridapDistributed.jl" -> "GridapP4est.jl" [dir=back]
"GridapDistributed.jl" -> "GridapSolvers.jl" [dir=back]
"GridapPETSC.jl" -> "GridapSolvers.jl" [dir=back,style=dashed]
"GridapP4est.jl" -> "GridapSolvers.jl" [dir=back,style=dashed]

"Gridap.jl" [shape=rectangle]
"PartitionedArrays.jl" [shape=rectangle]
"GridapDistributed.jl" [shape=rectangle]
"GridapPETSC.jl" [shape=rectangle]
"GridapP4est.jl" [shape=rectangle]
"GridapSolvers.jl" [style=filled,shape=rectangle]
}
Binary file added joss_paper/packages.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions joss_paper/packages.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

dot -Tpng -opackages.png packages.dot
Loading
Loading