Skip to content

Commit 1e5d18c

Browse files
committed
replaced implicit imports by explicit imports
1 parent b0baf9d commit 1e5d18c

File tree

7 files changed

+84
-46
lines changed

7 files changed

+84
-46
lines changed

src/ExtendableFEMBase.jl

Lines changed: 61 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,55 @@
11
module ExtendableFEMBase
22

3-
using ExtendableGrids # + some reexports from there
4-
export Edge1D, Triangle2D, Parallelogram2D, Tetrahedron3D, Parallelepiped3D
5-
export ON_CELLS, ON_FACES, ON_IFACES, ON_BFACES, ON_EDGES, ON_BEDGES
6-
using ExtendableSparse
7-
using SparseArrays
8-
using DiffResults
9-
using LinearAlgebra
10-
using ForwardDiff
11-
using DocStringExtensions
12-
using Printf
13-
using UnicodePlots
14-
using Term
15-
using SpecialPolynomials
16-
using Polynomials
17-
18-
19-
include("qpinfos.jl")
20-
export QPInfos
21-
22-
include("quadrature.jl")
23-
export QuadratureRule
24-
export VertexRule
25-
export integrate!, integrate, ref_integrate!
3+
using DocStringExtensions: DocStringExtensions, TYPEDEF, TYPEDSIGNATURES
4+
using ExtendableGrids: ExtendableGrids, AT_NODES, AbstractElementGeometry,
5+
AbstractElementGeometry0D, AbstractElementGeometry1D,
6+
AbstractElementGeometry2D, AbstractElementGeometry3D,
7+
AbstractGridAdjacency, AbstractGridComponent,
8+
AbstractGridFloatArray2D, AbstractGridIntegerArray2D,
9+
Adjacency, AssemblyType, BEdgeEdges, BEdgeGeometries,
10+
BEdgeRegions, BEdgeVolumes, BFaceEdges, BFaceFaces,
11+
BFaceGeometries, BFaceNodes, BFaceParents, BFaceRegions,
12+
BFaceVolumes, CellEdgeSigns, CellEdges,
13+
CellFaceOrientations, CellFaceSigns, CellFaces,
14+
CellFinder, CellGeometries, CellNodes, CellParents,
15+
CellRegions, CellVolumes, Coordinates, Edge1D,
16+
EdgeCells, EdgeGeometries, EdgeNodes, EdgeTangents,
17+
EdgeVolumes, ElementGeometries, ExtendableGrid,
18+
FaceCells, FaceEdgeSigns, FaceEdges, FaceGeometries,
19+
FaceNodes, FaceNormals, FaceParents, FaceRegions,
20+
FaceVolumes, GridComponentGeometries4AssemblyType,
21+
GridComponentNodes4AssemblyType,
22+
GridComponentRegions4AssemblyType,
23+
GridComponentUniqueGeometries4AssemblyType,
24+
GridComponentVolumes4AssemblyType, GridEGTypes,
25+
GridRegionTypes, Hexahedron3D, L2GTransformer,
26+
ON_BEDGES, ON_BFACES, ON_CELLS, ON_EDGES, ON_FACES,
27+
ON_IFACES, Parallelepiped3D, Parallelogram2D,
28+
ParentGrid, ParentGridRelation, Quadrilateral2D,
29+
SerialVariableTargetAdjacency, SubGrid, Tetrahedron3D,
30+
Triangle2D, UniqueBEdgeGeometries,
31+
UniqueBFaceGeometries, UniqueCellGeometries,
32+
UniqueEdgeGeometries, UniqueFaceGeometries,
33+
VariableTargetAdjacency, Vertex0D, append!, atranspose,
34+
dim_element, eval_trafo!, gFindLocal!, interpolate!,
35+
local_celledgenodes, local_cellfacenodes, mapderiv!,
36+
max_num_targets_per_source, num_cells, num_edges,
37+
num_faces, num_nodes, num_sources, num_targets,
38+
reference_domain, simplexgrid, subgrid, unique,
39+
update_trafo!
40+
using ExtendableSparse: ExtendableSparse, ExtendableSparseMatrix, flush!,
41+
rawupdateindex!
42+
using ForwardDiff: ForwardDiff, DiffResults
43+
using LinearAlgebra: LinearAlgebra, convert, det, diagm, dot, eigen, ldiv!, lu,
44+
mul!, norm, transpose
45+
using Polynomials: Polynomials, Polynomial, coeffs
46+
using Printf: Printf, @printf
47+
using SparseArrays: SparseArrays, AbstractSparseArray, AbstractSparseMatrix,
48+
SparseMatrixCSC, nzrange, rowvals, sparse
49+
using SpecialPolynomials: SpecialPolynomials, ShiftedLegendre, basis
50+
using Term: Term, grid
51+
using UnicodePlots: UnicodePlots, BrailleCanvas, Plot, heatmap, lineplot,
52+
lineplot!
2653

