Skip to content

Commit

Permalink
Revert "add vortex sheets"
Browse files Browse the repository at this point in the history
This reverts commit 667d087.
  • Loading branch information
rymanderson committed Jun 17, 2024
1 parent 667d087 commit 6f4b190
Show file tree
Hide file tree
Showing 8 changed files with 251 additions and 272 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,3 @@ Manifest.toml
*.vts
*.vtk
*.vtu

# vim
*.swp
2 changes: 1 addition & 1 deletion src/FastMultipole.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const MIN_NPT_L2L = 100
const MIN_NPT_L2B = 100
const MIN_NPT_NF = 100

for file in ["containers", "complex", "derivatives", "tree", "direct", "spherical", "fmm", "sortwrapper", "compatibility", "b2m", "probe", "visualize"]#, "estimate_cost"]
for file in ["containers", "complex", "derivatives", "element", "tree", "direct", "spherical", "fmm", "sortwrapper", "compatibility", "b2m", "probe", "visualize"]#, "estimate_cost"]
include(file*".jl")
end

Expand Down
327 changes: 124 additions & 203 deletions src/b2m.jl

Large diffs are not rendered by default.

44 changes: 23 additions & 21 deletions src/containers.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#------- dispatch for common interface for external packages -------#

#####
##### dispatch for common interface for external packages
#####
abstract type Indexable end

struct Body <: Indexable end
Expand Down Expand Up @@ -35,28 +36,29 @@ const SCALAR_STRENGTH = ScalarStrength()
struct VectorStrength <: Indexable end
const VECTOR_STRENGTH = VectorStrength()

#------- dispatch convenience functions for multipole creation definition -------#

#####
##### dispatch convenience functions for multipole creation definition
#####
abstract type AbstractKernel{sign} end

abstract type Vortex{sign} <: AbstractKernel{sign} end

abstract type ConstantSource{sign} <: AbstractKernel{sign} end

abstract type ConstantNormalDipole{sign} <: AbstractKernel{sign} end

abstract type ConstantSourceNormalDipole{sign} <: AbstractKernel{sign} end

abstract type AbstractElement{TK<:AbstractKernel} end

abstract type Point{TK} <: AbstractElement{TK} end

abstract type Filament{TK} <: AbstractElement{TK} end

abstract type Panel{NS,TK} <: AbstractElement{TK} end

#------- dispatch convenience functions to determine which derivatives are desired -------#
struct VortexPoint{sign} <: AbstractKernel{sign} end
VortexPoint(sign=1) = VortexPoint{sign}()
struct VortexLine{sign} <: AbstractKernel{sign} end # not yet derived
VortexLine(sign=1) = VortexLine{sign}()
struct VortexPanel{sign} <: AbstractKernel{sign} end # not yet derived
VortexPanel(sign=1) = VortexPanel{sign}()
struct SourcePoint{sign} <: AbstractKernel{sign} end
SourcePoint(sign=1) = SourcePoint{sign}()
struct UniformSourcePanel{sign} <: AbstractKernel{sign} end
UniformSourcePanel(sign=1) = UniformSourcePanel{sign}()
struct UniformNormalDipolePanel{sign} <: AbstractKernel{sign} end
UniformNormalDipolePanel(sign=1) = UniformNormalDipolePanel{sign}()
struct UniformSourceNormalDipolePanel{sign} <: AbstractKernel{sign} end
UniformSourceNormalDipolePanel(sign=1) = UniformSourceNormalDipolePanel{sign}()

#####
##### dispatch convenience functions to determine which derivatives are desired
#####
"""
DerivativesSwitch
Expand Down
64 changes: 64 additions & 0 deletions src/element.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
abstract type Element end

struct Source <: Element end

struct Dipole <: Element end

abstract type Dimension end

struct Point <: Dimension end

struct Line <: Dimension end

struct Panel <: Dimension end

struct QuadPanel <: Dimension end

struct Volume <: Dimension end

abstract type Distribution end

struct Uniform <: Distribution end

struct Linear <: Distribution end



#####
##### code architecture
#####
# FMM

# * inputs:

# - provide a tuple of vectors of elements (bodies)

# - position (3-tuple for point, 5 3-tuples for quad panels, etc.)
# - strength (scalar for <:Uniform, vector for <:Linear )

# - element dimension
# - element type
# - function for computing multipole coefficients? (at least make it optional)

# function fmm!(bodies::Vector, potential, options::Options, targets, sources; reset_tree, local_P2P)

# end

# * outputs:

# - potential, gradient, and gradient derivatives
# - sorts elements into octree (make copies?)
# - allow AD derivatives
# - calculates potential, gradient, and gradient derivatives

# FLOWSolve

# * user:

# - provide a tuple of vectors of boundary elements
# - provide a tuple of vectors of wake elements
# - somehow describe boundary conditions

# * code:

# - solve for the strengths of each boundary element
6 changes: 3 additions & 3 deletions test/gravitational.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import FastMultipole
import FastMultipole
using FastMultipole
using WriteVTK
import Base: getindex, setindex!
Expand Down Expand Up @@ -62,7 +62,7 @@ Base.eltype(::Gravitational{TF}) where TF = TF

FastMultipole.buffer_element(g::Gravitational) = (deepcopy(g.bodies[1]),zeros(eltype(g),52))

@inline FastMultipole.B2M!(system::Gravitational, args...) = FastMultipole.B2M!(FastMultipole.Point{FastMultipole.ConstantSource{1/4/pi}}, system, args...)
FastMultipole.B2M!(system::Gravitational, args...) = FastMultipole.B2M!_sourcepoint(system, args...)

function FastMultipole.direct!(target_system, target_index, derivatives_switch, source_system::Gravitational, source_index)
# nbad = 0
Expand All @@ -78,7 +78,7 @@ function FastMultipole.direct!(target_system, target_index, derivatives_switch,
# te = @elapsed begin
if r > 0
dV = source_strength / r
target_system[j_target,FastMultipole.SCALAR_POTENTIAL] += dV / 4 / pi
target_system[j_target,FastMultipole.SCALAR_POTENTIAL] += dV
end
# end
# if te > 0.00001; nbad += 1; end
Expand Down
Loading

0 comments on commit 6f4b190

Please sign in to comment.