Commit 80fbad5b authored by Tilman Aleman's avatar Tilman Aleman
Browse files

julia

parent b72cfbf8
......@@ -2,25 +2,28 @@
using Gridap
using GridapEmbedded
using LinearAlgebra
using GridapDistributed
using GridapGmsh: gmsh
using GridapGmsh
# Define geometry
gmsh.initialize()
gmsh.clear()
box = gmsh.model.occ.addBox(
-2.,-2.,-2.,2.,2.,2.)
gmsh.model.occ.synchronize()
gmsh.model.mesh.setSize(gmsh.model.getEntities(0),0.1)
gmsh.model.mesh.generate(3)
gmsh.write("model.msh")
gmsh.finalize()
n = 10
# Background model
partition = (n,n,n)
pmin = 2*Point(-1,-1,-1)
pmax = 2*Point(1,1,1)
# bgmodel = simplexify(CartesianDiscreteModel(pmin,pmax,partition))
bgmodel = GmshDiscreteModel("model.msh")
function main()
gmsh.initialize()
gmsh.clear()
box = gmsh.model.occ.addBox(
-2.,-2.,-2.,2.,2.,2.)
gmsh.model.occ.synchronize()
gmsh.model.mesh.setSize(gmsh.model.getEntities(0),0.1)
gmsh.model.mesh.generate(3)
gmsh.write("model.msh")
gmsh.finalize()
n = 10
# Background model
partition = (n,n,n)
pmin = 2*Point(-1,-1,-1)
pmax = 2*Point(1,1,1)
# bgmodel = simplexify(CartesianDiscreteModel(pmin,pmax,partition))
bgmodel =GmshDiscreteModel("model.msh")
# Select geometry
R = 0.5
ϕ(x) = norm(x)-1
......@@ -45,7 +48,7 @@ lscutter = GridapEmbedded.LevelSetCutters.sphere(1)
#writevtk(Triangulation(bgmodel),"bgtrian")
# Setup Lebesgue measures
order = 2
order = 1
degree = 2*order
= Measure(Ω,degree)
dΓd = Measure(Γd,degree)
......@@ -76,7 +79,7 @@ lscutter = GridapEmbedded.LevelSetCutters.sphere(1)
a2(u,v) = ( ϵ*((Pmat(u))(Pmat(v))))*dΓd
a3(u,v) = (η*((u n_Γd)(v⋅n_Γd)))*dΓd
# a4(u,v) = ∫(ρu*((∇(u)⋅n_Γd)⋅(∇(v)⋅n_Γd)))*dΩ
a4(u,v) = (ρu*(((u)⋅nex)((v)⋅nex)))*
a4(u,v) = (ρu*(((u))((v))))*
a(u,v) =(a1(u,v)+a2(u,v)+a3(u,v)+a4(u,v))
......@@ -97,5 +100,6 @@ println("setup lf")
# Postprocess
# if outputfile !== nothing
writevtk(Ω,"vectorlaplace_julia",cellfields=["uh"=>uh])
# end
end
mesh_partition=(4,4)
main()
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment