Giter Club home page Giter Club logo

felupe's Introduction

Hi there ๐Ÿ–๏ธ,

this is Andreas, a mechanical engineer graduated from Graz University of Technology, based in ๐Ÿฐโ›ฐ๏ธ Graz, Austria ๐Ÿ‡ฆ๐Ÿ‡น. In my free time, I like running ๐Ÿƒโ€, skiing โ›ท๏ธ and snowboarding ๐Ÿ‚ while I also enjoy family times at home ๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ฆ.

GitHub stats

Currently, I'm an engineer in industry (during the day) and a PhD student at Graz University of Technology at the Institute of Structural Durability and Railway Technology (well, at night... ๐Ÿ“š ๐Ÿ•ฏ๏ธ). All the tools related to my scientific work are available here on my GitHub profile.

sparsity-pattern

I'm the author of ๐Ÿ” FElupe, an open-source finite element analysis package focussing on the formulation and numerical solution of nonlinear problems in continuum mechanics of solid bodies. Most of the open source finite element packages I found are either super-difficult to install, needs to be compiled or are great but slow (or at least too slow for my needs).

With FElupe, I try to fill a gap in between.

I'm convinced that static input files ๐Ÿ–จ๏ธ which are passed to a standalone fea solver ๐Ÿ–ฉ are a thing of the last decades ๐Ÿ’พ. Instead, scripts are input files: easy to adopt scripts with access to third-party libraries ๐Ÿ›’, written in common scripting languages are the way to go. With common languages I mean something easy-to-learn for engineers, like Python, Matlab/Octave or Julia, not another proprietary simulation file format. FElupe is just another one of many open-source finite element analysis packages using this approach. Well defined and public available scripting interfaces hopefully accelerate the introduction of flexible natural language-processing for simulations.

Projects

Python Fortran Julia PyPI Markdown Jupyter GitHub Pages PyTorch Codecov

Star History Chart

Code Snippets

felupe's People

Contributors

adtzlr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

felupe's Issues

[v1.0.1] add mesh-method `discontinous`

Introduce a method for transforming a connected mesh into a disconnected mesh. Template code:

import numpy as np
from felupe import Mesh


def as_discontinous(self):
    points = self.points[self.cells].reshape(-1, self.dim)
    cells = np.arange(self.cells.size).reshape(*self.cells.shape)
    return Mesh(points, cells, cell_type=self.cell_type)

tests

Felupe's core code base has now evolved in a way that it should not change too much in the future. Now it would be a good time to add tests and evaluate coverage...

[v1.0.1] Wrong stress projection to points

Quadrature points are indexed differently compared to the cell connectivity (due to the usage of quadpy). Thus, stress projection delivers wrong results.

A collection of tasks:

  • For linear quadratures the point ordering should be permuted in order to match cell ordering.
  • add a tools.project function for the stress projection to mesh-points (basically the code-snippet above)
  • argument to average results
  • add tools.project() to Getting Started Example (see tests)
  • check axisymmetric stress result
  • add permute for Gauss-Legendre order=2 dim=3

felupe.mesh.sweep re-sorts nodes

Due to the usage of np.unique the nodes are getting sorted. There should be at least an option to disable the sorting (which should then be the default mode). As Numpy does not provide an option this will require some work. Pandas provide a unique function too but returns no inverse index array.

Simplify mesh.py

Mesh generators are too complicated for now. There should be only 2d generators (rectangles, disks). Cubes or cylinders (with a hole) should only be expansions or revolutions from 2d sections. The scaled versions of Rectangle and Cube should be created with a scale function.

Improve `tools.newtonrhapson`

Make this function actually usable for both single- and mixed-field problems.

  • add default fun
  • add default jac
  • add default solve
  • add default check
  • add tests

[v1.0.1] Improve Documentation

Better explain the calculation of cauchy stresses and the usage of pypardiso in the getting started example. Add this example to the test suite.

IntegralFormMixed

numpy upper triangle indices are hardcoded for three-field-formulations. Change this to the number of passed fields...

self.i, self.j = np.triu_indices(3)

[v1.0.1] Tune import time

Guess: if numba is installed, felupe compiles the parallel version of the integrate method of a form on import - even if it is not used. This should be handled in a better way in the future.

Simplify poisson example

The current poisson example should be simplified to a one-dimensional field. As this was not possible in the past, the example is based on a 2d field. However, this is possible since #37 and should be adopted now.

  • add a laplace-helper function to the math module which takes a field as argument felupe.math.laplace(field)

Update field values

