Skip to content

Commit

Permalink
update 25
Browse files Browse the repository at this point in the history
  • Loading branch information
ga96tik committed Dec 6, 2017
1 parent 4172e07 commit 9820706
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 21 deletions.
31 changes: 24 additions & 7 deletions docs/src/Non-Parameterized.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

The called function in this implementation looks like:

`sauterschwabintegral(sourcechart, testchart, integrand, accuracy)`.
`sauterschwabintegral(sourcechart, testchart, integrand, accuracy, accuracy_pd)`.

`sourcechart` and `testchart` can be created by

Expand All @@ -19,7 +19,7 @@ The order of the input arguments within the `simplex()` function does not matter

The `integrand` must be defined as a function with two input arguments; the input arguments must be 3D vectors. The function name is the input argument.

The two area-integrals are transformed to four 1D integrals from zero to one; `accuracy` gives the number of quadrature points on that integration path, therefore `accuracy` is of type unsigned Int64.
Later the last argument `accuracy` will be discussed.

Since `simplex()` and `point()` are functions of CompScienceMeshes, CompScienceMeshes does not just have to be installed on the user's machine, but also be available in the current workspace, the same applies for this package as well. The two packages can be made available by

Expand All @@ -29,7 +29,7 @@ Those two commands must always be run at the beginning if using this type of imp

`sauterschwabintegral()` first modifies `testchart` and `sourcechart` with respect to the order of the arguments within their `simplex()` functions; and secondly -- depending on how many vertices both charts have in common -- it generates an object of some type, which contains the information of the accuracy, and the integration strategy. After all of that have been done, this function will call another function with input arguments of the two modified charts, the original integrand, and that new object.

To understand the examples stored in the example folder, the 'another called function' will be presented next:
To understand the arguments `accuracy` and `accuracy_pd` and the examples stored in the example folder, the 'another called function' will be presented next:



Expand All @@ -47,6 +47,23 @@ According to item 1 on the homepage, four different constellations of the two tr

As each of those four constellations has its own integration method (because of a possible singularity in the kernel), the function `sauterschwabintegral()` has to call another function, which handles the situation suitably; hence it has four methods.

In the case `sauterschwabintegral()` has to deal with a situation mentioned in the first three cases, the two area-integrals will be transformed to four 1D integrals from zero to one; `accuracy` gives the number of quadrature points on that integration path, therefore `accuracy` is of type unsigned Int64. In the case `sauterschwabintegral()` has to deal with a situation of the last case, `accuracy_pd` -- which is again a type of unsigned Int64 -- will be considered. It is a rule of how many quadrature points are created on both triangles. `accuracy_pd` =
* 1 ``\to`` 1
* 2 ``\to`` 3
* 3 ``\to`` 4
* 4 ``\to`` 6
* 5 ``\to`` 7
* 6 ``\to`` 12
* 7 ``\to`` 13
* 8 ``\to`` 36
* 9 ``\to`` 79
* 10 ``\to`` 105
* 11 ``\to`` 120
* 12 ``\to`` 400
* 13 ``\to`` 900
quadrature point(s) is(are) created on both triangles.


The user is now able to understand the examples in the '...non_parameterized.jl' files, rather their titles. The order of the points within the two `simplex()` functions of `Sourcechart` and `Testchart` can be changed arbitrarily, the result will always remain the same. For those who are interested in the 'called function' or want to skip `sauterschwabintegral()` and call the integration directly -- which is actually only a sorting process -- may read on now.

The called function by `sauterschwabintegral()` is:
Expand All @@ -68,7 +85,7 @@ The called function by `sauterschwabintegral()` is:

`cf = CommonFace(x)`.

`cf` is an object of type `CommonFace()`, x is the `accuracy`.
`cf` is an object of type `CommonFace()`, x is the number of quadrature points on the integration path ``[0,1]``.

An example of this case can be found at the end of the common_face_non_parameterized.jl file in the example folder.

Expand All @@ -89,7 +106,7 @@ The last argument can be created by

`ce = CommonEdge(x)`.

`ce` is an object of type `CommonEdge()`, x is the `accuracy`.
`ce` is an object of type `CommonEdge()`, x is the number of quadrature points on the integration path ``[0,1]``.

