On 12/7/21 03:30, Judy Lee wrote:

But how to use "Point<dim> 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<Point<1>> x;
for (const unsigned int i: fe_values.dof_indices())) {
x[i] = cell->vertex(i);
}
std::cout << x[i] << std::endl;

It gives:
make[3]: *** [CMakeFiles/run.dir/build.make:77: CMakeFiles/run] Segmentation fault
make[2]: *** [CMakeFiles/MakeFile2:237: CMakeFiles/run.dir/all] Error 2
make[1]: *** [CMakeFiles/MakeFile2:244: CMakeFiles/run.dir/rule] Error 2
make: *** [Makefile:202: run] Error 2

Judy -- can you explain *what* it is that you want to do? It is often easier to answer *what* questions, but you ask a *how* question.

Separately, the error you show is a segmentation fault. I don't think it has anything to do with the line
  x[i] = cell->vertex(i)
but instead with the fact that your vector 'x' has size zero. You need to set it to the correct size before you access elements 'x[i]'.

Best
  W.

--
------------------------------------------------------------------------
Wolfgang Bangerth          email:                 bange...@colostate.edu
                           www: http://www.math.colostate.edu/~bangerth/

--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- You received this message because you are subscribed to the Google Groups "deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/db18d86c-85ee-f6f8-0a22-d68c7fb6dd71%40colostate.edu.

Reply via email to