-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Material and SymbolicHandler classes
- Loading branch information
1 parent
046de86
commit 4f38983
Showing
3 changed files
with
31 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import logging | ||
|
||
import numpy as np | ||
import pytest | ||
import sympy as sym | ||
|
||
from hyper_surrogate.materials import Material | ||
|
||
|
||
@pytest.fixture | ||
def material(): | ||
return Material([]) | ||
|
||
|
||
def test_material_dummy_sef(material): | ||
assert material.sef == sym.Symbol("sef") | ||
|
||
|
||
def test_pk2_symbol(material): | ||
logging.info(material.pk2_symb) | ||
assert material.pk2_symb == material.pk2_tensor(material.sef) | ||
assert material.pk2_symb == sym.Matrix([[0, 0, 0], [0, 0, 0], [0, 0, 0]]) | ||
|
||
|
||
def test_cmat_symbol(material): | ||
assert material.cmat_symb == material.cmat_tensor(material.pk2_symb) | ||
assert material.cmat_symb == sym.ImmutableDenseNDimArray(np.zeros((3, 3, 3, 3))) |