Closed santiagobadia closed 2 years ago
The reason is that e.g. for boundary or skeleton terms, you do not have a mass matrix and/or stiffness matrix. Now @oriolcg is using the solution 0.0*u*v
Now we have
function get_cell_residual(tr::TransientFETermFromIntegration,t::Real,uh,uh_t,v)
@assert is_a_fe_function(uh)
@assert is_a_fe_function(uh_t)
@assert is_a_fe_cell_basis(v)
_v = restrict(v,tr.trian)
_uh = restrict(uh,tr.trian)
_uh_t = restrict(uh_t,tr.trian)
integrate(tr.res(t,_uh,_uh_t,_v),tr.trian,tr.quad)
end
something like this
function get_cell_residual(tr::TransientFETermFromIntegration,t::Real,uh,uh_t,v)
@assert is_a_fe_function(uh)
@assert is_a_fe_function(uh_t)
@assert is_a_fe_cell_basis(v)
_v = restrict(v,tr.trian)
_uh = restrict(uh,tr.trian)
_uh_t = restrict(uh_t,tr.trian)
if tr.res == nothing
# Create a trivial method that can deal with what comes next
else
integrate(tr.res(t,_uh,_uh_t,_v),tr.trian,tr.quad)
end
is this acceptable? How to define the nothing
-like object that will be cheap (almost do-nothing) and will not return errors later?
is this acceptable? How to define the nothing-like object that will be cheap (almost do-nothing) and will not return errors later?
At this level you can do almost anything you like without worrying about performance
to add to the alrady existing terms and deal internally with nothing for some terms in an efficient way. Any suggestion?
This is a way of doing it. The other option would be to have a syntax in the line of the issue https://github.com/gridap/Gridap.jl/issues/265. But, this is something that needs to be further explored.
@fverdugo and @oriolcg
In
GridapODEs
we have lots of possible options to define terms (linear or nonlinear syntax; vector, stiffness matrix or mass matrix, etc). I propose the following:to add to the alrady existing terms and deal internally with
nothing
for some terms in an efficient way.Any suggestion?