mirror of
https://github.com/JuliaFEM/JuliaFEM.jl.git
synced 2026-09-27 20:26:58 +00:00
separated to submodules
This commit is contained in:
+30
-17
@@ -6,14 +6,31 @@ This is JuliaFEM -- Finite Element Package
|
||||
"""
|
||||
module JuliaFEM
|
||||
|
||||
#using Logging
|
||||
#@Logging.configure(level=DEBUG)
|
||||
#using Lexicon
|
||||
module API
|
||||
include("api.jl")
|
||||
|
||||
# export ....
|
||||
|
||||
end
|
||||
|
||||
module Preprocess
|
||||
# include("abaqus_reader.jl") <-- ERROR: LoadError: LoadError: UndefVarError: Model not defined
|
||||
include("aster_reader.jl")
|
||||
end
|
||||
|
||||
module Postprocess
|
||||
include("xdmf.jl")
|
||||
end
|
||||
|
||||
""" JuliaFEM testing routines. """
|
||||
module Test
|
||||
include("test.jl")
|
||||
end
|
||||
|
||||
module Core
|
||||
|
||||
import Base: +, -, /, *, push!, convert, getindex, setindex!, length, similar, call, vec, endof
|
||||
|
||||
#importall Base
|
||||
|
||||
"""
|
||||
A very simple debugging macro. It prints debug message if environment variable
|
||||
JULIAFEM_DEBUG is found.
|
||||
@@ -27,9 +44,11 @@ macro debug(msg)
|
||||
end
|
||||
return :( println("DEBUG: ", $msg) )
|
||||
end
|
||||
|
||||
function set_debug_on!()
|
||||
ENV["JULIAFEM_DEBUG"] = 1;
|
||||
end
|
||||
|
||||
function set_debug_off!()
|
||||
pop!(ENV, "JULIAFEM_DEBUG");
|
||||
end
|
||||
@@ -38,7 +57,7 @@ export @debug, set_debug_on!, set_debug_off!
|
||||
|
||||
using ForwardDiff
|
||||
autodiffcache = ForwardDiffCache()
|
||||
export derivative, jacobian, hessian
|
||||
# export derivative, jacobian, hessian
|
||||
|
||||
""" Simple linspace extension to arrays.
|
||||
|
||||
@@ -64,6 +83,7 @@ function Base.resize!(A::SparseMatrixCSC, m::Int64, n::Int64)
|
||||
A.m = m
|
||||
end
|
||||
|
||||
|
||||
# fields, see https://github.com/JuliaFEM/JuliaFEM.jl/blob/master/notebooks/2015-06-14-data-structures.ipynb
|
||||
include("fields.jl")
|
||||
#include("basis.jl") # interpolation of discrete fields
|
||||
@@ -92,19 +112,12 @@ include("assembly.jl")
|
||||
include("solvers.jl")
|
||||
include("directsolver.jl") # parallel sparse direct solver for non-linear problems
|
||||
|
||||
### API ###
|
||||
include("api.jl")
|
||||
|
||||
### MORTAR STUFF ###
|
||||
include("mortar.jl") # mortar projection
|
||||
end
|
||||
|
||||
# PRE AND POSTPROCESS
|
||||
include("xdmf.jl")
|
||||
include("abaqus_reader.jl")
|
||||
|
||||
include("test.jl")
|
||||
module Interfaces
|
||||
include("interfaces.jl")
|
||||
end
|
||||
|
||||
end # module
|
||||
|
||||
FEM = JuliaFEM
|
||||
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
# This file is a part of JuliaFEM.
|
||||
# License is MIT: see https://github.com/JuliaFEM/JuliaFEM.jl/blob/master/LICENSE.md
|
||||
|
||||
# define these
|
||||
abstract Problem
|
||||
abstract Element
|
||||
|
||||
abstract BoundaryCondition
|
||||
|
||||
type NeumannBC{ S <: AbstractString} <: BoundaryCondition
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
# This file is a part of JuliaFEM.
|
||||
# License is MIT: see https://github.com/JuliaFEM/JuliaFEM.jl/blob/master/LICENSE.md
|
||||
|
||||
|
||||
|
||||
function parse(mesh::ASCIIString, ::Type{Val{:CODE_ASTER_MAIL}})
|
||||
model = Dict{ASCIIString, Any}()
|
||||
header = nothing
|
||||
data = ASCIIString[]
|
||||
for line in split(mesh, '\n')
|
||||
length(line) != 0 || continue
|
||||
info("line: $line")
|
||||
if is_aster_mail_keyword(strip(line))
|
||||
header = parse_aster_header(line)
|
||||
empty!(data)
|
||||
continue
|
||||
end
|
||||
if line == "FINSF"
|
||||
info(data)
|
||||
header = nothing
|
||||
process_aster_section!(model, join(data, ""), header, Val{header[1]})
|
||||
end
|
||||
end
|
||||
return model
|
||||
end
|
||||
+2
-20
@@ -1,24 +1,6 @@
|
||||
# This file is a part of JuliaFEM.
|
||||
# License is MIT: see https://github.com/JuliaFEM/JuliaFEM.jl/blob/master/LICENSE.md
|
||||
|
||||
module interfaces
|
||||
|
||||
using Logging
|
||||
@Logging.configure(level=DEBUG)
|
||||
|
||||
#using JuliaFEM.elasticity_solver
|
||||
export solve_elasticity_interface!
|
||||
|
||||
"""
|
||||
This is generic interface that reads data from data model, solves elasticity
|
||||
problem and updates model.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
model : to be defined
|
||||
"""
|
||||
function solve_elasticity_interface!()
|
||||
return 0
|
||||
end
|
||||
|
||||
function foo()
|
||||
return "bar"
|
||||
end
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
# This file is a part of JuliaFEM.
|
||||
# License is MIT: see https://github.com/JuliaFEM/JuliaFEM.jl/blob/master/LICENSE.md
|
||||
|
||||
""" JuliaFEM testing routines. """
|
||||
module Test
|
||||
|
||||
using Base.Test
|
||||
|
||||
abstract TestResult
|
||||
@@ -159,4 +156,3 @@ end
|
||||
|
||||
export @test, run_test, print_test_statistics
|
||||
|
||||
end
|
||||
|
||||
@@ -155,9 +155,7 @@ function xdmf_new_field(grid, name, source, data)
|
||||
|
||||
typ = string(typeof(data))
|
||||
datatype = "unknown"
|
||||
@debug("typeof: $typ")
|
||||
for j in ["Int", "Float"]
|
||||
@debug(j)
|
||||
if contains(typ, j)
|
||||
datatype = j
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user