On Wed, 16 Nov 2016, Xinzeng Feng wrote: > I'm a new user of libMesh. I am trying to incorporate patient-specific MRI > data with a finite element model. For this purpose, I want to define a > field map with nodal values assigned based on the images. The field then > needs to be integrated to assemble the stiffness matrix. > > I've noticed that the MeshFunction class provides function-like objects for > data distributed over a mesh, which might serve the need. But I'm not sure > how to correctly use it.
I think MeshFunction is actually the converse of what you want. MeshFunction takes data on a finite element mesh and gives you an interface for data at x,y,z points. You want to take data defined at x,y,z points and assign it to finite element degrees of freedom on a mesh. For that latter problem, what you'll want to do is define your own function subclass, then pass it to System::project_solution() or System::project_vector(). We do this in several of the example codes; transient_ex1 (where we project initial conditions from an exact_value function pointer) might be the clearest. --- Roy ------------------------------------------------------------------------------ _______________________________________________ Libmesh-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/libmesh-users
