Giter Site home page Giter Site logo

xpfem's Introduction

xpfem

A python package for finite element method (FEM) in solid mechanics

You should download all the code and install the following packages:

  • numpy
  • scipy
  • pyvista

Features:

  • linear elasticity
  • 2D Quadrilateral element (Q1,Q2)
  • 3D Hexahedral element (Q1,Q2)
  • BBar element for 3D Q1 element
  • Perfect post-processing
  • Export VTK file

Run code

You can install the packages by

  1. pip install numpy
  2. pip install scipy
  3. pip install pyvista

Run the test.py or other test file, you can get the displace and stress as following

Preparing input files from ANSYS

See https://github.com/Qinxiaoye/FEM2D to learn how to creat the input files from ANSYS

xpfem's People

Contributors

qinxiaoye avatar

Stargazers

墨非未已 avatar  avatar orNext avatar Xinrong Li avatar  avatar  avatar YanTuXiaoChen avatar Xing Li avatar Chen Xiaoxiao avatar  avatar Gefan Yang avatar Yuxuan Liu avatar  avatar  avatar Xiuzhi Huang avatar  avatar Bickmick avatar  avatar HaiwenZhang avatar  avatar  avatar  avatar YuanLan avatar Yangyuanchen Liu avatar Yunlong Su avatar xzb avatar ChengShenxiang avatar  avatar Yong-Tong Zheng avatar

Watchers

 avatar xzb avatar

xpfem's Issues

DEMO没有适配Linux,我用AI帮忙做个脚本处理了一下,分享一下脚本。

1. xpfem目录下做个修改py文件Windows目录路径分隔符的脚本

replace_wintolin_slashes.sh

#!/bin/bash

for file in *.py; do
if [ -f "$file" ]; then
sed -i 's/\///g' "$file"
fi
done

echo "Replacement of \ with / in .py files completed."

执行:replace_wintolin_slashes.sh

2.xpfem/input目录下做个遍历.DAT文件后缀大写变小写的脚本*

rename_suffix_to_lowercase.sh

#!/bin/bash

if [ $# -ne 1 ]; then
echo "Usage: $0 suffix"
exit 1
fi

suffix=$1

find . -type f -name "*.$suffix" | while read -r file; do
dir=$(dirname "$file")
base=$(basename "$file")
new_base=$(echo "$base" | sed "s/.$suffix$/.${suffix,,}/")
if [ "$base" != "$new_base" ]; then
mv "$dir/$base" "$dir/$new_base"
fi
done

echo "File renaming completed."

执行:./rename_suffix_to_lowercase.sh DAT

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.