Hello Kostas,
When I run the code with the md.add_initialized_fem_data("f", mf, density) line, it says that f is already defined
RuntimeError: (Getfem::InterfaceError) -- Error in getfem_models.cc, line 129 :
Variable f already exists
logic_error exception caught
But when I run it without the line, it says that the variable f is not defined
RuntimeError: (Getfem::InterfaceError) -- Error in getfem_generic_assembly_compile_and_exec.cc, line 5659 void getfem::ga_compile_node(getfem::pga_tree_node, getfem::ga_workspace&, getfem::ga_instruction_set&, getfem::ga_instruction_set::region_mim_instructions&, const getfem::mesh&, bool, getfem::ga_if_hierarchy&):
The finite element of variable f has to be defined on the same mesh than the integration method or interpolation used
logic_error exception caught
Right now I am trying to use the code you gave, modified for my problem.
md.add_initialized_fem_data("f", mf, density)#Line that I am adding and removing
md.add_interpolate_transformation_from_expression("V6toS3", m3, m, "f")
I_S3 = gf.asm_generic(mimS3, 0, "Interpolate(f,V6toS3)", -1, md)
The V6 6D volume is the m, mf, md objects, while the objects with S3 (or just 3, such as m3) in them are the ones on the 3D surface, named similarly to how you used them in the code example. f is solved for earlier, and density was computed with
density = md.variable('f')
, with f being the solved variable from the original 6D FEM method.
Please advise. I think I am doing something incorrectly, but I am not sure what.
Sincerely,
Eric Comstock