fftw

package
v0.0.0-...-55d3409 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 17, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SolvePdeFft

func SolvePdeFft(F emath.FloatGrid, adjustBound bool) emath.FloatGrid

Solves Laplace U = F with Neumann boundary conditions if adjust_bound is true then boundary values in F are modified so that the equation has a solution, if adjust_bound is set to false then F is not modified and the equation might not have a solution but an approximate solution with a minimum error is then calculated. note, input data F might be modified

Types

type FftwPlan

type FftwPlan struct {
	// contains filtered or unexported fields
}

FftwPlan wraps the fftw3 library for use in Golang, specifically as needed to solve a particular PDE as per the fattal02 implementation in PFSTMO.

There are some golang bindings for FFTW3 around, but none that exposed the function fftw_plan_r2r_2d() that fattal02 was using. But cgo is awesome and easy so we just wrapped the FFTW3 lib directly.

In your OS, install a C buildchain and the FFTW3 dev library:

$ sudo apt-get install build-essential
$ sudo apt-get install libfftw3-dev

If you run into precision issues, because your underlying C platform doesn't think a C++ 'double' is the same as a Golang float64, read https://www.fftw.org/fftw3_doc/Precision.html and make changes to the library namein LDFLAGS, and all the `fftw_` prefixes to C types and functions in this file.

func NewFftwPlan

func NewFftwPlan(in, out emath.FloatGrid) *FftwPlan

func (*FftwPlan) Destroy

func (p *FftwPlan) Destroy()

func (*FftwPlan) Execute

func (p *FftwPlan) Execute() *FftwPlan

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL