Coder Social home page Coder Social logo

h00shi / delfem2 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nobuyuki83/delfem2

0.0 1.0 0.0 12.31 MB

Python/C++ framework for Finite Element Method (FEM) & Physics Based Animation

Home Page: https://nobuyuki83.github.io/delfem2/

License: MIT License

C++ 68.94% CMake 4.29% Python 5.20% GLSL 0.14% Jupyter Notebook 0.64% C 20.65% Shell 0.09% Batchfile 0.05%

delfem2's Introduction

wercker status travis_status

DelFEM2

DelFEM2 is a end-to-end framework for geometry processing and FEM simulation covering wide range of components including shape editing, meshing, FEM simulation, linear solver, and visualization. DelFEM2 is aiming an interactive digital engineering and authoring tool.

Aside from the C++ implementation, python wrapper called PyDelFEM2 is provided. PyDelFEM2 can run various types of FEM simulation just a 10-20 lines of codes. Here is the example of solving the Poisson's equation in a square domain.

import PyDelFEM2 as dfm2
import PyDelFEM2.gl._glfw

cad = dfm2.Cad2D()
cad.add_polygon(list_xy=[-1,-1, +1,-1, +1,0, +0,+0, 0,+1, -1,+1.0])
mesh,map_cad2mesh = cad.mesh(0.05)
fem = dfm2.FEM_Poisson(source=1.0)
fem.updated_topology(mesh)
npIdP = cad.points_edge([0,1,2,3], mesh.np_pos)
fem.ls.bc[npIdP] = 1
fem.solve()
field = dfm2.VisFEM_ColorContour(fem,"value")
dfm2.gl._glfw.winDraw3d([field])

The result of this code woud be the following window

Poisson

The implementation is based on the DelFEM library

Please find out more detail in this project document

Manual Tutorial

Please look at the python exaxmples under examples_cpp, examples_py, examples_pyqt, and examples_jupyter.

Reading the test code under tests\ also help understanding the code behaviour

Dependency

PyDelFEM runs on Python3. Python2 is not supported.

PyDelFEM2 depends on following python packages:

  • numpy
  • glfw
  • PyOpenGL
  • PySide2

These dependency is written in REQUIRED_PACKAGES in the setup.py, so they are automatically installed when installing the PyDelFEM2 pakage using the setup.py or pip3.

Install

from PyPl

PyDelFEM2 can be installed simply with

pip3 install PyDelFEM2

For Ubuntu, if you don't have pip installed, get it with sudo apt-get install python3-pip

The installation fails if OpenGL packages are missing. For Ubuntu, install them sudo apt-get install freeglut3-dev libglfw3-dev libglew-dev

from GitHub

Installation from the GitHub repository can be done with the command:

pip3 install git+https://github.com/nobuyuki83/delfem2

building from the source code

git clone https://github.com/nobuyuki83/delfem2.git
git submodle update --init --recursive
python3 setup.py install

For Ubuntu if you don't have git install it with sudo apt-get install git

delfem2's People

Contributors

nobuyuki83 avatar

Watchers

 avatar

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.