[deal.II] Re: Vector-valued gradient of solution vector

2016-09-29 Thread Daniel Arndt
Joel, Yes, this looks about right. I would really replace "std::vector double x,y,z" by "Vector x,y,z". In the end, entries in these vectors only make sense with the corresponding DoFHandler. This would also allow you to use these Vectors for postprocessing in deal.II. Best, Daniel -- The

[deal.II] Re: Vector-valued gradient of solution vector

2016-09-28 Thread Daniel Arndt
Joel, I did try it, but I cant just change the local_velocity_values from a > std::vector> to std::vector. Then the > fe_values[velocities].get_function_values function doesnt compile. > That's true, but you should use std::vector and not std::vector, see also [1]. >

[deal.II] Re: Vector-valued gradient of solution vector

2016-09-28 Thread Joel Davidsson
Dear Daniel, I did try it, but I cant just change the local_velocity_values from a std::vector> to std::vector. Then the fe_values[velocities].get_function_values function doesnt compile. So I commented that part out, the results you see is from the code as it is, I used the for

[deal.II] Re: Vector-valued gradient of solution vector

2016-09-27 Thread Daniel Arndt
Joel, Its been a week since my latest post, I was just wondering if you could > help me. > Did you try what I suggested? What were the problems? Looking at the latest files you sent, local_velocity_values has still not the type std::vector and you are still using for (unsigned int

[deal.II] Re: Vector-valued gradient of solution vector

2016-09-20 Thread Joel Davidsson
Dear Daniel, To clarify what I am searching for, I would like to get the vector-valued solution into a format that matches a scalar. Either as a std::vector> or a std::vector, the format doesn't matter as long as it matches a scalar dofs. So I can manipulate the vector

[deal.II] Re: Vector-valued gradient of solution vector

2016-09-19 Thread Daniel Arndt
Joel, > [...] > for (unsigned int q_index=0; q_indexfor (unsigned int i=0; i { > velocity[local_dof_indices[i]] = local_velocity_values[q_index]; > } > > Here you assign the same Tensor<1,dim> at all DoFs

[deal.II] Re: Vector-valued gradient of solution vector

2016-09-19 Thread Joel Davidsson
Dear J-P, Ok, I tried to to use the FEValueExtractors but I am not sure if my code is working correctly. std::vector> velocity; velocity.resize (dof_handler_scalar.n_dofs()); QGauss quadrature_formula(dof_handler.get_fe().degree+1); FEValues

[deal.II] Re: Vector-valued gradient of solution vector

2016-09-13 Thread Jean-Paul Pelteret
Dear Joel, In general, no you cannot. Here you assume a specific ordering of the DoFs in the global solution vector, and this changes for each finite element. For example, using FE_Q's might result the ordering [x0 y0 z0 x1 y1 z1 ...] and FE_DGQ's might lead to [x0 x1 x2 ... y0 y1 y2 ... z0 z1

[deal.II] Re: Vector-valued gradient of solution vector

2016-09-13 Thread Joel Davidsson
Dear all, If I have a Vector-valued solution in 3D and I would like to get the size of each vector in another smaller Vector, can I do it like this: for (unsigned int i=0;i

[deal.II] Re: Vector-valued gradient of solution vector

2016-08-30 Thread Jean-Paul Pelteret
Dear Joel, No, this functionality doesn't exist. However, you can create a quadrature rule with the quadrature points located at the support points (see the FAQ ),

[deal.II] Re: Vector-valued gradient of solution vector

2016-08-22 Thread Daniel Arndt
Joel, You should not rely on any particular sorting of the dofs in the solution vector. Instead you can ask the FiniteElement on each cell for the component of a local dof by const unsigned int component = fe.system_to_component_index(i).first; Apart from that the DataOut object knows about

[deal.II] Re: Vector-valued gradient of solution vector

2016-08-12 Thread Daniel Arndt
Joel, Yes the matrix you are assembling is a vector-valued mass matrix now. For me your code is failing with void dealii::FEValuesBase::get_function_gradients(const InputVector&, std::vector >&) const [with

[deal.II] Re: Vector-valued gradient of solution vector

2016-08-12 Thread Joel Davidsson
Dear Daniel, Thank you for a fast answer. I think I got the matrix and right-hand side correct now, please see test.cc for the example code. What I want to from the start was to get the vector-valued gradient from a scalar field, but I could not get this to work. See section "Do not work" in

[deal.II] Re: Vector-valued gradient of solution vector

2016-08-11 Thread Daniel Arndt
Joel, Does the equation you want to solve for have multiple components? Otherwise it would not make sense to multiply in the right hand side something with a gradient. If you want to project the gradient into a vector valued finite element ansatz space, then the matrix you are assembling looks