This file contains hidden or 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
| module FEMMBaseModule | |
| typealias FInt Int | |
| typealias FFlt Float64 | |
| typealias FFltVec Vector{FFlt} | |
| typealias FIntVec Vector{FInt} | |
| typealias FFltMat Matrix{FFlt} | |
| typealias FIntMat Matrix{FInt} | |
| abstract FESet |
This file contains hidden or 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
| module Driver | |
| using FESetModule | |
| using FEMMBaseModule | |
| function run1() | |
| J = ones(2, 2) | |
| loc = zeros(1,3) | |
| conn = reshape([1,2,3], 1, 3) | |
| N = zeros(3,1) |
This file contains hidden or 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
| using FinEtools | |
| using FinEtools.MeshExportModule | |
| println("""Heat conduction example from JuAFEM.""") | |
| t0 = time() | |
| A = 2.0 | |
| thermal_conductivity = eye(2,2); # conductivity matrix | |
| function getsource!(forceout::FFltVec, XYZ::FFltMat, tangents::FFltMat, fe_label::FInt) | |
| forceout[1] = 1.0; #heat source |
This file contains hidden or 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
| using JuAFEM | |
| # using UnicodePlots | |
| t0 = time() | |
| grid = generate_grid(Quadrilateral, (1000,1000)) | |
| addnodeset!(grid, "boundary", x -> abs(x[1]) ≈ 1 || abs(x[2]) ≈ 1); | |
| dim = 2 | |
| ip = Lagrange{dim, RefCube, 1}() | |
| qr = QuadratureRule{dim, RefCube}(2) |
This file contains hidden or 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
| Variables: | |
| fens1::FinEtools.FENodeSetModule.FENodeSet | |
| fens2::FinEtools.FENodeSetModule.FENodeSet | |
| tolerance::Float64 | |
| dim::Int64 | |
| nn1<optimized out> | |
| nn2<optimized out> | |
| xyz1<optimized out> | |
| id1<optimized out> | |
| xyz2<optimized out> |
This file contains hidden or 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
| module moinbounds13 | |
| using FinEtools | |
| using FinEtools.MatrixUtilityModule: add_mggt_ut_only!, complete_lt! | |
| using LinearAlgebra: Transpose, mul! | |
| using BenchmarkTools | |
| function add_mggt_ut_only_wo!(Ke::FFltMat, gradN::FFltMat, mult::FFlt) | |
| @assert size(Ke, 1) == size(Ke, 2) | |
| Kedim = size(Ke, 1) | |
| nne, mdim = size(gradN) | |
| mx::FInt = 0 |
This file contains hidden or 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
| module naivelu | |
| using BenchmarkTools | |
| using LinearAlgebra | |
| """ | |
| naivelu!(a) | |
| Naive LU decomposition implementation. |
This file contains hidden or 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
| module testinglu | |
| using LinearAlgebra | |
| import LinearAlgebra: lu!, generic_lufact!, BlasInt, checknonsingular | |
| function better_generic_lufact!(A::StridedMatrix{T}, ::Val{Pivot} = Val(true); | |
| check::Bool = true) where {T,Pivot} | |
| m, n = size(A) | |
| minmn = min(m,n) | |
| info = 0 |
This file contains hidden or 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
| using PlotlyJS | |
| using JSON | |
| plots = scatter3d(;x = rand(6), y = rand(6), z = rand(6)) | |
| layout = Layout(width="600", height="600", autosize=true, title="Change the view, then switch to commandline", | |
| scene=attr( | |
| xaxis=attr(title="X", gridcolor="rgb(255, 255, 255)", | |
| zerolinecolor="rgb(255, 255, 255)", | |
| showbackground=true, | |
| backgroundcolor="rgb(25, 25, 25)"), |
This file contains hidden or 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
| module FESpaces | |
| using StaticArrays | |
| using MeshCore | |
| using MeshCore: nshapes, indextype, nrelations, retrieve, manifdim, IncRel | |
| using MeshKeeper: Mesh, baseincrel, increl | |
| using ..FElements: nfeatofdim, ndofsperfeat, ndofsperelem | |
| mutable struct FEField{N, T, IT} | |
| dofnums::Vector{SVector{N, IT}} |
OlderNewer