Basically, referring the hyper-elasticity example, I wanna add a body force B which is a 2D vector in the 2d domain. Its components depend on the displacement. For example, let's say
body force
B = [bx, by]
bx = 1/(x+ux)
by = 1/(x+uy)
In the python code, I write
Define functions
V = VectorFunctionSpace(mesh, "Lagrange", 1)
du = TrialFunction(V) # Incremental displacement
v = TestFunction(V) # Test function
u = Function(V) # Displacement from previous iteration
...
def B(u):
return Expression(("1/(x[0]+u[0])","1/(x[1]+u[1])"))
...
# Total potential energy
Pi = psi*dx - dot(B(u), u)*dx - dot(T, u)*ds
and I get the error, which says the way of defining the body force B is not correct:
In instant.recompile: The module did not compile with command 'make VERBOSE=1', see '/home/abc/.instant/error/dolfin_compile_code_87e04d513466c00e045d483572e6d4f47c45a4a0/compile.log'
Traceback (most recent call last):
File "hyper_elast.py", line 95, in
Pi = psidx - dot(B(u), u)dx - dot(T, u)ds
File "hyper_elast.py", line 83, in B
return Expression(("1/(x[0]+u[0])","1/(x1+u1)"))
File "/usr/lib/python2.7/dist-packages/dolfin/functions/expression.py", line 602, in new
mpi_comm=mpi_comm)
File "/usr/lib/python2.7/dist-packages/dolfin/compilemodules/expressions.py", line 217, in compile_expressions
mpi_comm=mpi_comm)
File "/usr/lib/python2.7/dist-packages/dolfin/compilemodules/expressions.py", line 145, in compile_expression_code
mpi_comm=mpi_comm)
File "/usr/lib/python2.7/dist-packages/dolfin/compilemodules/jit.py", line 64, in mpi_jit
return local_jit(args, **kwargs)
File "/usr/lib/python2.7/dist-packages/dolfin/compilemodules/compilemodule.py", line 458, in compile_extension_module
**instant_kwargs)
File "/usr/lib/python2.7/dist-packages/instant/build.py", line 563, in build_module
recompile(modulename, module_path, new_compilation_checksum, build_system)
File "/usr/lib/python2.7/dist-packages/instant/build.py", line 165, in recompile
instant_error(msg % (cmd, compile_log_filename_dest))
File "/usr/lib/python2.7/dist-packages/instant/output.py", line 85, in instant_error
raise RuntimeError(text)
RuntimeError: In instant.recompile: The module did not compile with command 'make VERBOSE=1', see '/home/abc/.instant/error/dolfin_compile_code_87e04d513466c00e045d483572e6d4f47c45a4a0/compile.log'
Any one can help me with this? Thank you a lot.