Code Monkey home page Code Monkey logo

implicitsurfacequadrature.jl's Introduction

ImplicitSurfaceQuadrature.jl

A Julia package implementing the high-order quadrature method for implicitly defined domains described in the article R. I. Saye, High-Order Quadrature Methods for Implicitly Defined Surfaces and Volumes in Hyperrectangles, SIAM Journal on Scientific Computing, 37(2), A993-A1019 (2015). A C++ implementation of the same method exists, see the Algoim GitHub page.

This Julia implementation only works for 2D domains.

Overview of the method

This Julia package can be used to produce a high-order quadrature scheme for a curved surface implicitly defined by a function ϕ: ℝᵈ → ℝ, and contained in a hyperrectangle U. The integration domain is U ∩ Γ where Γ = {x: ϕ(x) = 0}.

The produced quadrature scheme is based on multiples q points Gauss-Legendre quadrature schemes.

Example usage

Integration of f(x,y) = x² + y² on the circle of radius 0.5 centered at the origin :

f(x) = sum(x.^2)

ϕ(x) = sum(x.^2) - 0.5^2 # Defining the isosurface (see Restrictions on the isosurface below)

a, b = (-1., -1.), (1., 1.) # Defining the lower and upper corners of the
                            # hyperrectangle containing the integration domain

nodes, weights = generatequadrature(4, a, b, ϕ) # Compute the quadrature scheme, with 
                                                # 4 points Gauss-Legendre quadratures

int = dot( weights, f.(nodes) ) # Compute the integral

The generatequadrature function returns quadrature nodes as Array{SVector{N,T},1} and weights as Array{T,1}.

Restrictions on the isosurface

The isosurface function ϕ should support a method like ϕ(x::NTuple{N,T}) where {N,T<:Real}.

The quadrature method uses an automatic computation of first-order Taylor in order to compute estimations of bounds of functions. Thus, the isosurface function should only be defined with operations that are also defined for Linearization objects in src/linerization.jl, which are:

  • +, -, * between function arguments and reals (ex: ϕ(x) = x[1] + 3.)
  • +, -, * between multiples function arguments (ex: ϕ(x) = x[1] + x[2])
  • abs, ^n, /c on function arguments with isa(n,Integer) and isa(c,Real) (ex: ϕ(x) = abs(x[1]^2 + x[2]/2))

implicitsurfacequadrature.jl's People

Stargazers

 avatar  avatar  avatar

Forkers

maltezfaria

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.