Re: [deal.II] Store data from a Tensor<1, dim> to a Vector

2021-12-14 Thread Judy Lee
Dr. Bangerth, Thank you so much! Points are printed, I will keep up my work. Best, Judy On Tuesday, December 14, 2021 at 5:49:37 PM UTC-5 Wolfgang Bangerth wrote: > On 12/14/21 08:32, Judy Lee wrote: > > > > I tried *DoFTools::map_dofs_to_support_points(mapping, dof_handler, > > support_points

Re: [deal.II] Store data from a Tensor<1, dim> to a Vector

2021-12-14 Thread Wolfgang Bangerth
On 12/14/21 08:32, Judy Lee wrote: I tried *DoFTools::map_dofs_to_support_points(mapping, dof_handler, support_points)*, to obtain coordinates on *local_dof_indices*, not running thru yet. My .cc file is attached with reference to step-3 in 2D, in which I added Lines 137-138 with reference to

Re: [deal.II] Store data from a Tensor<1, dim> to a Vector

2021-12-14 Thread Judy Lee
Hello everyone! I tried *DoFTools::map_dofs_to_support_points(mapping, dof_handler, support_points)*, to obtain coordinates on *local_dof_indices*, not running thru yet. My .cc file is attached with reference to step-3 in 2D, in which I added Lines 137-138 with reference to Lines 126-127, as

Re: [deal.II] Store data from a Tensor<1, dim> to a Vector

2021-12-08 Thread Judy Lee
Dr. Bangerth, Thank you so much! I will keep up my work. Best, Judy On Wednesday, December 8, 2021 at 6:36:46 PM UTC-5 Wolfgang Bangerth wrote: > > Judy: > > > (1) Is there an internal command/function that outputs > > higher-order-elemental (Q2, Q3 elements) nodal physical coordinate? > > Jus

Re: [deal.II] Store data from a Tensor<1, dim> to a Vector

2021-12-08 Thread Wolfgang Bangerth
Judy: (1) Is there an internal command/function that outputs higher-order-elemental (Q2, Q3 elements) nodal physical coordinate? Just like, "cell->vertex" outputs grid points that works for Q1 element. If I want to count in a linear function f(x) = x on Laplace's right-hand-side, should I ju

Re: [deal.II] Store data from a Tensor<1, dim> to a Vector

2021-12-08 Thread Judy Lee
Good afternoon, everyone! I have a couple of follow-up questions. (1) Is there an internal command/function that outputs higher-order-elemental (Q2, Q3 elements) nodal physical coordinate? Just like, "cell->vertex" outputs grid points that works for Q1 element. If I want to count in a linear fun

Re: [deal.II] Store data from a Tensor<1, dim> to a Vector

2021-12-07 Thread Judy Lee
Dear Matthias, Thanks so much for your reply. Your comment and Dr. Bangerth's comment both exactly pointed out the problems in my settings on the scalar "Vector cell_x(dofs_per_cell)", and the rank-1 tensor "std::vector> x(dofs_per_cell)", which multiply the scalar "fe_values.shape_value(i, q

Re: [deal.II] Store data from a Tensor<1, dim> to a Vector

2021-12-07 Thread Matthias Maier
Dear Judy, On Tue, Dec 7, 2021, at 11:45 CST, Judy Lee wrote: > cell_x(i) += fe_values.shape_value(i, q_index) * x(i); Here, you are multiplying a scalar (fe_values.shape_value(i, q_index)) and a rank-1 tensor (x(i)), which results in a rank-1 tensor. The error message says that you cannot st

Re: [deal.II] Store data from a Tensor<1, dim> to a Vector

2021-12-07 Thread Judy Lee
Good morning! Dr. Bangerth, Thanks so much for your reply. Yes, your comment exactly pointed out the problem in my declaration that "std::vector> x(dofs_per_cell)" should be created with a size parameter. Now I can output "x[i]" to show vertices of each cell. This is amazing! May I ask a fol

Re: [deal.II] Store data from a Tensor<1, dim> to a Vector

2021-12-07 Thread Wolfgang Bangerth
On 12/7/21 03:30, Judy Lee wrote: But how to use "Point x" for computing with other variables together? Like, I cannot implement "x * fe_values.shape_value(i, q_index)". However, it does not work thru if I tried like this: std::vector> x; for (const unsigned int i: fe_values.dof_indices()))

[deal.II] Store data from a Tensor<1, dim> to a Vector

2021-12-07 Thread Judy Lee
Hello everyone! Can I create "Vector x(n)", to store data values from a Tensor<1, dim> or Point, for physical coordinate after mesh/grid? I can create "Point x", to store data values from a Tensor<1, dim>, it works thru like: Point x; for (const unsigned int i: fe_values.dof_indices())) { x = c