Skip to content

Commit

Permalink
Merge pull request #12 from konsim83/dev_NewRelease
Browse files Browse the repository at this point in the history
fixed bugs in documentation
  • Loading branch information
konsim83 authored Feb 27, 2019
2 parents 83173e1 + e77d38b commit caccfbf
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 23 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

### Installation

*TriangleMesh* is now officialy registered To install run
*TriangleMesh* is now officialy registered. To install run
```julia
] add TriangleMesh
```
Expand Down
28 changes: 12 additions & 16 deletions deps/build.log
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
Adding to LOAD_PATH: /home/ksimon/Code/BasisReconstruction-2D
Adding to LOAD_PATH: /home/ksimon/Code/BasisReconstruction-2D/src
Adding to LOAD_PATH: /home/ksimon/Code/BasisReconstruction-2D/src/FEM
Adding to LOAD_PATH: /home/ksimon/Code/BasisReconstruction-2D/src/FEM_1D
Adding to LOAD_PATH: /home/ksimon/Code/BasisReconstruction-2D/src/FiniteDiff
Adding to LOAD_PATH: /home/ksimon/Code/BasisReconstruction-2D/src/Geometry
Adding to LOAD_PATH: /home/ksimon/Code/BasisReconstruction-2D/src/Mesh
Adding to LOAD_PATH: /home/ksimon/Code/BasisReconstruction-2D/src/Miscellaneous
Adding to LOAD_PATH: /home/ksimon/Code/BasisReconstruction-2D/src/Parameter
Adding to LOAD_PATH: /home/ksimon/Code/BasisReconstruction-2D/src/PostProcess
Adding to LOAD_PATH: /home/ksimon/Code/BasisReconstruction-2D/src/Problem
Adding to LOAD_PATH: /home/ksimon/Code/BasisReconstruction-2D/src/Quad
Adding to LOAD_PATH: /home/ksimon/Code/BasisReconstruction-2D/src/Reconstruction
Adding to LOAD_PATH: /home/ksimon/Code/BasisReconstruction-2D/src/Solver
Adding to LOAD_PATH: /home/ksimon/Code/BasisReconstruction-2D/src/TimeIntegrator
Adding to LOAD_PATH: /home/ksimon/Code/BasisReconstruction-2D/src/Vis
Clearing obj and lib directory...
Building object file triangle.o
Building object file tesselate.o
Linking object files into libtesselate
Clearing obj and lib directory...
[ Info: Changing directory to /home/julia/.julia/environments/v1.1/dev/TriangleMesh/deps/src
[ Info: Changing directory to /home/julia/.julia/environments/v1.1/dev/TriangleMesh/deps/src
[ Info: Changing directory to /home/julia/.julia/environments/v1.1/dev/TriangleMesh/deps/src
[ Info: Changing directory to /home/julia/.julia/environments/v1.1/dev/TriangleMesh/deps/src
[ Info: Changing directory to /home/julia/.julia/environments/v1.1/dev/TriangleMesh/deps/src
[ Info: Changing directory to /home/julia/.julia/environments/v1.1/dev/TriangleMesh/deps/src
[ Info: Changing directory to /home/julia/.julia/environments/v1.1/dev/TriangleMesh/deps/src
10 changes: 5 additions & 5 deletions docs/src/man/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ We will create a polygon that describes a rhombus with a squared hole in the mid
```julia
# size is number_points x 2
node = [1.0 0.0 ; 0.0 1.0 ; -1.0 0.0 ; 0.0 -1.0 ;
0.25 0.25 ; -0.25 0.25 , -0.25 -0.25 ; 0.25 -0.25]
0.25 0.25 ; -0.25 0.25 ; -0.25 -0.25 ; 0.25 -0.25]
```
and the segments
```julia
# size is number_segments x 2
seg = [1 2 ; 2 3 ; 3 4 ; 4 1 ; 5 6 , 6 7 , 7 8 ; 8 5]
seg = [1 2 ; 2 3 ; 3 4 ; 4 1 ; 5 6 ; 6 7 ; 7 8 ; 8 5]
```
We now have two boundaries - an inner and an outer. We will also give each point and each segment a marker according to the boundary
```julia
# all points get marker 1
node_marker = [ones(Int,4) ; 2*ones(Int,4)]
node_marker = [ones(Int,4,1) ; 2*ones(Int,4,1)]
# last segment gets a different marker
seg_marker = [ones(Int,4) ; 2*ones(Int,4)]
```
Expand Down Expand Up @@ -141,7 +141,7 @@ Suppose an a-posteriori error estimator suggested to refine the triangles with t

We use the convenience method for doing this refinement:
```julia
mesh_refined = refine(mesh, ind_cell=[1;4;9], divide_into=10, keep_edges=true)
mesh_refined = refine(mesh, ind_cell=[1;4;9], divide_cell_into=10, keep_edges=true)
```

We could also pass Triangle's command line switches. Suppose we would like to refine the entire mesh and only keep segments (not edges). No triangle should have a larger area than 0.0001. This can be done, for example by:
Expand Down Expand Up @@ -179,7 +179,7 @@ function plot_TriMesh(m :: TriMesh;
ax[:set_aspect]("equal")

# Connectivity list -1 for Python
tri = ax[:triplot](m.point[1,:], m.point[2,:], m.cell'-1 )
tri = ax[:triplot](m.point[1,:], m.point[2,:], m.cell'.-1 )
setp(tri, linestyle = linestyle,
linewidth = linewidth,
marker = marker,
Expand Down
14 changes: 13 additions & 1 deletion example/TriangleMesh_plot.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#=
To run this script type 'include("path/to/this/file/TriangleMesh_plot.jl")'
=#
using TriangleMesh, PyPlot

# -----------------------------------------------------------
Expand Down Expand Up @@ -27,7 +30,7 @@ function plot_TriMesh(m :: TriMesh;
ax[:set_aspect]("equal")

# Connectivity list -1 for Python
tri = ax[:triplot](m.point[:,1], m.point[:,2], m.cell-1 )
tri = ax[:triplot](m.point[:,1], m.point[:,2], m.cell.-1 )
setp(tri, linestyle = linestyle,
linewidth = linewidth,
marker = marker,
Expand All @@ -40,3 +43,12 @@ function plot_TriMesh(m :: TriMesh;
end
# -----------------------------------------------------------
# -----------------------------------------------------------


# Create a mesh of an L-shaped polygon and refine some cells
poly = polygon_unitSquareWithHole()
mesh = create_mesh(poly, info_str="my mesh", voronoi=true, delaunay=true, set_area_max=true)
mesh_refined = refine(mesh, ind_cell=[1;4;9], divide_cell_into=10, keep_edges=true)

plot_TriMesh(mesh, linewidth=4, linestyle="--")
plot_TriMesh(mesh_refined, color="blue")

0 comments on commit caccfbf

Please sign in to comment.