This forum has been archived. All content is frozen. Please use KDE Discuss instead.

How to calculate solutions at every cell center point?

Tags: None
(comma "," separated)
jiashumei
Registered Member
Posts
1
Karma
0
Dear every dealii user,
Wish you good day!
I am a beginner to dealii. The version that I am using is 9.3.0.
I have caught with a problem when I am solving my FEM problems. Could anyone please help me with it?
I am intended to get all active cells` center point values, so I followed the tutorials and use the following coding.
//eg.
size_t cellCount = 0; //keep the cell`s count;
for (auto& cell : triangulation.active_cell_iterators())
{
//### get the cell`s center point solution:
double adata = dealii::VectorTools::point_value(dof_handler, solution, cell->center());

//### put the solution to a "VectorXd":
phantVValues(vindex) = adata;

//### next cell:
++cellCount;
}
//END
The problem is that when my active cell`s amount is large, this coding is in vastly slow calculation speed. I find another dealii method to solve the problem,
which is as follows. However, it is also very 'expensive' for very large amount of cells.

//additional.
//### define a FEFieldFunction object 'solution_function',
dealii::Functions::FEFieldFunction<3, dealii::DoFHandler<3>, dealii::Vector<double>>
solution_function(dof_handler, solution);

size_t cellCount = 0; //keep the cell`s count;
for (const auto& cell : dof_handler.active_cell_iterators())
{
//### cell`s center axis:
dealii::Point<3> cCell = cell->center();

//### set this cell as active cell:
solution_function.set_active_cell(cell);

//### get the cell`s center point solution:
double adata = solution_function.value(cCell);

//### put the solution to a "VectorXd":
phantVValues(vindex) = adata;

//### next cell:
++cell_Count;
}

//END

Are there any convenient and immediate methods in dealii version9.3.0 to get every cell center value?
I would be very appreciated if you can give me some suggestions.
Looking forward to your reply. Best wishes to you!

--

Yours,
sincerely.


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Google [Bot], Yahoo [Bot]