My plan is to use FEniCS to generate a mesh and solution as input to another visualization system. Specifically, I'm solving an electrostatics problem and visualizing charged particles moving through it. My visualization system uses Java, as it is targeting Android.
Below are a number of specfic questions, but I'm also looking for guidance on some best practices for consuming FEniCS output in other systems. I've done some searching, but mostly find folks wanting to visualize the field values at, say, mesh points. However, I need to evaluate the function at any arbitrary point within the domain.
I've already written a simple java consumer of the FEniCS mesh XML file. I'm now tackling how to get the solution values into the visualization, with enough info to evaluate it at arbitrary points within the domain.
I'm beginning to realize that I need not only the "dof values" emitted by writing the function to an XML file, but also the dofmap and the function space's base finite element.
When I write the function to an XML file, e.g.
<dolfin xmlns:dolfin="http://fenicsproject.org">
<function_data size="4">
<dof index="0" value="1" cell_index="1" cell_dof_index="2" />
<dof index="1" value="2" cell_index="0" cell_dof_index="1" />
<dof index="2" value="3" cell_index="0" cell_dof_index="2" />
<dof index="3" value="4" cell_index="0" cell_dof_index="0" />
</function_data>
</dolfin>
I can certainly see the dof values, but I don't see any indication of what is the function space. Is there a standard way to dump that information, e.g. dofmap and finite element?
If not, I can certainly write out the dofmap myself and consume it, since it is pretty simple. But it's less clear how to pass along the base finite element; i.e. the dof points of the standard cell and the basis functions. Right now I'm just using a simple Linear Lagrange element and since that maps dofs onto vertices, I could certainly just hard-code this element and replicate the evaluation machinery for it. But if there is already a way to emit the element info, I'd rather use that.
At the other end of the spectrum, I suppose I could look into generating swig wrapping for java, but since (a) I don't need all of fenics and (b) I'm targeting lower-powered machines, i'd really rather not embed so much code.
Thanks for reading this far! Any experiences or advice would be appreciated.