Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the Torch module update #701

Merged
merged 6 commits into from
May 24, 2024
Merged

the Torch module update #701

merged 6 commits into from
May 24, 2024

Conversation

AlbertZyy
Copy link
Collaborator

@AlbertZyy AlbertZyy commented May 22, 2024

fem.Integrators

Update

  • 简化了 typehint
  • 将 linear 和 bilinear 类型的数值积分计算,以及对 coef 形状的处理,封装为单独的函数,大幅减少积分子之间的代码重复。

New

  • 加入可选的缓存机制,避免某些不变的积分在迭代中的重复计算。机制在启用后由模块自动完成,不改变用户的使用方式。
  • 加入对批次数据的支持。现在 coef 和 source 可以接受第 0 个轴作为 batch 轴,输出最后一个轴是 batch 的张量。

fem.LinearForm & fem.BilinearForm

Update

  • 修复了在没有添加任何 domain integrator 时(但是有 boundary integrator),assembly() 会出错的问题。现在即使未添加任何积分子,组装器仍可以输出一个空的(全零)稀疏张量。
  • 在 LinearForm 的 assembly 方法中加入了 return_dense 参数并默认为 True

New

  • 加入对批次数据的支持(参数 batch_size),输出最后一个轴是 batch 的稀疏张量。

fem.DirichletBC

New

  • 加入对批次右端向量的支持,此处自动适应。要求 batch dimension 在最后一个轴。

@weihuayi weihuayi merged commit 64d2c22 into weihuayi:master May 24, 2024
0 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants