Tue Apr 28 15:55:28 2020 expression_test: FENICS/Python version Demonstrate the FEniCS "Expression()" function. expression_test1: Request the type of the expression object: type ( f_expr ) = The print command does not return the definition string. print ( f_expr ) = f_0 Choose a single argument for the function: x = (0.4, 0.24) Evaluate the function: f_expr ( x ) = 0.9491798235084412 Saving graphics in "expression_test1.png" Define g_expr = Expression ( "pow ( x[0], POWER )", POWER = 2, ... ) x = 3.0 g_expr ( x ) = 9.0 Now reset g_expr.POWER = 3 g_expr ( x ) = 27.0 Define h_expr = Expression ( ( "sin(pi*x[0])", "cos(pi*x[0])" ), degree = 10 ) h_expr ( x ) = [0.8660254 0.5 ] expression_test2: Use Expression() in a finite element calculation. Calling FFC just-in-time (JIT) compiler, this may take some time. Calling FFC just-in-time (JIT) compiler, this may take some time. Calling FFC just-in-time (JIT) compiler, this may take some time. Calling FFC just-in-time (JIT) compiler, this may take some time. Calling FFC just-in-time (JIT) compiler, this may take some time. Calling FFC just-in-time (JIT) compiler, this may take some time. error_L2 = 0.019557274328664588 error_max = 2.220446049250313e-15 expression_test3: Use subclassing to set up an expression that is too complicated for a one-line definition. x = (0.4, 0.24) k_expr ( x ) = f_52 Calling FFC just-in-time (JIT) compiler, this may take some time. Calling FFC just-in-time (JIT) compiler, this may take some time. Graphics saved as "expression_test3.png" expression_test: Normal end of execution. Tue Apr 28 15:55:39 2020