Commit Graph

366 Commits

Author SHA1 Message Date
Jukka Aho 7919a1fffa test: Add perfect plasticity material model validation
- Tests PerfectPlasticity with J2 von Mises yield criterion and linear hardening
- PlasticityState tracking: ε_p (plastic strain), α (backstress), κ (plastic work)
- Elastic loading: small strain below yield → no plastic strain
- Plastic loading: strain beyond yield → radial return mapping
- Von Mises yield surface: f = √(3/2·s:s) - σ_y ≤ 0
- Hardening behavior: H > 0 (kinematic hardening) vs H = 0 (perfect plasticity)
- Incremental loading: monotonic stress and plastic strain accumulation
- Bauschinger effect: cyclic loading with backstress evolution
- Pure shear: τ_yield = σ_y/√3 validation
- Consistency check: yield criterion satisfaction at all strain levels
- Tests both simplified interface and full state-passing API
- Zero allocation and type stability verification
- 293 lines validating elastoplastic material behavior with Tensors.jl
2025-11-12 00:08:30 +02:00
Jukka Aho 3b13a77981 test: Add nodal vs element assembly comparison validation
- Implements BOTH assembly methods for direct comparison on same problem
- Traditional element assembly: builds 12×12 K_e matrices, scatters to global K
- Nodal assembly: computes 3×3 K_ij blocks directly, accumulates per node
- Test problem: linear elasticity on simple Tet4 mesh
- TestLinearElastic material with Lamé parameters (λ, μ from E, ν)
- B-matrix computation: strain-displacement operator (6×3 per node, Voigt notation)
- Element stiffness: K_e = ∫ B^T C B dV with Gauss integration
- Nodal contribution: spider pattern with 3×3 blocks for coupled nodes
- Matrix-vector product comparison: K*v computed both ways
- Validates numerical equivalence: ‖K_element - K_nodal‖ < tol
- Performance characteristics: element (matrix scatter) vs nodal (direct blocks)
- Architectural differences demonstration: gather-scatter vs direct accumulation
- 542 lines validating nodal assembly correctness and comparing approaches
2025-11-12 00:08:06 +02:00
Jukka Aho 1f07f3f7aa test: Add comprehensive deformation gradient computation validation
- Tests compute_deformation_gradient() for both FiniteStrain and SmallStrain formulations
- Identity case: u=0 → F=I, det(F)=1
- Pure translation: constant u → ∇u=0 → F=I (rigid body motion)
- Pure stretch: uniaxial extension (10%, 20%) → diagonal F
- Simple shear: u_x = γ·y → off-diagonal F components
- Validates F = I + ∇u (finite strain) vs F = I (small strain approximation)
- Physical constraint: det(F) > 0 (orientation preservation)
- Incompressibility check: det(F) ≈ 1 for volume-preserving deformation
- Symmetry verification for Right Cauchy-Green tensor C = F^T·F
- Type stability and zero allocation checks
- Integration with new API: get_basis_derivatives(Hexahedron(), Lagrange{}, ξ)
- Tests Hex8 elements with various deformation patterns
- 393 lines validating fundamental kinematics with Tensors.jl
2025-11-12 00:07:40 +02:00
Jukka Aho 7b875dd117 test: Add nodal assembly data structures validation
- Tests NodeToElementsMap inverse connectivity (node → elements touching it)
- Validates "spider" pattern: set of nodes coupled to given node via shared elements
- Simple Tet4 mesh: 2 elements sharing face, tests node-element relationships
- Spider coupling patterns: corner nodes (1 element), shared nodes (2 elements)
- NodalStiffnessContribution storage: K_blocks (3×3 tensors), f_int, f_ext (Vec{3})
- Matrix-vector product: w_i = ∑_j K_ij ⊡ u_j (nodal assembly operation)
- Spider efficiency check: 2×2×2 hex mesh shows sparse coupling
  - Corner node: 8 couplings
  - Center node: 27 couplings (max for structured mesh)
  - Key insight: only compute non-zero blocks (not full 81×81 matrix)
- Diagnostic output showing spider structure and coupling patterns
- 208 lines validating nodal assembly infrastructure with Tensors.jl
2025-11-12 00:07:01 +02:00
Jukka Aho 5ec6dda0dd test: Add new API element construction validation
- Tests Element construction with explicit Topology + Basis separation
- Validates 2D elements: Triangle (P1=3 nodes, P2=6 nodes), Quadrilateral (Q1=4, Q2=9)
- Validates 3D elements: Tetrahedron (P1=4, P2=10), Hexahedron (Q1=8, Q2=27)
- Backward compatibility: Tet4, Tri3, Quad4, Hex8 aliases verified
- Topology properties independent of basis: dim(), reference_coordinates(), edges(), faces()
- Type-stable fields using NamedTuple (E, ν, thickness)
- Integration points as element property with integration_points(scheme, topology)
- Demonstrates separation of concerns: Geometry ≠ Interpolation ≠ Integration ≠ Fields
- Compile-time known sizes: NTuple connectivity, type parameters encode dimensions
- Zero allocation verification for field access and element queries
- 344 lines validating new immutable Element architecture with clear responsibilities
2025-11-12 00:06:34 +02:00
Jukka Aho 49bb196e68 test: Add new API basis function evaluation validation
- Demonstrates correct new API usage: Topology + Basis + IntegrationPoint separation
- Mock BasisValues struct with shape functions N and derivatives dN_dξ (SVector)
- Tests linear tetrahedron (P1, 4 nodes) evaluation at center and corner nodes
- Tests linear triangle (P1, 3 nodes) evaluation and partition of unity
- Validates constant derivatives for linear elements
- Integration with Gauss quadrature: evaluate_basis at all integration points
- Complete FEM workflow demonstration: Topology → Integration → Basis → Assembly
- Multiple element types from same topology (P1 vs P2 with same integration points)
- Type stability and zero allocation verification with StaticArrays
- 291 lines demonstrating separation of concerns: Topology ≠ Basis ≠ Integration
2025-11-12 00:05:56 +02:00
Jukka Aho 1b8da3465c test: Add comprehensive neo-Hookean hyperelastic material validation
- Tests NeoHookean construction with both Lamé parameters and engineering constants
- Strain energy computation: reference state (ψ=0), uniaxial extension, invalid deformations
- Stress computation: small deformation, large deformation (50% extension), pure shear
- Second Piola-Kirchhoff stress: S = 2·∂ψ/∂C computed via automatic differentiation
- Tangent modulus validation: 4th-order symmetric tensor, finite difference consistency
- Verifies stress-energy relationship: S = 2·gradient(strain_energy, C)
- Small strain limit: Neo-Hookean → linear elasticity as ε → 0
- Incompressibility check for nearly incompressible materials (ν → 0.5)
- Automatic differentiation accuracy verification
- Zero allocation and type stability checks
- 295 lines validating finite deformation hyperelasticity with Tensors.jl
2025-11-12 00:01:18 +02:00
Jukka Aho e9ead51f24 test: Add comprehensive linear elastic material validation
- Tests LinearElastic material construction with parameter validation
- Validates Lamé parameter computation (λ and μ from E and ν)
- Stress computation tests: uniaxial extension, pure shear, hydrostatic pressure, general strain
- Verifies Hooke's law: σ = λ·tr(ε)·I + 2μ·ε
- Tangent modulus validation: 𝔻 = λ·I⊗I + 2μ·𝕀ˢʸᵐ (4th-order tensor)
- Double contraction consistency: σ = 𝔻 ⊡ ε
- Symmetry and isotropy property verification
- Tests both full and simplified compute_stress() interfaces
- Zero allocation and type stability checks
- 279 lines validating fundamental elasticity operations with Tensors.jl
2025-11-12 00:00:59 +02:00
Jukka Aho 1952f9c6cb test: Add comprehensive Jacobian computation validation
- Tests compute_jacobian() for 2D triangles and 3D tetrahedra
- Validates identity, scaling, and rotation transformations
- Tests physical_derivatives() conversion from reference to physical coordinates
- Verifies constant strain condition (∑ dNᵢ/dx = 0)
- Element quality checks via determinant (positive = proper orientation)
- Detects degenerate elements (det ≈ 0)
- Type stability and zero allocation verification
- Manual calculation consistency checks for known Jacobians
- Tests both tuple and vector interfaces
- 261 lines covering fundamental isoparametric mapping operations
2025-11-12 00:00:41 +02:00
Jukka Aho b6b5ea4b1a test: Add zero-allocation integration points API validation
- Tests get_gauss_points!() for 5 topology types (Segment, Triangle, Tetrahedron, Quadrilateral, Hexahedron)
- Validates zero allocation property for all quadrature orders
- Verifies return type: NTuple of (Float64, Vec{D}) pairs
- Tests weight summation equals reference element area/volume
- Demonstrates usage in assembly loop with zero allocations
- Includes performance comparison benchmarking
- 151 lines of comprehensive integration points validation
2025-11-11 23:59:32 +02:00
Jukka Aho d47eed8ed3 test: Add finite strain plasticity material model validation
Unit tests for FiniteStrainPlasticity with multiplicative decomposition.

Test coverage:
- Material construction with validation (E, ν, σ_y, H parameters)
- State initialization (F_p, α_bar, κ)
- Small strain limit verification
- Identity and pure rotation deformation (frame indifference)
- Uniaxial extension (elastic and plastic regimes)
- Simple shear deformation
- Incremental loading with state persistence
- Plastic incompressibility constraint (det(F_p) ≈ 1)
- Kinematic hardening behavior (backstress evolution)
- State persistence across load steps
- Type stability verification
2025-11-11 23:54:22 +02:00
Jukka Aho c9f951ef16 test: Add traditional element assembly structures validation
Tests for element-by-element assembly approach with sparse matrix operations.

Test coverage:
- ElementAssemblyData construction and initialization
- DOF indexing for sequential and non-sequential nodes
- Element contribution structures (K_local, f_int, f_ext)
- Scatter operation to global arrays
- Overlapping element accumulation
- Residual computation (f_ext - f_int)
- Matrix-vector product
- Dirichlet BC application (penalty method)
- Symmetry preservation
- Reset functionality
- Assembly statistics printing
2025-11-11 23:53:02 +02:00
Jukka Aho 0ccc29976c test: Add single-element patch test for elasticity assembly
Validates core assembly implementation by solving single Tet10 element
under uniaxial tension and comparing to analytical solution.

Test coverage:
- Linear elastic material model validation
- Strain computation from gradients (uniaxial extension)
- Assembly helpers zero allocation verification
- Type stability verification
- Stiffness matrix properties (symmetry, positive definiteness)
- Internal forces accumulation

Validates complete assembly infrastructure works correctly.
2025-11-11 23:52:32 +02:00
Jukka Aho 280f42bbf8 test: Add standalone elasticity assembly helpers validation
Tests core assembly helper functions (strain computation, stiffness
accumulation) without requiring full Element/BasisInfo infrastructure.
Uses Tensors.jl types directly for validation.

Test coverage:
- Material model integration (LinearElastic)
- Strain computation from shape function gradients
- Stiffness matrix accumulation
- Zero allocation verification
- Type stability verification
- Stiffness matrix properties (symmetry, eigenvalues)
2025-11-11 23:52:05 +02:00
Jukka Aho 2b1fa89684 test(gpu): Add GPU elasticity solver test with cantilever beam
- Complete test suite for ElasticityPhysics solver
- Cantilever beam mesh: 190 nodes, 434 Tet4 elements
- Gmsh-generated mesh file (cantilever_beam.msh)
- Material: Steel (E=200 GPa, ν=0.3)
- Boundary conditions: Fixed end, pressure load on free end
- Validates convergence and displacement field
- Test passes: 430 CG iterations, max displacement 4.1 cm
2025-11-10 22:24:52 +02:00
Jukka Aho 358f7701d4 style(test): Add spacing in division operator for consistency
Changes to test/test_elasticity_1d.jl:
- Changed sqrt(3)/2 to sqrt(3) / 2 (added spaces around /)
- Improves code readability and follows Julia style conventions
- No functional change, formatting only
2025-11-09 21:03:59 +02:00
Jukka Aho aab8b7d6ce feat(test): First test rewritten for immutable elements (test_elasticity_1d)
Rewrote test_elasticity_1d.jl to follow immutable element pattern.
This is the first fully working test with the new architecture!

Changes:
1. test/test_elasticity_1d.jl:
   - Convert Dict node data to element-local tuple format
   - Wrap data in DVTI field objects (Discrete, Variable, Time-Invariant)
   - Create element with fields at construction: Element(Seg2, conn; fields=(...))
   - Fix Jacobian shape expectation (3×1 not 1×3 for 1D in 3D)

2. src/JuliaFEM.jl:
   - Add minimal jacobian() function for AbstractBasis (non-parametric)
   - Handles embedding (1D element in 3D space) correctly
   - Returns Matrix instead of Tensor for flexibility

3. src/elements/elements.jl:
   - Fix Jacobian computation to handle both Tuple and IntegrationPoint
   - Fix detJ calculation logic for embedded elements (check m not size(JT,2))
   - Correctly handle 1D elements: detJ = ||∂X/∂ξ||

Result: test_elasticity_1d.jl passes! ✓

This validates the immutable architecture:
- Element created with fields at construction
- No mutation needed during test
- Field system integration working (DVTI fields)
- Jacobian computation working for embedded elements
2025-11-09 18:42:56 +02:00
Jukka Aho 6ca17e0569 Integrate topology/integration modules with comprehensive testing
INTEGRATION COMPLETE ✓
=======================

What's New:
-----------
- Integrated 17 topology types into main JuliaFEM module
- Integrated Gauss quadrature integration system
- Added comprehensive standalone test suite (36 tests, all passing)
- Documented topology coordinates for Hex20, Hex27, Pyr5, Quad8, Quad9, Tri7, Wedge6, Wedge15

Changes:
--------
src/JuliaFEM.jl:
  - Added topology module includes (17 topology types)
  - Added integration module includes (integration.jl, gauss.jl)
  - Exported all topology and integration symbols
  - Documented lagrange basis conflict (TODO for Phase 2)

test/test_topology_integration.jl (NEW):
  - Comprehensive test suite for full JuliaFEM integration
  - Tests all 17 topology types (1D, 2D, 3D)
  - Tests integration point generation for all topologies
  - Validates zero-allocation design
  - 370+ lines of test coverage

test/test_topology_standalone.jl (NEW):
  - Standalone validation tests (36/36 passing)
  - Tests topology module independently
  - Tests integration module independently
  - Bypasses name conflicts with old basis system
  - Proves core functionality correct

Topology Fixes:
  - Hex20, Hex27: Added proper node numbering documentation
  - Hex8: Fixed reference coordinates to match standard [-1,1]³
  - Pyr5: Fixed apex coordinate to (0,0,1)
  - Quad8, Quad9: Fixed midpoint coordinates
  - Tri7: Added standard node order
  - Wedge6, Wedge15: Fixed coordinate system

Documentation:
  - Updated book README with integration status
  - Updated contributor test fixes with topology integration notes

Test Results:
-------------
Topology standalone: 23/23 passed
  ✓ Seg2: nnodes, dim, coordinates
  ✓ Tri3: nnodes, dim, coordinates, edges
  ✓ Quad4: nnodes, dim, coordinates, edges
  ✓ Tet4: nnodes, dim, coordinates, edges, faces
  ✓ Hex8: nnodes, dim, coordinates, edges, faces

Integration standalone: 13/13 passed
  ✓ IntegrationPoint structure
  ✓ Gauss{1} + Tri3: 1 point at (1/3, 1/3), weight 0.5
  ✓ Gauss{3} + Tri3: 3 points, weights sum to 0.5
  ✓ Gauss{2} + Quad4: 4 points, weights sum to 4.0
  ✓ Gauss{1} + Tet4: 1 point (3D)
  ✓ Gauss{2} + Hex8: 8 points, weights sum to 8.0

Known Issue:
------------
Name conflict between topology types (Tri3 <: AbstractTopology) and
basis types (Tri3 <: AbstractBasis). Lagrange basis files currently
commented out to allow topology/integration to load. Will be resolved
in Phase 2 by renaming basis types (e.g., Tri3 -> Tri3Basis).

Zero-Allocation Design Verified:
---------------------------------
All topology and integration functions return tuples (immutable, stack-allocated).
No heap allocations in hot paths. Performance-critical design validated.

Next Steps:
-----------
1. Resolve name conflicts (rename basis types with *Basis suffix)
2. Refactor AbstractElement to accept separate topology/basis types
3. Run full test suite with integrated modules
4. Generate code coverage report
2025-11-09 06:13:40 +02:00
Jukka Aho 907ec0b183 refactor: Zero-allocation basis functions and immutable Element
MAJOR PERFORMANCE REFACTORING:

1. Shape functions return tuples instead of allocating vectors:
   - eval_basis!(): Returns NTuple{N,T} directly (zero allocations)
   - eval_dbasis!(): Returns NTuple{N,Vec{D}} directly (zero allocations)
   - API boundary (get_basis/get_dbasis) still returns vectors for compat

2. Element is now immutable with compile-time known structure:
   - connectivity: Vector{UInt} → NTuple{N,UInt}
   - integration_points: Vector{IP} → NTuple{NIP,IP}
   - Element{N,NIP,M,B} parametrized by connectivity/IP count
   - Changed from 'mutable struct' to 'struct'

3. Helper function for immutability:
   - with_integration_points(element, ips) returns new element
   - get_integration_points() returns tuple directly

Benefits:
- Zero allocations in hot paths (basis evaluation)
- Compile-time sizes enable better optimization
- Type stability improvements
- Stack allocation instead of heap

Breaking changes:
- Element.connectivity is now tuple (use collect() for vector)
- Element is immutable (use with_integration_points for updates)

Tests: All 157 tests passing
2025-11-09 03:29:36 +02:00
Jukka Aho 52ebe682e9 fix: Standardize on Tensors.jl Vec type throughout
Major architectural decision: Use Tensors.jl consistently everywhere
for geometric vectors, integration points, and coordinates.

Changes to src/elements/elements.jl:
- get_basis(): Convert ip to Vec, use Vector (not Matrix) for eval_basis!
- get_dbasis(): Convert ip to Vec
- jacobian evaluation: Convert geometry and ip.coords to Vec properly
- Handle both raw coordinates (Tuple) and IP struct transparently

New Tutorial 3: Numerical Integration and Jacobian (49 tests)
- Integration point structure and weights
- Jacobian determinant and matrix evaluation
- Numerical integration (constant, linear, quadratic functions)
- Multiple element types (Quad4, Seg2, Tri3)

Tests: 107 → 156 passing (49 new)
Runtime: ~7 seconds

Closes architectural standardization on Tensors.jl.
Related to Issue #250 (merge conflict resolution).

Why Tensors.jl:
- Type stability (100× performance vs Dict-based)
- Material science compatibility (stress tensors)
- Zero-cost abstractions
- Consistent API across all geometric calculations
2025-11-09 03:10:11 +02:00
Jukka Aho 5a07b3ab21 docs: Document Tutorial 3 API limitations, update test runner
Current state discovery:
- Element basis function evaluation broken (eval_basis! signature mismatch)
- Field interpolation at integration points broken (same root cause)
- Jacobian evaluation at integration points broken
- These are fundamental API issues affecting multiple test paths

Impact:
- Tutorial 3 (basis functions) deferred until API fixed
- Affects any code trying to evaluate fields at integration points
- Related to Quad4 assembly issues discovered in Tutorial 4

Working tutorials (107/107 tests passing):
- Tutorial 1: Element creation (5 tests)
- Tutorial 2: Gmsh mesh reading (72 tests)
- Tutorial 4: 1-element validation (35 tests)

Next: Focus on tutorials using working APIs only
2025-11-09 02:58:09 +02:00
Jukka Aho bafa3af4d0 test: Add Tutorial 4 - 1-element Quad4 validation (35 tests passing)
Educational validation test for Issue #265 use case (JuliaFEM as reference).

Covers:
- Element creation and connectivity
- Field assignment (geometry, material properties)
- Field retrieval with function call syntax
- Hand-calculated constitutive matrix for plane stress
- Geometry validation (dimensions, center, area)
- Material property validation (physical ranges)

Note: Defers stiffness matrix assembly to future work due to current
Quad4 assembly issues. Focus is on element setup validation that
other FEM developers can use as reference.

Tutorial series now: 107/107 tests passing
- Tutorial 1: Creating elements (5 tests)
- Tutorial 2: Gmsh mesh reading (72 tests)
- Tutorial 4: 1-element validation (35 tests - done before Tutorial 3)
2025-11-09 02:45:29 +02:00
Jukka Aho b91e81c125 test: Add Tutorial 2 - Gmsh mesh reading (72 tests passing)
Educational tutorial covering complete Gmsh.jl workflow:
- Mesh generation recipe (2×5 structured Quad4 grid)
- Reading nodes and extracting coordinates
- Reading elements and topology
- Physical group extraction for boundary conditions
- Creating JuliaFEM Element objects from Gmsh data
- Geometry field validation

