### (Deleted) Load values from std::vector

22
views
0
4 weeks ago by
I have a mesh in xml format and an std::vector<double> containing the load values I’d like to apply on the vertices of the mesh. It is ordered in such way, that the ith load should be applied on the ith vertex. My initial idea was to use the Expression class in the following way:
class Forces : public Expression{
std::vector<double> f;
public :
Forces(std::vector<double _f>) : Expression {
f = _f;
}
void eval(Array<double>& values, const Array<double>& x, const ufc::cell& cell) const {
vertexindex = ????
values[0] = f[vertexindex];
}
};​

I was able to get the cell index with cell->index(), but cannot figure out a way to obtain the vertex indices. Is it possible from the Expression class? Or is there other way around?

Community: FEniCS Project