You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I tried to compute the norm of a vector valued FemField, the discretize function generates a file, that is not executable. Here an example where I define a spline approximated torus mapping. The TorusCallableMapping class is defined via the BasicCallableMapping interface as follows:
class TorusCallableMapping(BasicCallableMapping):
def __init__(self, R0: float) -> None:
super().__init__()
self._R0 = R0
def __call__(self, *eta):
""" Evaluate mapping at location eta. """
x = self._R0 + eta[0] * np.cos(eta[1]) * np.cos(eta[2])
y = self._R0 + eta[0] * np.cos(eta[1]) * np.sin(eta[2])
z = self._R0 + eta[0] * np.sin(eta[1])
return (x,y,z)
def jacobian(self, *eta):
""" Compute Jacobian matrix at location eta. """
raise NotImplementedError
def jacobian_inv(self, *eta):
""" Compute inverse Jacobian matrix at location eta.
An exception should be raised if the matrix is singular.
"""
raise NotImplementedError
def metric(self, *eta):
""" Compute components of metric tensor at location eta. """
raise NotImplementedError
def metric_det(self, *eta):
""" Compute determinant of metric tensor at location eta. """
raise NotImplementedError
@property
def ldim(self):
""" Number of logical/parametric dimensions in mapping
(= number of eta components).
"""
return 3
@property
def pdim(self):
""" Number of physical dimensions in mapping
(= number of x components).
"""
return 3
Then in the following code, we define the domain, spaces and try to compute the norm of B_h:
Traceback (most recent call last):
File "isolatebug_normB.py", line 137, in <module>
isolate_bug()
File "isolatebug_normB.py", line 133, in isolate_bug
l2_norm_B = l2_norm_B_discrete.assemble(B=B_h)
File "/home/alex/repos/psydac/psydac/api/fem.py", line 1558, in assemble
v = self._func(*args)
File "/home/alex/repos/psydac/psydac/api/tests/__psydac__/dependencies_qxx3hnq7.py", line 152, in assemble_scalar_qxx3hnq7
x = arr_x[i_quad_1,i_quad_2,i_quad_3]
NameError: name 'arr_x' is not defined
The text was updated successfully, but these errors were encountered:
When I tried to compute the norm of a vector valued
FemField
, thediscretize
function generates a file, that is not executable. Here an example where I define a spline approximated torus mapping. TheTorusCallableMapping
class is defined via theBasicCallableMapping
interface as follows:Then in the following code, we define the domain, spaces and try to compute the norm of
B_h
:I get the following traceback:
The text was updated successfully, but these errors were encountered: