Dear All,
I'm new to dealii and worked through the tutorials. I am currently trying to an implement a 6th order parabolic equation by breaking it into three second order equations.
Thus I have a FeSystem (and tried to mimic tutorial step-21) with dim = 2 using
fe(FE_Q<dim>(degree), 1,FE_Q<dim>(degree),1,FE_Q<dim>(degree),1)
I used random initializing to initialize one of the variables
class InitialValues : public Function<dim>{
public: InitialValues() : Function<dim>(dim + 1){}
virtual void vector_value(const Point<dim> & /*p*/,Vector<double> & values) const override{
Assert(values.size() == dim + 1,ExcDimensionMismatch(values.size(), dim + 1));
values(0) = 0.0; // inital condition for mu
double fMin = -0.1;
double fMax = 0.5;
double f = (double)rand() / (double)RAND_MAX;
values(1) = fMin + f * (fMax - fMin); // initial condition for psi
values(2) = 0.0; // initial condition for omega }};
Then in run()
Question (1) Should I use VectorTools::project or VectorTools::interpolate for initializing the variables?
VectorTools::project(dof_handler,constraints,QGauss<dim>(degree + 1),InitialValues<dim>(),old_solution);
VectorTools::interpolate(dof_handler,InitialValues<dim>(),old_solution);
Both the initial conditions are not giving the desired steady state solution (possibly there is a bug that is not related with the initial condition). However, I want to make sure I understand how to set up initial condition generated using random values.
Question (2)Though, I set the initial condition only to one of the three solution variables, in the output I see all three variables initialized (with values different from zero) at time zero. I copied ‘output’ from tutorial step-21. Maybe the output is not generated at time zero or I made a mistake in the set up InitialValues?
Question (3)Since, I have a system of three variables (each with FE_Q<dim>(1) finite element space) in my function InitialValues I only defined InitialValues::vector_value and not InitialValues::value. Did I do right?
Thank you and I look forward to your response.
Best regards,
Karthi.