On 12/21/2016 02:05 PM, Jaekwang Kim wrote:
I tried to code following data post processing for my goal.
template<intdim>
void
ShearProblem<dim>::post_processing ()
{
// std::cout << " Post Processing..." << std::endl;
constMappingQ<dim> mapping (degree);
QGauss<dim> quadrature_formula(1);
FEValues<dim> fe_values (mapping, fe, quadrature_formula,
update_values |
update_quadrature_points |
update_JxW_values |
update_gradients);
constunsignedint dofs_per_cell = fe.dofs_per_cell;
constunsignedint n_q_points = quadrature_formula.size();
std::vector<SymmetricTensor<2,dim> > local_symgrad_phi_u (n_q_points);
std::cout<< " n_q_point: "<< n_q_points << std::endl;
constFEValuesExtractors::Vector velocities (0);
Vector<double> cellwise_shear_rate (triangulation.n_active_cells());
// I want to save my data in this part and attach this to dof_handler,
so I can make data out in -vtk format later
unsignedintk=0;
typenameDoFHandler<dim>::active_cell_iterator
cell = dof_handler.begin_active(),
endc = dof_handler.end();
for(; cell!=endc; ++cell)
{
fe_values.reinit (cell);
fe_values[velocities].get_function_symmetric_gradients (solution,
local_symgrad_phi_u);
unsignedintq=0;
doubleshear_rate = std::sqrt( local_symgrad_phi_u[q]*
local_symgrad_phi_u[q] *2);
*cellwise_shear_rate(k)=shear_rate;*
k+=1;
}
}
I could able to - shear_rate at each cell appropriately,
but How can I relate my 'cellwise_shear_rate' with dof handler so that I
finally able to see the values in 'vtk' format?
for now, it just seems that no more than a list of arrays....
You can just attach this vector of values to a DataOut object and output that.
That's what we often do with the vector of error indicators (which also has
the size triangulation.n_active_cells()), but your case is really no different.
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.
For more options, visit https://groups.google.com/d/optout.