An example of this case can be found at the end of the common_edge_non_parameterized.jl file in the example folder.

Expand All @@ -110,7 +127,7 @@ The last argument is created by

`cv = CommonVertex(x)`.

`cv` is an object of type `CommonVertex()`, x is the `accuracy`.
`cv` is an object of type `CommonVertex()`, x is the number of quadrature points on the integration path ``[0,1]``.

An example of this case can be found at the end of the common_vertex_non_parameterized.jl file in the example folder.

Expand All @@ -127,6 +144,6 @@ The last argument can be created by

`pd = PositiveDistance(x)`.

`pd` is an object of type `PositiveDistance()`, x is the `accuracy`.
`pd` is an object of type `PositiveDistance()`, x is the rule of how many quadrature points are created on both triangles.

An example of this case can be found at the end of the positive_distance_non_parameterized.jl file in the example folder.
10 changes: 5 additions & 5 deletions docs/src/Parameterized.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ The original integrand, which is a function of ``\textbf{x}`` and ``\textbf{y}``
f(\chi_\tau(u,v),\chi_t(u',v')) \cdot \|\frac{\partial \chi_\tau}{\partial u}\times\frac{\partial \chi_\tau}{\partial v}\| \cdot\|\frac{\partial \chi_t}{\partial u'}\times\frac{\partial \chi_t}{\partial v'}\|
```

The last argument can be created by
This function method as well as the following methods, transform the two area-integrals in parameters domain into four 1D integrals from zero to one, therefore the last argument can be created by

`cf = CommonFace(x)`.

`cf` is an object of type `CommonFace()`, x is the `accuracy`.
`cf` is an object of type `CommonFace()`, x is the number of quadrature points on the integration path ``[0,1]``.

An example of this case can be found in the common_face_parameterized.jl file in the example folder.

Expand All @@ -53,7 +53,7 @@ The last argument can be created by

`ce = CommonEdge(x)`.

`ce` is an object of type `CommonEdge()`, x is the `accuracy`.
`ce` is an object of type `CommonEdge()`, x is the number of quadrature points on the integration path ``[0,1]``.

An example of this case can be found in the common_edge_parameterized.jl file in the example folder.

Expand All @@ -73,7 +73,7 @@ The last argument can be created by

`cv = CommonVertex(x)`.

`cv` is an object of type `CommonVertex()`, x is the `accuracy`.
`cv` is an object of type `CommonVertex()`, x is the number of quadrature points on the integration path ``[0,1]``.

An example of this case can be found in the common_vertex_parameterized.jl file in the example folder.

Expand All @@ -93,6 +93,6 @@ The last argument can be created by

`pd = PositiveDistance(x)`.

`pd` is an object of type `PositiveDistance()`, x is the `accuracy`.
`pd` is an object of type `PositiveDistance()`, x is the number of quadrature points on the integration path ``[0,1]``.

An example of this case can be found in the positive_distance_parameterized.jl file in the example folder.
4 changes: 2 additions & 2 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This package can be used to solve problems of following type:

The above expression is a double area-integral over two triangles (curved or flat) ``\Gamma`` and ``\Gamma'`` in 3D Space. The integrand consists of two basisfunctions ``b_i(\textbf{x})`` and ``b_i(\textbf{y})`` and the kernel ``k(\textbf{x},\textbf{y})``.

This kind of integral appears in the area of Boundary Element Methods for solving elliptic partial differential equations, and can be interpretated as the interaction of the two basisfunctions with respect to their triangles. For this reason in this package ``\Gamma`` is called the testtriangle and ``\Gamma'`` the sourcetriangle, and the same goes for the two basisfunctions; they are called test- and sourcefunction. The triangles correspond to the cells of a meshed surface.
This kind of integral appears in the area of Boundary Element Methods for solving elliptic partial differential equations, and can be interpreted as the interaction of the two basisfunctions with respect to their triangles. For this reason in this package ``\Gamma`` is called the testtriangle and ``\Gamma'`` the sourcetriangle, and the same goes for the two basisfunctions; they are called test- and sourcefunction. The triangles correspond to the cells of a meshed surface.

As the solving algorithm works for a wide range of basisfunctions and kernels, all the requirements for the kernel, basisfunctions and the integration areas will be given:

Expand All @@ -23,7 +23,7 @@ As the solving algorithm works for a wide range of basisfunctions and kernels, a

3.The kernel must be Cauchy-Singular

Depending on the input data, two different implementations of the integral are contained in this package. The first one is very convenient to handle, and does not need a parameterization; but it works only for flat triangles, and the user has to be familiar with the functions `simplex()` and `point()` of the package CompScienceMeshes. The second implementation contains only the integration rules; so the user has to build the parameterization himself, but therefore it also works for curved triangles.
Depending on the input data, two different implementations of the integral are contained in this package. The first one is very convenient to handle, and does not need a parameterization; but it works only for flat triangles, and the user has to be familiar with the functions `simplex()` and `point()` of the package CompScienceMeshes. The second implementation contains only the integration rules; so the user has to build the parameterization by himself, but therefore it also works for curved triangles.

Both implementations are called by a function, which looks like:

Expand Down
2 changes: 1 addition & 1 deletion examples/common_edge_non_parameterized.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ end



result = sauterschwabintegral(Sourcechart, Testchart, integrand, Accuracy)
result = sauterschwabintegral(Sourcechart, Testchart, integrand, Accuracy, Accuracy)
println(result)

#=For those who want to test the sauterschwab_nonparameterized() function,
Expand Down
2 changes: 1 addition & 1 deletion examples/common_face_non_parameterized.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ end



result = sauterschwabintegral(Sourcechart, Testchart, integrand, Accuracy)
result = sauterschwabintegral(Sourcechart, Testchart, integrand, Accuracy, Accuracy)
println(result)

#=For those who want to test the sauterschwab_nonparameterized() function,
Expand Down
6 changes: 5 additions & 1 deletion examples/common_face_parameterized.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ using CompScienceMeshes
using SauterSchwabQuadrature


Accuracy = 12
Accuracy = 20
cf = CommonFace(Accuracy)
pI = point(0,0,1)


function integrand(x,y)
return(((x-pI)'*(y-pI))*exp(-im*1*norm(x-y))/(4pi*norm(x-y)))
#1
end


Expand Down Expand Up @@ -47,3 +48,6 @@ result = sauterschwab_parameterized(Sc, Tc, INTEGRAND, cf)


println(result)

#proof of correctness: let integrand be 1, then the integration becomes a simple
#area integral which is equal to (-cos(1)+cos(0))^2
2 changes: 1 addition & 1 deletion examples/common_vertex_non_parameterized.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function integrand(x,y)



result = sauterschwabintegral(Sourcechart, Testchart, integrand, Accuracy)
result = sauterschwabintegral(Sourcechart, Testchart, integrand, Accuracy, Accuracy)
println(result)

#=For those who want to test the sauterschwab_nonparameterized() function,
Expand Down
2 changes: 1 addition & 1 deletion examples/positive_distance_non_parameterized.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ end



result = sauterschwabintegral(Sourcechart, Testchart, integrand, Accuracy)
result = sauterschwabintegral(Sourcechart, Testchart, integrand, Accuracy, Accuracy)
println(result)

#=For those who want to test the sauterschwab_nonparameterized() function,
Expand Down
4 changes: 2 additions & 2 deletions src/sauterschwabintegral.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ struct PositiveDistance <:Any acc::Int64 end

function sauterschwabintegral(sourcechart::CompScienceMeshes.Simplex{3,2,1,3,Float64},
testchart::CompScienceMeshes.Simplex{3,2,1,3,Float64},
integrand, accuracy::Int64)
integrand, accuracy::Int64, accuracy_pd::Int64)

index_equal_src = findin(sourcechart.vertices, testchart.vertices)
index_equal_tst = findin(testchart.vertices, sourcechart.vertices)
Expand All @@ -26,7 +26,7 @@ function sauterschwabintegral(sourcechart::CompScienceMeshes.Simplex{3,2,1,3,Flo
if m == 0
Sourcechart = sourcechart
Testchart = testchart
method = PositiveDistance(accuracy)
method = PositiveDistance(accuracy_pd)

elseif m == 1
SOURCECHART = Array{Any}(3)
Expand Down

0 comments on commit 9820706

Please sign in to comment.