Skip to content

Commit 85b6037

Browse files
committed
Adapt signatures and add docs
1 parent b94c86e commit 85b6037

File tree

4 files changed

+26
-3
lines changed

4 files changed

+26
-3
lines changed

src/common_restrictions/coupled_dofs_restriction.jl

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,24 @@ struct CoupledDofsRestriction{TM} <: AbstractRestriction
33
parameters::Dict{Symbol, Any}
44
end
55

6+
7+
"""
8+
CoupledDofsRestriction(matrix::AbstractMatrix)
9+
10+
Creates an restriction that couples dofs together.
11+
12+
The coupling is stored in a CSC Matrix `matrix`, s.t.,
13+
14+
dofᵢ = Σⱼ Aⱼᵢ dofⱼ (col-wise)
15+
16+
The matrix can be obtained from, e.g., `get_periodic_coupling_matrix`.
17+
"""
618
function CoupledDofsRestriction(matrix::AbstractMatrix)
719
return CoupledDofsRestriction(matrix, Dict{Symbol, Any}(:name => "CoupledDofsRestriction"))
820
end
921

1022

11-
function assemble!(R::CoupledDofsRestriction, A, b, sol, SC; kwargs...)
23+
function assemble!(R::CoupledDofsRestriction, SC; kwargs...)
1224

1325
# extract all col indices
1426
_, J, _ = findnz(R.coupling_matrix)

src/problemdescription.jl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,18 @@ function assign_operator!(PD::ProblemDescription, o::AbstractOperator)
9696
return length(PD.operators)
9797
end
9898

99+
"""
100+
$(TYPEDSIGNATURES)
101+
102+
Adds a restrction to a `ProblemDescription`.
103+
104+
# Arguments
105+
- `PD::ProblemDescription`: The problem description to which the operator should be added.
106+
- `r::AbstractRestriction`: The restriction to add.
99107
108+
# Returns
109+
- The index (position) of the restriction in the `restrictions` array of `PD`.
110+
"""
100111
function assign_restriction!(PD::ProblemDescription, r::AbstractRestriction)
101112
push!(PD.restrictions, r)
102113
return length(PD.restrictions)

src/restrictions.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function is_timedependent(R::AbstractRestriction)
1616
return false
1717
end
1818

19-
function assemble!(R::AbstractRestriction, A, b, sol, SC; kwargs...)
19+
function assemble!(R::AbstractRestriction, SC; kwargs...)
2020
## assembles internal restriction matrix in R
2121
return nothing
2222
end

src/solvers.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ function solve_linear_system!(A, b, sol, soltemp, residual, linsolve, unknowns,
227227
## assemble restrctions
228228
if !SC.parameters[:initialized]
229229
for restriction in PD.restrictions
230-
@timeit timer "$(restriction.parameters[:name])" assemble!(restriction, A, b, sol, SC; kwargs...)
230+
@timeit timer "$(restriction.parameters[:name])" assemble!(restriction, SC; kwargs...)
231231
end
232232
end
233233
end

0 commit comments

Comments
 (0)