-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
59c8601
commit 258bd74
Showing
2 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# make it possible to add equations, introduce a zero object for the rhs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# make it possible to assign a quadstrat to a specific operator or to a linear combination of operators | ||
|
||
struct AssignQuadStrat <: BEAST.AbstractOperator | ||
op::BEAST.AbstractOperator | ||
qs | ||
end | ||
# struct DefaultQuadstrat end | ||
# AssignQuadStrat(op,qs::DefaultQuadstrat) = op | ||
# function AssignQuadStrat(op::AssignQuadStrat,qs) | ||
# @warn "tryed but failed to overwrite quadstrat "*string(typeof(op.qs))*" assigned to "*string(typeof(op))*" with "*string(typeof(qs)) | ||
# op | ||
# end | ||
# assign_quadstrat(op::Operator, qs::AbstractQuadStrat) = AssignQuadStrat(op, qs) | ||
# operatortype(a::AbstractQuadStrat) = error("assign operatortype for quadstrat "*string(typeof(a))) | ||
|
||
# assign_quadstrat(op::LinearCombinationOfOperators, qs::AbstractQuadStrat) = sum([c*assign_quadstrat(opi, qs) for (c,opi) in zip(op.coeffs,op.ops)]) | ||
# function assign_quadstrat(op::LinearCombinationOfOperators, qss::Vector{<:AbstractQuadStrat}) | ||
# assign_quadstrat(op,qss,operatortype.(qss)) | ||
# end | ||
# function assign_quadstrat(op::LinearCombinationOfOperators, qss::Vector{<:AbstractQuadStrat}, operator_types::Vector) | ||
# return sum([c*assign_quadstrat(opi,qss[findfirst(x-> typeof(opi) ∈ x ,operator_types)]) for (c,opi) in zip(op.coeffs,op.ops)]) | ||
# end | ||
|
||
# assign_quadstrat(op::BilForm, qs) = BilForm(op.test_space,op.trial_space,assign_quadstrat(op.terms,qs)) | ||
# assign_quadstrat(op::BilTerm, qs) = BilTerm(op.test_id,op.trial_id,op.test_ops,op.trial_ops,op.coeff,assign_quadstrat(op.kernel,qs)) | ||
|
||
# assign_quadstrat(op::BilForm, qs, types) = BilForm(op.test_space,op.trial_space,assign_quadstrat(op.terms,qs,types)) | ||
# assign_quadstrat(op::BilTerm, qs, types) = BilTerm(op.test_id,op.trial_id,op.test_ops,op.trial_ops,op.coeff,assign_quadstrat(op.kernel,qs,types)) | ||
# scalartype(a::AssignQuadStrat) = scalartype(a.operator_types) | ||
|
||
function BEAST.assemble!(op::AssignQuadStrat,test_functions::BEAST.Space, trial_functions::BEAST.Space, | ||
store, threading;quadstrat=nothing) | ||
BEAST.assemble!(op.op,test_functions,trial_functions,store,threading; quadstrat=op.qs) | ||
end | ||
|
||
function BEAST.assemble(op::AssignQuadStrat, test_functions, trial_functions; | ||
storage_policy = Val{:bandedstorage}, | ||
quadstrat=nothing) | ||
BEAST.assemble(op, test_functions, trial_functions; storage_policy=storage_policy, quadstrat=op.qs) | ||
end |