Hello. I hope you can guide me in right direction. I get the XML file which contains value in each vertices of my mesh (756 vertices). This is the several lines for understanding about structure of my code: <dolfin xmlns:dolfin="http://fenicsproject.org"> <function_data size="756"> <dof index="0" value="0.92645196218634307" cell_index="1162" cell_dof_index="0" /> <dof index="1" value="0.92741149453051064" cell_index="961" cell_dof_index="0" /> <dof index="2" value="0.90638230970501044" cell_index="961" cell_dof_index="2" /> <dof index="3" value="0.93777662937697015" cell_index="961" cell_dof_index="3" /> <dof index="4" value="0.94032969432829971" cell_index="828" cell_dof_index="0" /> <dof index="5" value="0.95319291740793965" cell_index="792" cell_dof_index="0" /> <dof index="6" value="0.92941724429760963" cell_index="792" cell_dof_index="2" />
From Dolfin tutorial I find this example Calculating conductivity as you can see they took information about each cells from ‘c00,xml.gz’ file.
# Code for C++ evaluation of conductivity
conductivity_code = """
class Conductivity : public Expression
{
public:
// Create expression with 3 components
Conductivity() : Expression(3) {}
// Function for evaluating expression on each cell
void eval(Array<double>& values, const Array<double>& x, const ufc::cell& cell) const
{
const uint D = cell.topological_dimension;
const uint cell_index = cell.index;
values[0] = (*c00)[cell_index];
values[1] = (*c01)[cell_index];
values[2] = (*c11)[cell_index];
}
// The data stored in mesh functions
std::shared_ptr<MeshFunction<double> > c00;
std::shared_ptr<MeshFunction<double> > c01;
std::shared_ptr<MeshFunction<double> > c11;
};
"""
# Define conductivity expression and matrix
c00 = MeshFunction("double", mesh, "c00.xml.gz")
c01 = MeshFunction("double", mesh, "c01.xml.gz")
c11 = MeshFunction("double", mesh, "c11.xml.gz")
c = Expression(cppcode=conductivity_code)
c.c00 = c00
c.c01 = c01
c.c11 = c11
C = as_matrix(((c[0], c[1]), (c[1], c[2])))
And here I have a question how I can extract information from mine file? Which contains function_data in VERTEX, not in cell. I will be happy any suggestion, or example. Thank you.