Field values can be updated with field += dxbut not withfield = field + dx. This is because Field.add()returnsNone.`

Unify attributes

Across felupe classes, several attributes have different names, e.g. ndim and dim. This issue serves as a collection of them.

Dimensions

attribute description
dim, ndim dimension of ...
npoints, ncells number of ...

Axisymmetry in combination with mixed-field formulations

Try to implement mixed-field formulations for axisymmetric problems.

First Task would be to merge IntegralFormAxisymmetric into IntegralForm. This should be done by adding a kind="axi" attribute to FieldAxisymmetric and then perform the adopted assemblage.

  • add kind attribute to Field
  • check kind of field in IntegralForm and adopt integrate and assemble methods
    - [ ] remove IntegralFormAxisymmetric class

Define slow?

Hi @adtzlr

Thanks for open-sourcing felupe. Looks great. I have used both FEniCS and scikit-fem and completely agree with you on native-installation of FEniCS on Windows (I use it mostly via Docker) and the the convenience of scikit-fem. For the latter, with numba even though the forms are considerably longer, the timings have been reasonable so far, especially for a pure python code.

I will try felupe for myself sometime this week. But have you observed significant differences between scikit-fem and felupe timings? Is this documented somewhere? My use cases also reside in finite incompressible elasticity so it might be worthwhile knowing it.

In any case, yet another nice tool in pure python to have at disposal.

Cheers!

Region Templates

The idea is to introduce Region templates, i.e. RegionHexahedron, RegionQuad, etc.

These template Regions have pre-defined elements and quadratures and are shorter to use.

Improve LinearElastic material

modify LinearElastic(E, nu).elasticity(strain) to LinearElastic(E, nu).elasticity(strain, stress=None) in order to calculate the initial stress contribution of the elasticity if the stress argument is passed.

Remove unused `mathsymmetric.py`

This file was created to seperate some linear algebra functions for symmetrc matrices. However, these (simpler) calculations are now in math.py, where some functions have an optional sym argument.

[v1.0.1] Wrong tovoigt() method in math

There is a typo in converting stress (3,3) to stress (6)

ij = [(0, 0), (1, 1), (2, 2), (0, 0), (1, 2), (0, 2)]

should be

ij = [(0, 0), (1, 1), (2, 2), (0, 1), (1, 2), (0, 2)]

instead.

Fix utils.axito3d

  • quadrature.order was removed and hence, the order for the 3d quadrature can't be evaluated.
  • element class names are not available anymore (Quad1 -> Quad, Hex1 -> Hexahedron)

Improve tools.py

Several tasks have to be done here. Currently tools.py (newer) and utils.py (older) both contain useful tools/utilities - some are outdated, some need to be tweaked, etc. In the end, only one file should be kept.

Tasks

  • improve tools.py
  • merge utils.py -> tools.py
  • delete utils.py

Simplify Usage of IntegralForm

During the design of FElupe, the intention was to create a single function for both LinearForm and BilinearForm, called IntegralForm. Unfortunately, this introduced the separate creation of IntegralFormMixed, as things are slightly different here. The idea is to unify IntegralForm and IntegralFormMixed into a single IntegralFormGeneralized class.

IntegralForm(fun, v, dV, grad_v=False, u=None, grad_u=False)

Also, the grad_v argument should be placed in front of u, so that one can code a Lineaform as

IntegralForm(fun, v, dV, True)

...No, keep it as it is.

For mixed formulations, fun is a list whereas for single-field formulations fun is casted into a length-one list. The same applies for the test- and trial-fields v and u. If v is a list or a tuple, then grad_v must also be of the same length, i.e. grad_v=(True, False, False). Inside this new IntegralFormGeneralized the code is ๐Ÿ’ฏ% the same for both single and mixed field formulations.

add reference loadcase "uniaxial"

as felupe.doftools.uniaxial(field, right, move, clamped=True)

and use it as

boundaries, dof0, dof1, u0ext = fe.doftools.uniaxial(displacement, right=1.0, move=0.4, clamped=False)

Improve Element Namings

should be similar to vtk cell types...

  • Line, Triangle, Quad, Tetrahedron and Hexahedron for the linear elements
  • QuadraticTriangle, QuadraticTetrahedron and QuadraticTetrahedron for quadratic elements with edge-based midpoints
  • TriQuadraticHexahedron for quadratic lagrange-type hexahedron with mid-faces and mid-volume points
  • ArbitraryOrderLagrange for "VTK_LAGRANGE_QUAD" or "VTK_LAGRANGE_HEXAHEDRON"

Access field values by slice

A field cannot be accessed with a slice. However, this could sometimes be convenient. Take the following code:

displacement = fe.Field(region, dim=3)

# this is the current way to obtain "u1"
u1 = displacement.values.ravel()[dof1]

# this should be possible...
u1 = displacement[dof1]

add general purpose Newton-Rhapson template function

As the Newton-Rhapson algorithm is frequently used, it would be a great addition to felupe to have a flexible template function. It should be able to

  • handle both
  • single and
  • mixed field formulations
  • let the user pass a function and its jacobian along with a given state of equilibrium
  • both the input variables (unknowns) and the output (equilibrium residuals) should be able to be pre- and postprocess-able
  • the result should be stored in a Result class, similar to scipy.optimize

Fix tetrahedral meshes

If a tet mesh is imported with node numbering resulting in negative volumes this leads to an error in felupe.

Tasks:

  • generate a fix function which can be applied to both triangle and tetrahedral meshes
  • add quadrature rules for linear/quadratic triangle/tetrahedrons

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.