Skip to content

Commit d125d51

Browse files
committed
fixed and added more details in comments
1 parent 553fcc0 commit d125d51

File tree

1 file changed

+31
-19
lines changed

1 file changed

+31
-19
lines changed

src/CellData/SkeletonCellFieldPair.jl

+31-19
Original file line numberDiff line numberDiff line change
@@ -68,16 +68,16 @@ function get_triangulation(a::SkeletonCellFieldPair)
6868
end
6969

7070
#=
71-
We arbitrarily choose plus side of SkeletonCellFieldPair for evaluations, as
72-
we don't use the DomainContributions associated with Ω and Γ while performing
73-
the sensitivities for SkeletonTriangulation (Λ) DomainContribution. This
74-
fix is for error free evaluation of the functional when a SkeletonCellFieldPair
75-
is passed into it. Ideally, if we could parse and extract only the Skeleton
76-
integration terms from the functional's julia function form, this fix is not
77-
required, but this is not trivial to do. On the positive side, since the
78-
evaluations are all lazy and not used, this doesn't put any noticable memory
79-
or computational overhead. Ofcourse, it is made sure that the such plus side
80-
pick doesn't happen when the integration over the SkeletonTriangulation
71+
We arbitrarily choose plus side of SkeletonCellFieldPair for evaluations, as we
72+
don't use the DomainContributions associated with Ω and Γ while performing the
73+
sensitivities for SkeletonTriangulation (Λ) DomainContribution. This fix is for
74+
error free evaluation of the functional when a SkeletonCellFieldPair is passed
75+
into it. Ideally, if we could parse and extract only the Skeleton integration
76+
terms from the functional's julia function form, this fix is not required, but
77+
this is not trivial to do. On the positive side, since the evaluations are all
78+
lazy and not used, this doesn't put any noticable memory or computational
79+
overhead. Ofcourse, it is made sure that the such plus side pick doesn't happen
80+
when the integration over the SkeletonTriangulation
8181
=#
8282
# If SkeletonCellFieldPair is evaluated we just pick the plus side parent
8383
function evaluate!(cache,f::SkeletonCellFieldPair,x::CellPoint)
@@ -88,22 +88,34 @@ function evaluate!(cache,f::SkeletonCellFieldPair,x::CellPoint)
8888
end
8989

9090
#=
91-
Fix for CellFieldAt{T}(parent::OperationCellField) for OperationCellField involving args which are not FEFunctions. It creates a problem with SkeletonCellFieldPair giving the wrong output or errors as it chooses the SkeletonCellFieldPair directly as the parent rather the parent CellField of the side of choice. In code terms it is the following:
91+
Fix for CellFieldAt{T}(parent::OperationCellField) for OperationCellField
92+
involving args which are not FEFunctions. It creates a problem with
93+
SkeletonCellFieldPair giving the wrong output or errors as it chooses the
94+
SkeletonCellFieldPair directly as the parent rather the parent CellField of the
95+
side of choice. In code terms it is the following:
9296
9397
CellFieldAt{T}(OperationCellField) results in calling CellFieldAt{T}(operands).
94-
Without this override, CellFieldAt{T}(a::SkeletonCellField) results in the CellFieldAt structure with parent as SkeletonCellField and not a.T side CellField, which is not correct! This resulting in errors and is not the intended behaviour to have the parent as SkeletonCellFieldPair and is not consistent with our getproperty rules.
98+
Without this override, CellFieldAt{T}(a::SkeletonCellField) results in the
99+
CellFieldAt structure with parent as SkeletonCellField and not a.T side
100+
CellField, which is not correct! This resulting in errors and is not the
101+
intended behaviour to have the parent as SkeletonCellFieldPair and is not
102+
consistent with our getproperty rules.
95103
=#
96104
function CellFieldAt{T}(parent::SkeletonCellFieldPair) where T
97105
getproperty(parent,T)
98106
end
99107

100-
# to handle the evaluation of SkeletonCellFieldPair at BoundaryTriangulation
101-
# making it consistent with plus side choice of direct evaluation of SCFP
102-
# in general this is the case when trian of CellField is not the same as
103-
# that of the quadrature
104-
# But we are protected from inconsistent behaviour at SkeletonTriangulation
105-
# as it fails due to the ambiguity as the CellField at the SkeletonTrian
106-
# for direct evaluations
108+
#=
109+
To handle the evaluation of SkeletonCellFieldPair at BoundaryTriangulation
110+
making it consistent with plus side choice of direct evaluation of SCFP in
111+
general this is the case when trian of CellField is not the same as that of the
112+
quadrature.
113+
But we are protected from inconsistent behaviour at SkeletonTriangulation as it
114+
fails due to similar ambiguity as the CellField at the SkeletonTrian for direct
115+
evaluations, so get_data doesn't create any side effects.
116+
In case of BodyFittedTriangulation there is no hit to get_data directly and
117+
evaluate! handles it as intended
118+
=#
107119
get_data(a::SkeletonCellFieldPair) = get_data(a.plus)
108120

109121
function Base.propertynames(a::SkeletonCellFieldPair, private::Bool=false)

0 commit comments

Comments
 (0)