dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #08533
from userdefined function to Vector
What is the c++ code to convert the result of interpolation
on a discrete vector ?
class IdentityDef : public Function
{
public:
IdentityDef(Mesh& mesh) : Function(mesh) {
}
void eval(real* values, const real* x) const
{
values[0] = x[0];
values[1] = x[1];
values[2] = 0;
values[3] = 0;
}
};
IdentityDef phi(mesh);
uBlasVector phiv(phi.vector().size());
phiv=phi.vector();
the compilation is ok but
it fails to run cause the .vector() function
works only on discrete function,
I tried also to heritate DiscreteFunction on IdentityDef
that doesn't work the same. Sorry I'm used to freefem++
where these distinction between variable does not exist.
--
Vuk Milisic
Chercheur CNRS
UMR 5224
Laboratoire Jean Kuntzman
Unversité Joseph Fourier
Grenoble
http://ljk.imag.fr/membres/Vuk.Milisic/
Follow ups