Error after using Expression to insert initial conditions


134
views
0
6 months ago by
Hello everyone, I hope someone can find what's going wrong...I have already tried to re-install fenics on anaconda. I am using it on jupiter at the moment.

Let me know, thank you!

Code:

#Initial conditions
#g1 = Expression('A+B+pow(10,-3)*exp(-100*pow((x[0]-1/3),2)-100*pow((x[1]-1/2),2))', A=A,B=B, degree=1)
#g2 = Expression('B/pow(A+B,2)', A=A,B=B, degree=1)
u_0 = Expression('A+B+pow(10,-3)*exp(-100*pow((x[0]-1/3),2)-100*pow((x[1]-1/2),2))','B/pow(A+B,2)',A=A,B=B, degree=1)
u_n = interpolate(u_0,V)

Error:

---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
<ipython-input-6-f0af4734db8a> in <module>()
40 #g1 = Expression('A+B+pow(10,-3)*exp(-100*pow((x[0]-1/3),2)-100*pow((x[1]-1/2),2))', A=A,B=B, degree=1)
41 #g2 = Expression('B/pow(A+B,2)', A=A,B=B, degree=1)
---> 42 u_0 = Expression('A+B+pow(10,-3)*exp(-100*pow((x[0]-1/3),2)-100*pow((x[1]-1/2),2))','B/pow(A+B,2)',A=A,B=B, degree=1)
43 u_n = interpolate(u_0,V)
44

~/anaconda3/envs/fenicsproject/lib/python3.6/site-packages/dolfin/functions/expression.py in __new__(cls, cppcode, *args, **kwargs)
677 [generic_function_members],
678 [mesh_function_members],
--> 679 mpi_comm=kwargs.get("mpi_comm"))
680 cpp_base, members = cpp_base[0], members[0]
681

~/anaconda3/envs/fenicsproject/lib/python3.6/site-packages/dolfin/compilemodules/expressions.py in compile_expressions(cppargs, generic_function_members, mesh_function_members, mpi_comm)
264 "\n\n".join(code_snippets), classnames,
265 additional_declarations="\n".join(additional_declarations),
--> 266 mpi_comm=mpi_comm)
267
268 return expression_classes, all_members

~/anaconda3/envs/fenicsproject/lib/python3.6/site-packages/dolfin/compilemodules/expressions.py in compile_expression_code(code, classnames, module_name, additional_declarations, mpi_comm)
181 compiled_module = compile_extension_module(
182 code, additional_declarations=additional_declarations,
--> 183 mpi_comm=mpi_comm)
184
185 # Get the compiled class

~/anaconda3/envs/fenicsproject/lib/python3.6/site-packages/dolfin/compilemodules/jit.py in mpi_jit(*args, **kwargs)
68 # Just call JIT compiler when running in serial
69 if MPI.size(mpi_comm) == 1:
---> 70 return local_jit(*args, **kwargs)
71
72 # Default status (0 == ok, 1 == fail)

~/anaconda3/envs/fenicsproject/lib/python3.6/site-packages/dolfin/compilemodules/compilemodule.py in compile_extension_module(code, module_name, additional_declarations, additional_system_headers, mpi_comm, **instant_kwargs)
601 code=code,
602 additional_declarations=additional_declarations,
--> 603 **instant_kwargs)
604
605 sys.stdout.flush()

~/anaconda3/envs/fenicsproject/lib/python3.6/site-packages/instant/build.py in build_module(modulename, source_directory, code, init_code, additional_definitions, additional_declarations, sources, wrap_headers, local_headers, system_headers, include_dirs, library_dirs, libraries, swigargs, swig_include_dirs, cppargs, lddargs, object_files, arrays, generate_interface, generate_setup, cmake_packages, signature, cache_dir)
575 # Recompile if necessary
576 recompile(modulename, module_path, new_compilation_checksum,
--> 577 build_system)
578
579 # --- Load, cache, and return module

~/anaconda3/envs/fenicsproject/lib/python3.6/site-packages/instant/build.py in recompile(modulename, module_path, new_compilation_checksum, build_system)
149 #cmd = "cmake .";
150 instant_debug("cmd = %s" % cmd)
--> 151 ret, output = get_status_output(cmd)
152 write_file(compile_log_filename, output)
153 if ret != 0:

~/anaconda3/envs/fenicsproject/lib/python3.6/site-packages/instant/output.py in get_status_output(cmd, input, cwd, env)
150 # http://www.openfabrics.org/downloads/OFED/release_notes/OFED_3.12_rc1_release_notes#3.03
151 pipe = subprocess.Popen(cmd, shell=False, cwd=cwd, env=env, stdout=subprocess.PIPE,
--> 152 stderr=subprocess.STDOUT)
153
154 (output, errout) = pipe.communicate(input=input)

~/anaconda3/envs/fenicsproject/lib/python3.6/subprocess.py in __init__(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds, encoding, errors)
707 c2pread, c2pwrite,
708 errread, errwrite,
--> 709 restore_signals, start_new_session)
710 except:
711 # Cleanup if the child failed starting.

~/anaconda3/envs/fenicsproject/lib/python3.6/subprocess.py in _execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, restore_signals, start_new_session)
1342 if errno_num == errno.ENOENT:
1343 err_msg += ': ' + repr(err_filename)
-> 1344 raise child_exception_type(errno_num, err_msg, err_filename)
1345 raise child_exception_type(err_msg)
1346

FileNotFoundError: [Errno 2] No such file or directory: 'cmake': 'cmake'
Community: FEniCS Project
Please login to add an answer/comment or follow this question.

Similar posts:
Search »