Features:
- Co-located .msh file (10 elements, 18 nodes) for self-contained testing
- Recipe script shows exactly how mesh was generated (reproducible)
- Comprehensive tests (72 assertions) validating entire workflow
- Runtime: ~3 seconds
- Type-safe conversions (UInt64 → Int64 for connectivity)

Tutorial series now: 77/77 tests passing (Tutorial 1: 5, Tutorial 2: 72)
2025-11-09 02:24:06 +02:00
Jukka Aho 61218f8fd3 test: Phase 1 - Educational test infrastructure with Literate.jl
Implement testing philosophy (see docs/TESTING_PHILOSOPHY.md):

New test structure:
- test/tutorials/ - Educational tests (generate documentation)
- test/unit/ - Fast focused tests
- test/verification/ - Known analytical solutions
- test/runtests_new.jl - New test runner with env var control

First tutorial: Creating Elements and Fields
- Teaches node/element creation
- Explains field concept (geometry, materials, loads)
- 5 tests, all passing 

Test runner features:
- JULIAFEM_TEST_TUTORIALS=true/false (default: true)
- JULIAFEM_TEST_UNIT=true/false (default: false)
- JULIAFEM_TEST_OLD=true/false (default: false)
- Clear output with test categories
- Preserved old test suite as runtests.jl.old

Results: 5/5 tests passing in <2 seconds

Next: Write 2-3 more fundamental tutorials (mesh reading, 1D elasticity)
2025-11-09 01:51:17 +02:00
Jukka Aho 724ed52923 Add Manifest.toml 2025-11-08 08:50:59 +02:00
Jukka Aho 4ceb353314 Merge branch 'master' of github.com:JuliaFEM/JuliaFEM.jl 2019-11-26 15:30:42 +07:00
Jukka Aho d781b00da1 Merge branch 'master' into kc/local_buffer 2019-11-26 15:29:02 +07:00
Jukka Aho 9dc794101c Give meaningful error message when assembling continuum elasticity problem fails
Sometimes user may have the wrong kind of elements in element set when
assembling 3d continuum problem. This could happen for example in
situations, where mesher is giving also segment elements. They may have
some use in certain situations, but currently we don't support them.
When assembly is failing for this reasons, we give a meaningful error
message:

[ Info: It looks that you are trying to assemble elements of type Seg3
to 3d continuum problem. However, they are not supported yet. To filter
out elements from a element set, try `filter(element->!isa(element,
Element{Seg3}), elements)`
ERROR: LoadError: Tried to assemble unsupported elements of type Seg3 to
3d continuum problem.

This commit closes issue #211.
2019-10-27 12:50:11 +02:00
Jukka Aho 0d30a8f516 Create Project.toml file and remove REQUIRE files 2019-10-11 17:55:27 +03:00
Jukka Aho 824920c433 Fix broken test
The order of the calculated eigenvalues has been changed in the newest
Julia versions. Fixed by sorting the lists before comparison. Closes
issue #232.
2019-09-13 13:23:33 +03:00
Jukka Aho e462fa2862 Documentation deployment fix (#230)
Similar work done in FEMQuad.jl and FEMBase.jl
2019-04-08 21:35:13 +03:00
Kristoffer Carlsson 09c355b916 make backwards compatible 2018-11-29 17:40:55 -05:00
Kristoffer Carlsson ee7532a749 updates 2018-11-19 07:44:56 -05:00
Kristoffer Carlsson b503065d66 Merge branch 'kc/coloring' into kc/local_buffer 2018-11-15 08:18:28 -05:00
Kristoffer Carlsson a2adc68b3f implement matrix coloring 2018-11-08 14:28:20 -05:00
Kristoffer Carlsson 25866860ab wip 2018-11-08 14:27:44 -05:00
Kristoffer Carlsson cd22d1a571 use buffer and call assemble for one elements, also some tweaks for using sparsity pattern in FEMBase.jl 2018-10-19 17:35:30 -04:00
Jukka Aho ca7e2904cf Fix tests
* Fix deprecation warnings from tests
* Refactor tests so that ´@testset` is usually called in master file
  `runtests.jl`, not inside test file. Later on we can convert tests
  to examples.
* Syntax of tests now follow more closely syntax used currently in
  JuliaFEM. We have had earlier studies with different kind of syntaxes,
  now we have kind of explicit way to do things.
2018-09-06 13:34:26 +03:00
Jukka Aho 52be9e546b Create test/REQUIRE
* Add Documenter and Literate as test requirements
2018-09-06 13:34:26 +03:00
Jukka Aho 005a2440bb Update runtests.jl
* Explicitly call test files instead of for loop
* Call Documenter before and after unit tests
2018-09-06 13:34:26 +03:00
Jukka Aho c7ff354618 Remove badly designed test (#208)
Solution not known for tests. Let's create simpler tests with known solutions.
2018-07-25 14:10:05 +03:00
femtocleaner[bot] 33c8657f56 Fix deprecations (#206) 2018-07-05 11:21:10 +03:00
Jukka Aho eb600c940e Drop Logging.jl (#205)
Julia 0.7 is having improved logging capabilities, we can drop
Logging.jl.
2018-07-04 22:59:32 +03:00
Jukka Aho 413526804b Improve documentation (#199)
Let's use Literate.jl to automatically generate usage examples.

* Automatically generate documentation from other packages (first try to include each package's docs/src/index.md, but if that fails, then use README.md to introduce the package).
* Add example how to calculate local element matrices.
* Add example how to perform 2d contact analysis.
2018-05-30 11:52:01 +03:00
Jukka Aho e68eec89f9 Move contact mechanics to separate package (#196)
Development of auto-differentiated mortar contact mechanics in 2D is moved to own separate package, MortarContact2DAD. Other changes are similar to what is done with MortarContact2D: elements are added to problems using `add_slave_elements!` and `add_master_elements!` instead of `add_elements!`, to make interface more explicit. Also, problem name is `Contact2DAD`, so the dimension is now explicitly stated in problem name. (Also have `Mortar2DAD`, compare to the `Mortar2D` and `Contact2D` of `MortarContact2D.jl`.)
2018-05-17 09:45:18 +03:00
Jukka Aho 9e28c6d604 Separate 2d contact code to own package (#195)
Moved plane contact related stuff to own separate package
`MortarContact2D.jl`, where the development continues.

The following changes to test files are done:

1) Problem name for plane mortar coupling is `Mortar2D` (was `Mortar`
before), and later on 3d coupling will be `Mortar`. So the dimension
of coupling operator is explicitly given in a problem name.

2) Before elements to coupling was defined using
```julia
update!(problem.elements, "master elements", master_elements)
add_elements!(problem, [slave_elements; master_elements])
```
Now, explicitly give master and slave elements as
```julia
add_slave_elements!(problem, slave_elements)
add_master_elements!(problem, master_elements)
```
Keep on mind that Lagrange multipliers are in slave side.
2018-05-07 15:14:42 +03:00
Jukka Aho 79170fcf23 Use package HeatTransfer.jl for heat problems (#194)
Heat transfer analysis is moved to its own package where the development continues. Two small modifications are needed for test files:

- Instead of `problem.properties.formulation`, we have two separate problems, `PlaneHeat` for two-dimensional problems and `Heat` for three-dimensional problems.
- Unnecessary prefixing of field names is changed. For example, now we simply have only "thermal conductivity" and not prefixed "temperature thermal conductivity".
2018-05-03 15:37:37 +03:00
Jukka Aho cfcd647cac Drop Dataframes (#193)
Looks that package is no more used in the code. Let's drop it.
2018-05-02 12:45:14 +03:00
Jukka Aho 23204ee15b Replace some rarely used functions (#188)
- `empty!(problem)` -> `empty!(problem.assembly)`
- `get_gdofs(element, ndim)` -> `get_gdofs(problem, element)`
2018-02-08 14:47:44 +07:00
Jukka Aho 5b93c48a3a Make JuliaFEM to use Analysis type from FEMBase
`Analysis` is basically doing same than `Solver` before, but has a
slighly simpler structure and is more general.
2018-01-29 23:13:41 +07:00