2754
include("functionoperators.jl")
2855
export AbstractFunctionOperator
@@ -38,6 +65,17 @@ export Trace, Deviator
3865
export NeededDerivative4Operator, Length4Operator, QuadratureOrderShift4Operator, DefaultName4Operator
3966
export OperatorPair, OperatorTriple
4067

68+
include("qpinfos.jl")
69+
#include("feview.jl")
70+
export FEView
71+
export QPInfos
72+
73+
include("quadrature.jl")
74+
export QuadratureRule
75+
export VertexRule
76+
export integrate!, integrate, ref_integrate!
77+
78+
4179

4280
include("finiteelements.jl") # also includes dofmaps.jl and feevaluator*.jl
4381
export DofMap

src/fedefs/hdiv_rtk_enrich.jl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,17 @@ abstract type HDIVRTkENRICH{edim, k, stack} <: AbstractHdivFiniteElement where {
1919

2020
const _num_RTk_enrich_bubbles = [[2, 3, 4], [3, 9]]
2121
const _num_RTk_enrich_bubbles_stacked = [[2, 5, 9], [3, 9]]
22-
ExtendableFEMBase.get_ncomponents(::Type{<:HDIVRTkENRICH{edim, order}}) where {order, edim} = edim
23-
ExtendableFEMBase.get_ndofs(::Type{ON_CELLS}, FEType::Type{<:HDIVRTkENRICH{edim, order, false}}, EG::Type{<:AbstractElementGeometry}) where {edim, order} = _num_RTk_enrich_bubbles[edim-1][order]
24-
ExtendableFEMBase.get_ndofs(::Type{ON_CELLS}, FEType::Type{<:HDIVRTkENRICH{edim, order, true}}, EG::Type{<:AbstractElementGeometry}) where {edim, order} = _num_RTk_enrich_bubbles_stacked[edim-1][order]
25-
ExtendableFEMBase.get_polynomialorder(::Type{<:HDIVRTkENRICH{edim, order}}, ::Type{<:AbstractElementGeometry}) where {edim, order} = order + 1
26-
ExtendableFEMBase.get_dofmap_pattern(FEType::Type{<:HDIVRTkENRICH}, ::Type{CellDofs}, EG::Type{<:AbstractElementGeometry}) = "i$(get_ndofs(ON_CELLS, FEType, EG))"
22+
get_ncomponents(::Type{<:HDIVRTkENRICH{edim, order}}) where {order, edim} = edim
23+
get_ndofs(::Type{ON_CELLS}, FEType::Type{<:HDIVRTkENRICH{edim, order, false}}, EG::Type{<:AbstractElementGeometry}) where {edim, order} = _num_RTk_enrich_bubbles[edim-1][order]
24+
get_ndofs(::Type{ON_CELLS}, FEType::Type{<:HDIVRTkENRICH{edim, order, true}}, EG::Type{<:AbstractElementGeometry}) where {edim, order} = _num_RTk_enrich_bubbles_stacked[edim-1][order]
25+
get_polynomialorder(::Type{<:HDIVRTkENRICH{edim, order}}, ::Type{<:AbstractElementGeometry}) where {edim, order} = order + 1
26+
get_dofmap_pattern(FEType::Type{<:HDIVRTkENRICH}, ::Type{CellDofs}, EG::Type{<:AbstractElementGeometry}) = "i$(get_ndofs(ON_CELLS, FEType, EG))"
2727

2828
isdefined(FEType::Type{<:HDIVRTkENRICH}, ::Type{<:Triangle2D}) = true
2929
isdefined(FEType::Type{<:HDIVRTkENRICH}, ::Type{<:Tetrahedron3D}) = true
3030

3131
## basis on reference triangle
32-
function ExtendableFEMBase.get_basis(::Type{ON_CELLS}, ::Type{HDIVRTkENRICH{2, order, false}}, EG::Type{<:Triangle2D}) where {order}
32+
function get_basis(::Type{ON_CELLS}, ::Type{HDIVRTkENRICH{2, order, false}}, EG::Type{<:Triangle2D}) where {order}
3333
@assert order in 1:3
3434
#@show chosen_bubbles
3535
function closure(refbasis, xref)
@@ -81,7 +81,7 @@ end
8181

8282

8383
## basis on reference tetrahedron
84-
function ExtendableFEMBase.get_basis(::Type{ON_CELLS}, ::Type{HDIVRTkENRICH{3, order, false}}, EG::Type{<:Tetrahedron3D}) where {order}
84+
function get_basis(::Type{ON_CELLS}, ::Type{HDIVRTkENRICH{3, order, false}}, EG::Type{<:Tetrahedron3D}) where {order}
8585
@assert order in 1:2
8686
#@show chosen_bubbles
8787
function closure(refbasis, xref)
@@ -111,7 +111,7 @@ function ExtendableFEMBase.get_basis(::Type{ON_CELLS}, ::Type{HDIVRTkENRICH{3, o
111111
end
112112
end
113113

114-
function ExtendableFEMBase.get_basis(::Type{ON_CELLS}, ::Type{HDIVRTkENRICH{2, order, true}}, EG::Type{<:Triangle2D}) where {order}
114+
function get_basis(::Type{ON_CELLS}, ::Type{HDIVRTkENRICH{2, order, true}}, EG::Type{<:Triangle2D}) where {order}
115115
@assert order in 1:3
116116
refbasisRT0 = zeros(Real, 3, 2)
117117
refbasisRT1 = zeros(Real, 2, 2) # only bubbles
@@ -159,7 +159,7 @@ function ExtendableFEMBase.get_basis(::Type{ON_CELLS}, ::Type{HDIVRTkENRICH{2, o
159159
end
160160
end
161161

162-
function ExtendableFEMBase.get_basis(::Type{ON_CELLS}, ::Type{HDIVRTkENRICH{3, order, true}}, EG::Type{<:Tetrahedron3D}) where {order}
162+
function get_basis(::Type{ON_CELLS}, ::Type{HDIVRTkENRICH{3, order, true}}, EG::Type{<:Tetrahedron3D}) where {order}
163163
@assert order in 1:3
164164
refbasisRT0 = zeros(Real, 4, 3)
165165
refbasisRT1 = zeros(Real, 3, 3) # only bubbles

src/feevaluator.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ function FEEvaluator(
5858

5959
# get effective assembly type for basis
6060
# depending on the AT and the AT of the FESpace
61-
FEAT = ExtendableFEMBase.EffAT4AssemblyType(FEAPT, AT)
61+
FEAT = EffAT4AssemblyType(FEAPT, AT)
6262

6363
@debug "Creating FEEvaluator for $FEType, EG = $EG, operator = $operator, FEAT = $FEAT, AT = $AT"
6464

@@ -294,7 +294,7 @@ end
294294
## general call to update subset
295295
function _update_subset!(FEBE::FEEvaluator)
296296
subset = FEBE.current_subset
297-
if FEBE.subset_handler != ExtendableFEMBase.NothingFunction
297+
if FEBE.subset_handler != NothingFunction
298298
FEBE.subset_handler(subset, FEBE.citem[])
299299
end
300300
return subset

src/plots.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
import UnicodePlots: lines!, points!, pixel!
2+
import UnicodePlots: lines!
33

44
"""
55
````

src/point_evaluator.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ function initialize!(O::PointEvaluator{T, UT}, sol; time = 0, kwargs...) where {
9393
Ti = eltype(xgrid[CellNodes])
9494
EGs = xgrid[UniqueCellGeometries]
9595
AT = ON_CELLS
96-
gridAT = ExtendableFEMBase.EffAT4AssemblyType(get_AT(FES_args[1]), AT)
96+
gridAT = EffAT4AssemblyType(get_AT(FES_args[1]), AT)
9797
xgrid = FES_args[1].xgrid
9898
itemregions = xgrid[CellRegions]
9999
itemgeometries = xgrid[CellGeometries]
@@ -120,7 +120,7 @@ function initialize!(O::PointEvaluator{T, UT}, sol; time = 0, kwargs...) where {
120120
append!(op_offsets_args, cumsum(op_lengths_args))
121121
input_args = zeros(T, op_offsets_args[end])
122122

123-
FEATs_args = [ExtendableFEMBase.EffAT4AssemblyType(get_AT(FES_args[j]), AT) for j 1:nargs]
123+
FEATs_args = [EffAT4AssemblyType(get_AT(FES_args[j]), AT) for j 1:nargs]
124124
itemdofs_args::Array{Union{Adjacency{Ti}, SerialVariableTargetAdjacency{Ti}}, 1} = [FES_args[j][Dofmap4AssemblyType(FEATs_args[j])] for j 1:nargs]
125125
kernel = O.kernel
126126

@@ -138,7 +138,7 @@ function initialize!(O::PointEvaluator{T, UT}, sol; time = 0, kwargs...) where {
138138

139139
for id 1:nargs
140140
# update basis evaluations at xref
141-
ExtendableFEMBase.relocate_xref!(BE_args[id], xref)
141+
relocate_xref!(BE_args[id], xref)
142142

143143
# update operator eveluation on item
144144
update_basis!(BE_args[id], item)

src/reconstructionoperators.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ abstract type Reconstruct{FETypeR, O} <: ReconstructionOperator where {FETypeR <
1616
StandardFunctionOperator(::Type{Reconstruct{FETypeR, O}}) where {FETypeR, O} = O
1717
ReconstructionSpace(::Type{Reconstruct{FETypeR, O}}) where {FETypeR, O} = FETypeR
1818

19-
ExtendableFEMBase.NeededDerivative4Operator(::Type{Reconstruct{FETypeR, O}}) where {FETypeR, O} = NeededDerivative4Operator(O)
20-
ExtendableFEMBase.Length4Operator(::Type{Reconstruct{FETypeR, O}}, xdim, nc) where {FETypeR, O} = Length4Operator(O, xdim, nc)
21-
ExtendableFEMBase.DefaultName4Operator(::Type{Reconstruct{FETypeR, O}}) where {FETypeR, O} = "R(" * DefaultName4Operator(O) * ")"
19+
NeededDerivative4Operator(::Type{Reconstruct{FETypeR, O}}) where {FETypeR, O} = NeededDerivative4Operator(O)
20+
Length4Operator(::Type{Reconstruct{FETypeR, O}}, xdim, nc) where {FETypeR, O} = Length4Operator(O, xdim, nc)
21+
DefaultName4Operator(::Type{Reconstruct{FETypeR, O}}) where {FETypeR, O} = "R(" * DefaultName4Operator(O) * ")"
2222

2323
struct FEReconstEvaluator{T, TvG, TiG, FEType, FEType2, stdop, O <: ReconstructionOperator} <: FEEvaluator{T, TvG, TiG}
2424
citem::Base.RefValue{Int} # current item

src/segment_integrator.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ function initialize!(O::SegmentIntegrator{T, UT}, sol; time = 0, kwargs...) wher
101101
FETypes_args = [eltype(F) for F in FES_args]
102102

103103
AT = ON_CELLS
104-
gridAT = ExtendableFEMBase.EffAT4AssemblyType(get_AT(FES_args[1]), AT)
104+
gridAT = EffAT4AssemblyType(get_AT(FES_args[1]), AT)
105105
xgrid = FES_args[1].xgrid
106106
itemregions = xgrid[CellRegions]
107107

@@ -113,7 +113,7 @@ function initialize!(O::SegmentIntegrator{T, UT}, sol; time = 0, kwargs...) wher
113113
bonus_quadorder = O.parameters[:bonus_quadorder]
114114
if O.parameters[:quadorder] == "auto"
115115
polyorder = maximum([get_polynomialorder(FE, EG) for FE in FETypes_args])
116-
minderiv = minimum([ExtendableFEMBase.NeededDerivative4Operator(op) for op in O.ops_args])
116+
minderiv = minimum([NeededDerivative4Operator(op) for op in O.ops_args])
117117
quadorder = polyorder - minderiv + bonus_quadorder
118118
else
119119
quadorder = O.parameters[:quadorder] + bonus_quadorder
@@ -142,7 +142,7 @@ function initialize!(O::SegmentIntegrator{T, UT}, sol; time = 0, kwargs...) wher
142142
## parameter structure
143143
QPinfo = QPInfos(xgrid; time = time, params = O.parameters[:params])
144144

145-
FEATs_args = [ExtendableFEMBase.EffAT4AssemblyType(get_AT(FES_args[j]), AT) for j 1:nargs]
145+
FEATs_args = [EffAT4AssemblyType(get_AT(FES_args[j]), AT) for j 1:nargs]
146146
itemdofs_args::Array{Union{Adjacency{Int32}, SerialVariableTargetAdjacency{Int32}}, 1} = [FES_args[j][Dofmap4AssemblyType(FEATs_args[j])] for j 1:nargs]
147147

148148
## prepare operator infos
@@ -193,7 +193,7 @@ function initialize!(O::SegmentIntegrator{T, UT}, sol; time = 0, kwargs...) wher
193193

194194
# update basis evaluations on new quadrature points
195195
for id 1:nargs
196-
ExtendableFEMBase.relocate_xref!(BE_args[id], xref)
196+
relocate_xref!(BE_args[id], xref)
197197
update_basis!(BE_args[id], item)
198198
end
199199

@@ -271,7 +271,7 @@ function initialize!(O::SegmentIntegrator{T, UT}, sol; time = 0, kwargs...) wher
271271

272272
# update basis evaluations on new quadrature points
273273
for id 1:nargs
274-
ExtendableFEMBase.relocate_xref!(BE_args[id], xref)
274+
relocate_xref!(BE_args[id], xref)
275275
update_basis!(BE_args[id], item)
276276
end
277277

0 commit comments

Comments
 (0)