Skip to content

Commit

Permalink
Added new @NotImplemented flags
Browse files Browse the repository at this point in the history
  • Loading branch information
JordiManyer committed Feb 13, 2023
1 parent 5ca897d commit 8c64ca1
Showing 1 changed file with 17 additions and 18 deletions.
35 changes: 17 additions & 18 deletions src/Adaptivity/AdaptedTriangulations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,9 @@ for (stype,ttype) in [(:AdaptedTriangulation,:AdaptedTriangulation),(:AdaptedTri
return is_change_possible($sstrian,$tttrian)
end

#if isa($sstrian,BodyFittedTriangulation) && isa($tttrian,BodyFittedTriangulation)
return is_related(strian,ttrian)
#end

# Support for Boundary, Skeletton, ... triangulations is not yet implemented
# unless they are based on the same background model.
@notimplemented
return false
strian_is_cell_wise = (num_cell_dims(strian) == num_point_dims(strian))
trians_are_related = is_related(strian,ttrian)
return strian_is_cell_wise && trians_are_related
end
end
@eval begin
Expand All @@ -131,23 +126,24 @@ for (stype,ttype) in [(:AdaptedTriangulation,:AdaptedTriangulation),(:AdaptedTri
if (get_background_model(strian) === get_background_model(ttrian))
return best_target($sstrian,$tttrian)
end

ttrian_is_cell_wise = (num_cell_dims(ttrian) == num_point_dims(ttrian))
strian_is_cell_wise = (num_cell_dims(strian) == num_point_dims(strian))

if isa($sstrian,BodyFittedTriangulation) && isa($tttrian,BodyFittedTriangulation)
if strian_is_cell_wise && ttrian_is_cell_wise
# Choose the child mesh, both ways are possible
is_child(ttrian,strian) ? (return ttrian) : (return strian)
elseif strian_is_cell_wise
return strian
end

# Support for Boundary, Skeletton, ... triangulations is not yet implemented
# unless they are based on the same background model.

@notimplemented
return nothing
end
end
end

function CellData.change_domain(a::CellField,strian::Triangulation,::ReferenceDomain,ttrian::AdaptedTriangulation,::ReferenceDomain)
if strian === ttrian
return a
end
@check is_change_possible(strian,ttrian)

if (get_background_model(strian) === get_background_model(ttrian))
Expand All @@ -159,9 +155,6 @@ function CellData.change_domain(a::CellField,strian::Triangulation,::ReferenceDo
end

function CellData.change_domain(a::CellField,strian::AdaptedTriangulation,::ReferenceDomain,ttrian::Triangulation,::ReferenceDomain)
if strian === ttrian
return a
end
@check is_change_possible(strian,ttrian)

if (get_background_model(strian) === get_background_model(ttrian))
Expand All @@ -172,6 +165,10 @@ function CellData.change_domain(a::CellField,strian::AdaptedTriangulation,::Refe
end

function CellData.change_domain(a::CellField,strian::AdaptedTriangulation,::ReferenceDomain,ttrian::AdaptedTriangulation,::ReferenceDomain)
if strian === ttrian
return a
end

if is_child(strian,ttrian) # fine to coarse
b = change_domain(a,strian,ReferenceDomain(),ttrian.trian,ReferenceDomain())
return CellData.similar_cell_field(b,get_data(b),ttrian,ReferenceDomain())
Expand Down Expand Up @@ -228,6 +225,7 @@ function change_domain_o2n(f_old,old_trian::Triangulation,new_trian::AdaptedTria
end

function change_domain_o2n(f_coarse,ctrian::Triangulation{Dc},ftrian::AdaptedTriangulation,glue::AdaptivityGlue{<:RefinementGlue}) where Dc
@notimplementedif num_point_dims(ctrian) != Dc
cglue = get_glue(ctrian,Val(Dc))
fglue = get_glue(ftrian,Val(Dc))

Expand Down Expand Up @@ -267,6 +265,7 @@ function change_domain_n2o(f_new,new_trian::AdaptedTriangulation,old_trian::Tria
end

function change_domain_n2o(f_fine,ftrian::AdaptedTriangulation{Dc},ctrian::Triangulation,glue::AdaptivityGlue{<:RefinementGlue}) where Dc
@notimplementedif num_point_dims(ftrian) != Dc
cglue = get_glue(ctrian,Val(Dc))
fglue = get_glue(ftrian,Val(Dc))

Expand Down

0 comments on commit 8c64ca1

Please sign in to comment.