Skip to content
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
8 changes: 4 additions & 4 deletions test/data/test_full_field_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ def test_full_field_data():
from pathlib import Path
import os
data_file = os.path.join(Path(__file__).parent, 'data_full_field.csv')
data = FullFieldData(
data_file,
FullFieldData(
data_file,
input_keys=['x', 'y', 'z', 't'],
output_keys=['u_x', 'u_y', 'u_z']
)
Expand All @@ -13,8 +13,8 @@ def test_full_field_data():
# def test_full_field_data_plot_registration():
# data_file = os.path.join(Path(__file__).parent, 'data_full_field.csv')
# data = FullFieldData(
# data_file,
# data_file,
# input_keys=['x', 'y', 'z', 't'],
# output_keys=['u_x', 'u_y', 'u_z']
# )
# data.plot_e
# data.plot_e
36 changes: 20 additions & 16 deletions test/data/test_global_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ def test_global_data():
import os
data_file = os.path.join(Path(__file__).parent, 'data_global.csv')
mesh_file = os.path.join(Path(__file__).parent, 'mesh.g')
data = GlobalData(
data_file,
GlobalData(
data_file,
times_key='t',
disp_key='u_x',
force_key='f_x',
Expand All @@ -20,8 +20,8 @@ def test_global_data():
reaction_dof='x',
n_time_steps=11
)
data = GlobalData(
data_file,
GlobalData(
data_file,
times_key='t',
disp_key='u_x',
force_key='f_x',
Expand All @@ -30,8 +30,8 @@ def test_global_data():
reaction_dof='y',
n_time_steps=11
)
data = GlobalData(
data_file,
GlobalData(
data_file,
times_key='t',
disp_key='u_x',
force_key='f_x',
Expand All @@ -49,8 +49,8 @@ def test_global_data_with_plotting():
import os
data_file = os.path.join(Path(__file__).parent, 'data_global.csv')
mesh_file = os.path.join(Path(__file__).parent, 'mesh.g')
data = GlobalData(
data_file,
GlobalData(
data_file,
times_key='t',
disp_key='u_x',
force_key='f_x',
Expand All @@ -69,8 +69,8 @@ def test_global_data_bad_reaction_dof():
data_file = os.path.join(Path(__file__).parent, 'data_global.csv')
mesh_file = os.path.join(Path(__file__).parent, 'mesh.g')
with pytest.raises(ValueError):
data = GlobalData(
data_file,
GlobalData(
data_file,
times_key='t',
disp_key='u_x',
force_key='f_x',
Expand All @@ -87,11 +87,13 @@ def test_global_data_times_not_unique_exception():
GlobalDataTimesNotUniqueException
from pathlib import Path
import os
data_file = os.path.join(Path(__file__).parent, 'data_global_not_unique.csv')
data_file = os.path.join(
Path(__file__).parent, 'data_global_not_unique.csv'
)
mesh_file = os.path.join(Path(__file__).parent, 'mesh.g')
with pytest.raises(GlobalDataTimesNotUniqueException):
data = GlobalData(
data_file,
GlobalData(
data_file,
times_key='t',
disp_key='u_x',
force_key='f_x',
Expand All @@ -108,11 +110,13 @@ def test_global_data_times_not_strictly_increasing():
GlobalDataTimesNotStrictlyIncreasingException
from pathlib import Path
import os
data_file = os.path.join(Path(__file__).parent, 'data_global_not_strictly_increasing.csv')
data_file = os.path.join(
Path(__file__).parent, 'data_global_not_strictly_increasing.csv'
)
mesh_file = os.path.join(Path(__file__).parent, 'mesh.g')
with pytest.raises(GlobalDataTimesNotStrictlyIncreasingException):
data = GlobalData(
data_file,
GlobalData(
data_file,
times_key='t',
disp_key='u_x',
force_key='f_x',
Expand Down
2 changes: 1 addition & 1 deletion test/domains/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def test_simulation_times_unique_exception():
import pytest
mesh_file = os.path.join(Path(__file__).parent, 'mesh.g')
times = jnp.array([0., 0.])

with pytest.raises(SimulationTimesNotUniqueException):
BaseDomain(mesh_file, times)

Expand Down
4 changes: 2 additions & 2 deletions test/domains/test_collocation_domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ def test_collocation_domain_3D():
import os
mesh_file = os.path.join(Path(__file__).parent, 'mesh.g')
times = jnp.linspace(0., 1.0, 2)
domain = CollocationDomain(mesh_file, times)
CollocationDomain(mesh_file, times)


def test_collocation_domain_tri3_p_order():
Expand All @@ -15,4 +15,4 @@ def test_collocation_domain_tri3_p_order():
import os
mesh_file = os.path.join(Path(__file__).parent, 'mesh_10x.g')
times = jnp.linspace(0., 1.0, 2)
domain = CollocationDomain(mesh_file, times, p_order=2)
CollocationDomain(mesh_file, times, p_order=2)
7 changes: 4 additions & 3 deletions test/domains/test_delta_pinn_domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ def test_forward_domain():
# natural_bcs = [
# ]
# physics = SolidMechanics(
# mesh_file, essential_bc_func,
# mesh_file, essential_bc_func,
# NeoHookean(), ThreeDimensional(),
# use_delta_pinn=True
# )
times = jnp.linspace(0., 1.0, 2)
# domain = DeltaPINNDomain(physics, essential_bcs, natural_bcs, mesh_file, times, 20)
domain = DeltaPINNDomain(mesh_file, times, n_eigen_values=100)
# domain = DeltaPINNDomain(
# physics, essential_bcs, natural_bcs, mesh_file, times, 20)
DeltaPINNDomain(mesh_file, times, n_eigen_values=100)
9 changes: 5 additions & 4 deletions test/domains/test_inverse_domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@


# def test_inverse_domain():
# field_data_file = os.path.join(Path(__file__).parent, 'data_full_field.csv')
# field_data_file = os.path.join(
# Path(__file__).parent, 'data_full_field.csv')
# global_data_file = os.path.join(Path(__file__).parent, 'data_global.csv')
# mesh_file = os.path.join(Path(__file__).parent, 'mesh.g')
# essential_bc_func = lambda x, t, z: z
Expand All @@ -22,16 +23,16 @@
# natural_bcs = [
# ]
# physics = SolidMechanics(
# mesh_file, essential_bc_func,
# mesh_file, essential_bc_func,
# NeoHookean(), ThreeDimensional()
# )
# full_field_data = FullFieldData(
# field_data_file,
# field_data_file,
# input_keys=['x', 'y', 'z', 't'],
# output_keys=['u_x', 'u_y', 'u_z']
# )
# global_data = GlobalData(
# global_data_file,
# global_data_file,
# times_key='t',
# disp_key='u_x',
# force_key='f_x',
Expand Down
4 changes: 2 additions & 2 deletions test/domains/test_variational_domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ def test_forward_domain():
import os
mesh_file = os.path.join(Path(__file__).parent, 'mesh.g')
times = jnp.linspace(0., 1.0, 2)
domain = VariationalDomain(mesh_file, times)
VariationalDomain(mesh_file, times)


def test_forward_domain_tri3_p_order():
Expand All @@ -15,4 +15,4 @@ def test_forward_domain_tri3_p_order():
import os
mesh_file = os.path.join(Path(__file__).parent, 'mesh_10x.g')
times = jnp.linspace(0., 1.0, 2)
domain = VariationalDomain(mesh_file, times, p_order=2)
VariationalDomain(mesh_file, times, p_order=2)
Loading
Loading