Rename nabla -> laplacian
This commit is contained in:
committed by
Nicola Demo
parent
92e0e4920b
commit
6c627c70e3
@@ -1,5 +1,5 @@
|
||||
from pina.equation import Equation
|
||||
from pina.operators import grad, nabla
|
||||
from pina.operators import grad, laplacian
|
||||
from pina import LabelTensor
|
||||
import torch
|
||||
import pytest
|
||||
@@ -13,8 +13,8 @@ def eq1(input_, output_):
|
||||
def eq2(input_, output_):
|
||||
force_term = (torch.sin(input_.extract(['x'])*torch.pi) *
|
||||
torch.sin(input_.extract(['y'])*torch.pi))
|
||||
nabla_u = nabla(output_.extract(['u1']), input_)
|
||||
return nabla_u - force_term
|
||||
delta_u = laplacian(output_.extract(['u1']), input_)
|
||||
return delta_u - force_term
|
||||
|
||||
def foo():
|
||||
pass
|
||||
@@ -40,4 +40,4 @@ def test_residual():
|
||||
eq_2_res = eq_2.residual(pts, u)
|
||||
|
||||
assert eq_1_res.shape == torch.Size([10, 2])
|
||||
assert eq_2_res.shape == torch.Size([10, 1])
|
||||
assert eq_2_res.shape == torch.Size([10, 1])
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from pina.equation import SystemEquation
|
||||
from pina.operators import grad, nabla
|
||||
from pina.operators import grad, laplacian
|
||||
from pina import LabelTensor
|
||||
import torch
|
||||
import pytest
|
||||
@@ -13,8 +13,8 @@ def eq1(input_, output_):
|
||||
def eq2(input_, output_):
|
||||
force_term = (torch.sin(input_.extract(['x'])*torch.pi) *
|
||||
torch.sin(input_.extract(['y'])*torch.pi))
|
||||
nabla_u = nabla(output_.extract(['u1']), input_)
|
||||
return nabla_u - force_term
|
||||
delta_u = laplacian(output_.extract(['u1']), input_)
|
||||
return delta_u - force_term
|
||||
|
||||
def foo():
|
||||
pass
|
||||
@@ -44,4 +44,4 @@ def test_residual():
|
||||
|
||||
eq_1 = SystemEquation([eq1, eq2], reduction='none')
|
||||
res = eq_1.residual(pts, u)
|
||||
assert res.shape == torch.Size([10, 3])
|
||||
assert res.shape == torch.Size([10, 3])
|
||||
|
||||
Reference in New Issue
Block a user