-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ADD example for quadrature
- Loading branch information
Showing
22 changed files
with
1,091 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# gsAssembler | ||
|
||
The methods in `gsAssembler` contain methods used for assembly. | ||
|
||
## Function Documentation | ||
```@autodocs | ||
Modules = [Gismo] | ||
Pages = ["src/gsAssembler.jl"] | ||
Order = [:function, :type] | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,10 @@ | ||
# gsCore | ||
|
||
The methods in `gsCore` contain basis, geometry and function methods. | ||
|
||
## Function Documentation | ||
```@autodocs | ||
Modules = [Gismo] | ||
Pages = ["src/gsCore.jl"] | ||
Order = [:function, :type] | ||
``` | ||
|
||
```@contents | ||
Pages = Main.SUBSECTION_PAGES | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# gsIO | ||
|
||
The methods in `gsIO` contain G+Smo's methods for input and output. | ||
|
||
## Function Documentation | ||
```@autodocs | ||
Modules = [Gismo] | ||
Pages = ["src/gsIO.jl"] | ||
Order = [:function, :type] | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,10 @@ | ||
# gsMatrix | ||
|
||
The methods in `gsMatrix` are an interface to G+Smo's linear algebra, supported by `Eigen`. | ||
|
||
## Function Documentation | ||
```@autodocs | ||
Modules = [Gismo] | ||
Pages = ["src/gsMatrix.jl"] | ||
Order = [:function, :type] | ||
``` | ||
|
||
```@contents | ||
Pages = Main.SUBSECTION_PAGES | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# gsModeling | ||
|
||
The methods in `gsModeling` contain methods for geometric modelling, such as fitting. | ||
|
||
## Function Documentation | ||
```@autodocs | ||
Modules = [Gismo] | ||
Pages = ["src/gsModeling.jl"] | ||
Order = [:function, :type] | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,52 @@ | ||
Julia interface for the Geometry + Simulation modules (G+Smo) | ||
|
||
## Installation instructions | ||
# Gismo.jl: Geometry + Simulation Modules meet Julia | ||
The Gismo.jl package provides an interface to the [Geometry + Simulation Modules](https://github.com/gismo/gismo) inside Julia. | ||
|
||
## Getting started | ||
We provide a hand full of examples in the `examples` directory, which can be run after [installation](#installation) of the package. | ||
|
||
## Installation | ||
There are two ways to install Gismo.jl: via Julia's package manager, or by linking it to a local build of G+Smo. | ||
|
||
### Via `Pkg` | ||
The Gismo.jl package can be directly downloaded from Julia's package management system `Pkg` using | ||
``` | ||
] add Gismo | ||
``` | ||
This command fetches the dependency [`gismo_jll`](https://github.com/JuliaBinaryWrappers/gismo_jll.jl) contaning pre-compiled library files, and it fetches the current repository which calls `gismo_jll`. | ||
|
||
### Enabling Gismo.jl locally | ||
Alternatively, one can use a local build of G+Smo as a back-end for the Julia bindings. This requires the [`gsCInterface`](https://github.com/gismo/gsCInterface) module to be compiled, and the Gismo.jl package to be fetched as a submodule in G+Smo. | ||
|
||
#### a. Fetching and compiling the required G+Smo submodules | ||
Enable the `gsCInterface` and the `Gismo.jl` modules inside G+Smo | ||
``` | ||
cd path/to/gismo/build | ||
cmake . -DGISMO_OPTIONAL="<OTHER OPTIONAL MODULES>;gsCInterface;Gismo.jl" \ | ||
-DGISMO_JL_DEVELOP=ON | ||
``` | ||
And compile everything | ||
``` | ||
make gismo | ||
``` | ||
#### b. Link libgismo to Gismo.jl | ||
In the file `Gismo.jl/src/Gismo.jl`, the shared library should be included as follows: | ||
``` | ||
libgismo = "path/to/gismo/build/lib/libgismo" | ||
``` | ||
|
||
#### c. Install Gismo.jl in Julia | ||
Add the local package Gismo.jl to Julia's development packages | ||
``` | ||
cd path/to/gismo/ | ||
cd optional | ||
julia -e 'using Pkg; Pkg.develop(path="Gismo.jl")' | ||
``` | ||
|
||
## Structure of the package | ||
The package is structured according to the `src/` folder in `gismo`'s C++ library. That is, for every directory `dir` in `src/dir`, `Gismo.jl/src` contains a `jl` file. | ||
|
||
## Function Documentation | ||
```@docs | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using Gismo | ||
|
||
options = Dict([("a",1), ("b",1.1), ("c", true), ("d", "one")]) | ||
println(options) | ||
gsOptionList = OptionList(options) | ||
println(gsOptionList) | ||
|
||
Gismo.setInt(gsOptionList,"a",Int32(2)) | ||
Gismo.setReal(gsOptionList,"b",2.0) | ||
Gismo.setSwitch(gsOptionList,"c",false) | ||
Gismo.setString(gsOptionList,"d","two") | ||
println(gsOptionList) | ||
|
||
int::Int64 = Gismo.getInt(gsOptionList,"a") | ||
println("Integer read from option list: ",int) | ||
double::Float64 = Gismo.getReal(gsOptionList,"b") | ||
println("Double read from option list: ",double) | ||
bool::Bool = Gismo.getSwitch(gsOptionList,"c") | ||
println("Bool read from option list: ",bool) | ||
string::Cstring = Gismo.getString(gsOptionList,"d") | ||
println("String read from option list: ",string) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using Gismo | ||
|
||
# Gauss quadrature rule (1D) | ||
rule1D = GaussRule(Int32(2)) | ||
nodes,weights = mapTo(rule1D,0.0,1.0) | ||
println("Gauss nodes: ",asMatrix(nodes)) | ||
println("Gauss nodes: ",asVector(weights)) | ||
|
||
# Lobatto quadrature rule (2D) | ||
rule2D = LobattoRule(Int32(2),Array{Int32}([2,2])) | ||
low = Vector{Float64}([0.0,0.0]) | ||
upp = Vector{Float64}([1.0,1.0]) | ||
nodes,weights = mapTo(rule2D,low,upp) | ||
println("Lobatto nodes: ",asMatrix(nodes)) | ||
println("Lobatto weights: ",asVector(weights)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.