Coder Social home page Coder Social logo

meshtaichi's People

Contributors

billxu2000 avatar eydcao avatar g1n0st 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

meshtaichi's Issues

installed a restricted version of taichi and examples not working

I am using a Linux subsystem (in windows). I cloned the repo and trying to run the examples. I get this warning and the example does not show

[Taichi] version 1.5.0, llvm 16.0.0git, commit 7b885c28, linux, python 3.8.10 You have installed a restricted version of taichi, certain features (e.g. Vulkan & GGUI) will not work. You can suppress this warning by setting the environment variable TI_MANYLINUX2014_OK=1. [Taichi] Starting on arch=x64 Traceback (most recent call last): File "ms.py", line 100, in <module> window = ti.ui.Window("Mass Spring", (1024, 768)) File "/home/monem/py38/lib/python3.8/site-packages/taichi/ui/window.py", line 37, in __init__ check_ggui_availability() File "/home/monem/py38/lib/python3.8/site-packages/taichi/ui/utils.py", line 80, in check_ggui_availability raise GGUINotAvailableException( taichi.ui.utils.GGUINotAvailableException: GGUI is not available since you have installed a restricted version of taichi. Please see yellow warning messages printed during startup for details.

I have tested the example on a different Linux machine and it works just fine. what does a restricted version mean, and how to fix this so that I can use a normal full version?

[Module Init] No meshtaichi_patcher

Dear Chang,

I am trying to run examples on a Linux machine (Ubuntu 22.04 with ti 1.5) and receives below errors. Any hint? Or I can help provide more information related to the system.

Best,

(vt) ➜  meshtaichi git:(main) ✗ python mass_spring/ms.py
[Taichi] version 1.5.0, llvm 15.0.4, commit 7b885c28, linux, python 3.10.9
Traceback (most recent call last):
  File "/home/yadi/Work/meshtaichi/mass_spring/ms.py", line 2, in <module>
    import meshtaichi_patcher as Patcher
ModuleNotFoundError: No module named 'meshtaichi_patcher'
(vt) ➜  meshtaichi git:(main) ✗ 

[Func] global index based get for a Member field

Dear Chang,

I am writing to request your assistance in addressing an issue. Specifically, I am trying to use global indices to access a certain element. Unfortunately, currently, the mesh object does not currently support global access to a MemberField by an index.

One example is that I would like to use an integer to indicate in which tetrahedron a particle lies inside. Then, once I have identified the tetrahedron, I can use its relationship with vertices to perform additional operations. Here is an example code:

for p in particle_pos:
    # find which tetra this p lies in, and re-use this index intensively later to avoid re-search
    tetra_id = 1000  # 1000 is just an example
    tetra = mesh.cells[tetra_id]  # this currently triggers an AttributeError: 'MeshElementField' object has no attribute '__getitem__'
    for v in tetra.verts:
        # perform some other operation

I am wondering if it is difficult to implement global access to a MemberField by an index, or if this feature is simply obsolete. If it is obsolete, I would greatly appreciate any advice you can offer on how to work around this issue.

Thank you for your time and assistance.

Sincerely,
Yadi

how to load custom mesh

Hi - how can I load my own mesh created in Rhino3d?

I've tried PLY, STL, and OBJ but have not been able to get it to work.

Problem of running the examples code

Dear meshtaichi developer:

Thanks for the development. However, when I tried to run the example code, e.g. the ms.py in /mass_spring folder, it gave me the error like below:

taichi.lang.exception.TaichiCompilationError:` 
File "ms.py", line 43, in vv_substep:
        for v1 in v0.verts:
        ^^^^^^^^^^^^^^^^^^^
Traceback (most recent call last):
  File "/home/haoyin/anaconda3/envs/residual_physics_haoyin/lib/python3.8/site-packages/taichi/lang/ast/ast_transformer_utils.py", line 27, in __call__
    return method(ctx, node)
  File "/home/haoyin/anaconda3/envs/residual_physics_haoyin/lib/python3.8/site-packages/taichi/lang/ast/ast_transformer.py", line 1521, in build_For
    return ASTTransformer.build_nested_mesh_for(ctx, node)
  File "/home/haoyin/anaconda3/envs/residual_physics_haoyin/lib/python3.8/site-packages/taichi/lang/ast/ast_transformer.py", line 1464, in build_nested_mesh_for
    entry_expr = _ti_core.get_relation_access(
TypeError: get_relation_access(): incompatible function arguments. The following argument types are supported:
    1. (arg0: taichi::lang::mesh::MeshPtr, arg1: taichi._lib.core.taichi_python.Expr, arg2: taichi::lang::mesh::MeshElementType, arg3: taichi._lib.core.taichi_python.Expr, arg4: taichi._lib.core.taichi_python.DebugInfo) -> taichi._lib.core.taichi_python.Expr

Invoked with: <taichi._lib.core.taichi_python.MeshPtr object at 0x7f2cdc114bb0>, <taichi._lib.core.taichi_python.Expr object at 0x7f2cd3b295b0>, <MeshElementType.Vertex: 0>, <taichi._lib.core.taichi_python.Expr object at 0x7f2cd3ba4ef0>

Also, when I tried to run the vertex_normal/normal.py script, it gave me the error like:

[Taichi] version 1.7.0, llvm 15.0.4, commit 2fd24490, linux, python 3.8.3
[Taichi] Starting on arch=cuda
[E 01/24/24 22:08:23.752 197140] [scalarize.cpp:scalarize_store_stmt@56] Assertion failure: stmt->val->template is<MatrixInitStmt>()


terminate called after throwing an instance of 'std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >'
Aborted (core dumped)

I am using [Taichi] version 1.7.0, llvm 15.0.4, commit 2fd24490, linux, python 3.8.3
It seems there are some issue of the code. Could you take a look at that? Thanks!

[error]CUDA_ERROR_ILLEGAL_ADDRESS when running the mpm_lag example

Hi,
When I run the mpm_lag case, I come across the CUDA_ERROR_ILLEGAL_ADDRESS.

The only modification is in the run.py, where I drop the initial transform of the model.

image

But if I recover the transform, everything is OK.

Here is my source file which can reproduce the BUG:

meshtaichi.zip

Initially(before doing the MPM computation), the program is OK. And I can see the imported mesh. But it crashes after I press SPACE(run simulation).

My totoal GPU memory is 6GB, and I allocate 4GB initially.

taichi Version:1.4.1
platform: win-10

error log

c:\Users\GRBJ200045\Desktop\meshtaichi\lag_mpm\mpm.py:82: DeprecationWarning: Calling builtin function "max" in Taichi scope is deprecated. Please use "ti.max" instead.
  v_max = max(v_max, abs(v[i]))       
[E 02/13/23 14:54:41.104 23328] [taichi/rhi/cuda/cuda_driver.h:taichi::lang::CUDADriverFunction<void * *,char const *,unsigned int,unsigned int *,void * *>::operator ()@88] CUDA Error CUDA_ERROR_ILLEGAL_ADDRESS: an illegal memory access was encountered while calling module_load_data_ex (cuModuleLoadDataEx)


Traceback (most recent call last):    
  File "c:\Users\GRBJ200045\Desktop\meshtaichi\lag_mpm\run.py", line 92, in 
<module>
    solve(1, fems)
  File "c:\Users\GRBJ200045\Desktop\meshtaichi\lag_mpm\mpm.py", line 127, in solve
    fems[i].f.fill(0.0)
  File "C:\Users\GRBJ200045\AppData\Roaming\Python\Python310\site-packages\taichi\lang\matrix.py", line 1272, in fill
    field_fill_python_scope(self, val)  File "C:\Users\GRBJ200045\AppData\Roaming\Python\Python310\site-packages\taichi\lang\kernel_impl.py", line 974, 
in wrapped
    return primal(*args, **kwargs)    
  File "C:\Users\GRBJ200045\AppData\Roaming\Python\Python310\site-packages\taichi\lang\kernel_impl.py", line 901, 
in __call__
    return self.runtime.compiled_functions[key](*args)
  File "C:\Users\GRBJ200045\AppData\Roaming\Python\Python310\site-packages\taichi\lang\kernel_impl.py", line 826, 
in func__
    raise e from None
  File "C:\Users\GRBJ200045\AppData\Roaming\Python\Python310\site-packages\taichi\lang\kernel_impl.py", line 823, 
in func__
    t_kernel(launch_ctx)
RuntimeError: [taichi/rhi/cuda/cuda_driver.h:taichi::lang::CUDADriverFunction<void * *,char const *,unsigned int,unsigned int 
*,void * *>::operator ()@88] CUDA Error CUDA_ERROR_ILLEGAL_ADDRESS: an illegal memory access was encountered while calling module_load_data_ex (cuModuleLoadDataEx)
GLFW Error 65537: The GLFW library is not initialized
[E 02/13/23 14:54:41.214 23328] [taichi/rhi/cuda/cuda_driver.h:taichi::lang::CUDADriverFunction<void *>::operator ()@88] CUDA 
Error CUDA_ERROR_ILLEGAL_ADDRESS: an illegal memory access was 
encountered while calling stream_synchronize (cuStreamSynchronize)

Error in the lag_mpm demo when running the run.py no files in the result/particles or result/armadillo

H:\taichi\meshtaichi-main\lag_mpm\utils.py:32: UserWarning: Calling non-taichi function "len". Scope inside the function is not processed by the Taichi AST transformer. The function may not work as expected. Proceed with caution! Maybe you can consider turning it into a @ti.func?
r_s = min(int(x * (len(palette) - 1)), len(palette) - 2)
H:\taichi\meshtaichi-main\lag_mpm\utils.py:32: UserWarning: Calling non-taichi function "len". Scope inside the function is not processed by the Taichi AST transformer. The function may not work as expected. Proceed with caution! Maybe you can consider turning it into a @ti.func?
r_s = min(int(x * (len(palette) - 1)), len(palette) - 2)
H:\taichi\meshtaichi-main\lag_mpm\utils.py:34: UserWarning: Calling non-taichi function "len". Scope inside the function is not processed by the Taichi AST transformer. The function may not work as expected. Proceed with caution! Maybe you can consider turning it into a @ti.func?
val = x * (len(palette) - 1) - r_s
[I 10/28/22 11:58:45.937 8076] [C:/Users/Administrator/actions-runner/_work/taichi/taichi/taichi/rhi/vulkan/vulkan_device_creator.cpp:pick_physical_device@394] Found Vulkan Device 0 (NVIDIA GeForce RTX 3060)
[I 10/28/22 11:58:45.937 8076] [C:/Users/Administrator/actions-runner/_work/taichi/taichi/taichi/rhi/vulkan/vulkan_device_creator.cpp:create_logical_device@462] Vulkan Device "NVIDIA GeForce RTX 3060" supports Vulkan 0 version 1.2.186
frame: 0
substep: 0
[W 10/28/22 11:58:51.867 15460] [C:/Users/Administrator/actions-runner/_work/taichi/taichi/taichi/transforms/type_check.cpp:visit@161] [$14513] Field index 0 not int32, casting into int32 implicitly

[W 10/28/22 11:58:51.867 15460] [C:/Users/Administrator/actions-runner/_work/taichi/taichi/taichi/transforms/type_check.cpp:visit@161] [$14515] Field index 0 not int32, casting into int32 implicitly

[W 10/28/22 11:58:51.867 15460] [C:/Users/Administrator/actions-runner/_work/taichi/taichi/taichi/transforms/type_check.cpp:visit@161] [$14543] Field index 0 not int32, casting into int32 implicitly

[W 10/28/22 11:58:51.867 15460] [C:/Users/Administrator/actions-runner/_work/taichi/taichi/taichi/transforms/type_check.cpp:visit@161] [$14571] Field index 0 not int32, casting into int32 implicitly

[W 10/28/22 11:58:51.867 15460] [C:/Users/Administrator/actions-runner/_work/taichi/taichi/taichi/transforms/type_check.cpp:visit@161] [$14728] Field index 0 not int32, casting into int32 implicitly

[W 10/28/22 11:58:51.867 15460] [C:/Users/Administrator/actions-runner/_work/taichi/taichi/taichi/transforms/type_check.cpp:visit@161] [$14736] Field index 0 not int32, casting into int32 implicitly

[W 10/28/22 11:58:51.867 15460] [C:/Users/Administrator/actions-runner/_work/taichi/taichi/taichi/transforms/type_check.cpp:visit@161] [$14744] Field index 0 not int32, casting into int32 implicitly

MeshTaichi Fails when reading .mesh file generated by meshio

This is my code. The program read an .inp file generated by Abaqus, and then transform the mesh into .mesh format. But when load the mesh by Patcher, it failed.

`
import taichi as ti
import meshtaichi_patcher as Patcher
import meshio

ti.init(arch=ti.cpu,kernel_profiler=True)

if name == 'main':
mesh = meshio.read("Job-1.inp")
mesh.write("LBeam.mesh")
# print(mesh.points)
# print(mesh.cells)
# print(mesh.cells_dict)
mesh = meshio.read("LBeam.mesh")
mesh = Patcher.load_mesh("LBeam.mesh", relations=["CV"])
`

Here is the error

screenshot

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.