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

Fix formula and refine err hint #362

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions ppsci/equation/pde/linear_elasticity.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ class LinearElasticity(base.PDE):
stress\_disp_{xx} = \lambda(\dfrac{\partial u}{\partial x} + \dfrac{\partial v}{\partial y} + \dfrac{\partial w}{\partial z}) + 2\mu \dfrac{\partial u}{\partial x} - \sigma_{xx} \\
stress\_disp_{yy} = \lambda(\dfrac{\partial u}{\partial x} + \dfrac{\partial v}{\partial y} + \dfrac{\partial w}{\partial z}) + 2\mu \dfrac{\partial v}{\partial y} - \sigma_{yy} \\
stress\_disp_{zz} = \lambda(\dfrac{\partial u}{\partial x} + \dfrac{\partial v}{\partial y} + \dfrac{\partial w}{\partial z}) + 2\mu \dfrac{\partial w}{\partial z} - \sigma_{zz} \\
traction_{x} = \mathbf{n}_x \sigma_{xx} + \mathbf{n}_y \sigma_{xy} + \mathbf{n}_z \sigma_{xz} \\
traction_{y} = \mathbf{n}_y \sigma_{yx} + \mathbf{n}_y \sigma_{yy} + \mathbf{n}_z \sigma_{yz} \\
traction_{z} = \mathbf{n}_z \sigma_{zx} + \mathbf{n}_y \sigma_{zy} + \mathbf{n}_z \sigma_{zz} \\
traction_{x} = n_x \sigma_{xx} + n_y \sigma_{xy} + n_z \sigma_{xz} \\
traction_{y} = n_y \sigma_{yx} + n_y \sigma_{yy} + n_z \sigma_{yz} \\
traction_{z} = n_z \sigma_{zx} + n_y \sigma_{zy} + n_z \sigma_{zz} \\
navier_{x} = \rho(\dfrac{\partial^2 u}{\partial t}) - (\lambda + \mu)(\dfrac{\partial^2 u}{\partial x^2}+\dfrac{\partial^2 v}{\partial y \partial x} + \dfrac{\partial^2 w}{\partial z \partial x}) - \mu(\dfrac{\partial^2 u}{\partial x^2} + \dfrac{\partial^2 u}{\partial y^2} + \dfrac{\partial^2 u}{\partial z^2}) \\
navier_{y} = \rho(\dfrac{\partial^2 v}{\partial t}) - (\lambda + \mu)(\dfrac{\partial^2 v}{\partial x \partial y}+\dfrac{\partial^2 v}{\partial y^2} + \dfrac{\partial^2 w}{\partial z \partial y}) - \mu(\dfrac{\partial^2 v}{\partial x^2} + \dfrac{\partial^2 v}{\partial y^2} + \dfrac{\partial^2 v}{\partial z^2}) \\
navier_{z} = \rho(\dfrac{\partial^2 w}{\partial t}) - (\lambda + \mu)(\dfrac{\partial^2 w}{\partial x \partial z}+\dfrac{\partial^2 v}{\partial y \partial z} + \dfrac{\partial^2 w}{\partial z^2}) - \mu(\dfrac{\partial^2 w}{\partial x^2} + \dfrac{\partial^2 w}{\partial y^2} + \dfrac{\partial^2 w}{\partial z^2}) \\
Expand Down
18 changes: 9 additions & 9 deletions ppsci/geometry/mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class Mesh(geometry.Geometry):
def __init__(self, mesh: Union["pymesh.Mesh", str]):
# check if pymesh is installed when using Mesh Class
if not checker.dynamic_import_to_globals(["pymesh"]):
raise ModuleNotFoundError
raise ModuleNotFoundError("Please install pymesh first.")
import pymesh

if isinstance(mesh, str):
Expand All @@ -63,7 +63,7 @@ def init_mesh(self):
self.face_area = self.py_mesh.get_attribute("face_area").reshape([-1])

if not checker.dynamic_import_to_globals(["open3d"]):
raise ModuleNotFoundError
raise ModuleNotFoundError("Please install open3d first.")
import open3d

self.open3d_mesh = open3d.geometry.TriangleMesh(
Expand All @@ -87,7 +87,7 @@ def init_mesh(self):
self.num_faces = self.py_mesh.num_faces

if not checker.dynamic_import_to_globals(["pysdf"]):
raise ModuleNotFoundError
raise ModuleNotFoundError("Please install pysdf first.")
import pysdf

self.pysdf = pysdf.SDF(self.vertices, self.faces)
Expand All @@ -114,7 +114,7 @@ def sdf_func(self, points: np.ndarray) -> np.ndarray:
the result of this function.
"""
if not checker.dynamic_import_to_globals(["pymesh"]):
raise ModuleNotFoundError
raise ModuleNotFoundError("Please install pymesh first.")
import pymesh

sdf, _, _, _ = pymesh.signed_distance_to_mesh(self.py_mesh, points)
Expand All @@ -133,7 +133,7 @@ def translate(self, translation, relative=True):
faces = np.array(self.faces)

if not checker.dynamic_import_to_globals(("open3d", "pymesh")):
raise ModuleNotFoundError
raise ModuleNotFoundError("Please install open3d and pymesh first.")
import open3d
import pymesh

Expand All @@ -153,7 +153,7 @@ def scale(self, scale, center=(0, 0, 0)):
faces = np.array(self.faces, dtype=paddle.get_default_dtype())

if not checker.dynamic_import_to_globals(("open3d", "pymesh")):
raise ModuleNotFoundError
raise ModuleNotFoundError("Please install open3d and pymesh first.")
import open3d
import pymesh

Expand Down Expand Up @@ -374,7 +374,7 @@ def sample_interior(self, n, random="pseudo", criteria=None, evenly=False):

def union(self, other: "Mesh"):
if not checker.dynamic_import_to_globals(["pymesh"]):
raise ModuleNotFoundError
raise ModuleNotFoundError("Please install pymesh first.")
import pymesh

csg = pymesh.CSGTree(
Expand All @@ -390,7 +390,7 @@ def __add__(self, other: "Mesh"):

def difference(self, other: "Mesh"):
if not checker.dynamic_import_to_globals(["pymesh"]):
raise ModuleNotFoundError
raise ModuleNotFoundError("Please install pymesh first.")
import pymesh

csg = pymesh.CSGTree(
Expand All @@ -403,7 +403,7 @@ def __sub__(self, other: "Mesh"):

def intersection(self, other: "Mesh"):
if not checker.dynamic_import_to_globals(["pymesh"]):
raise ModuleNotFoundError
raise ModuleNotFoundError("Please install pymesh first.")
import pymesh

csg = pymesh.CSGTree(
Expand Down