std::string fileName = "solution-";
fileName += ('0' + cycle);
fileName += ".vtu";
std::ofstream out(fileName.c_str());
DataOut<dim> data;
data.attach_dof_handler(this->dofHandler);
std::vector<std::string> solutionNames;
switch (dim)
{
case 2:
solutionNames.push_back ("x_displacement");
solutionNames.push_back ("y_displacement");
break;
case 3:
solutionNames.push_back ("x_displacement");
solutionNames.push_back ("y_displacement");
solutionNames.push_back ("z_displacement");
break;
default:
Assert(false, ExcNotImplemented());
}
data.add_data_vector(this->solution, solutionNames);
data.clear_data_vectors();
data.attach_dof_handler(outputHandler);
data.add_data_vector(stressGlobal[0][0], "Sxx");
data.add_data_vector(stressGlobal[1][1], "Syy");
data.add_data_vector(stressGlobal[0][1], "Sxy");
data.build_patches();
data.write_vtu(out);
@Article{vogel2014a-preprint,
author = {Vogel, F. and Pelteret, J-P. V. and Kaessmair, S. and Steinmann, P.},
title = {Magnetic force and torque on particles subject to a magnetic field},
journal = {European Journal of Mechanics A/Solids},
year = {2014},
volume = {48},
pages = {23--31},
month = {November--December}
}
@Book{Hughes2000a,
Title = {The Finite Element Method: Linear Static and Dynamic Finite Element Analysis},
Author = {Hughes, T. J.},
Publisher = {Dover Publications Inc.},
Year = {2000},
Address = {New York, USA},
Note = {ISBN: 978-0486411811},
}
it seems that the L2-projection method also evaluates the stress tensor at the quadrature points and then finds the cell-averaged stress. The only difference compared with the heuristic method is that it solves AX = Y where A is mass matrix, Y is integration of cell-averaged stress component and X is the nodal stress component that we want. Is that right?
Like a simple linear regression, the least-squares method will minimise the error of your function (as given by the quadrature data) projected onto the given finite element space (be it continuous or discontinuous, low or high order, etc.).
Vector<double> ux(this->solution.size()/dim);
for (unsigned int i = 0; i < ux.size(); ++i)
{
ux[i] = this->solution[i];
}
GradientPostProcessor<dim> gradientProcessor;
data.add_data_vector(scalarDofHandler, ux, gradientProcessor);
FE_Q<dim> scalarFe(1);
DoFHandler<dim> scalarDofHandler(this->tria);
scalarDofHandler.distribute_dofs(scalarFe);
--------------------------------------------------------
An error occurred in line <104> of file </home/jie/dealii/source/base/subscriptor.cc> in function
void dealii::Subscriptor::check_no_subscribers() const
The violated condition was:
counter == 0
Additional information:
(none)
Stacktrace:
-----------
#0 /home/jie/dealii-build/lib/libdeal_II.g.so.9.0.0-pre: dealii::Subscriptor::check_no_subscribers() const
#1 /home/jie/dealii-build/lib/libdeal_II.g.so.9.0.0-pre: dealii::Subscriptor::~Subscriptor()
#2 /home/jie/dealii-build/lib/libdeal_II.g.so.9.0.0-pre: dealii::DataPostprocessor<2>::~DataPostprocessor()
#3 ./main: dealii::DataPostprocessorVector<2>::~DataPostprocessorVector()
#4 ./main: IFEM::LinearElasticSolver<2>::output(unsigned int) const
#5 ./main: main
--------------------------------------------------------
std::vector<DataComponentInterpretation::DataComponentInterpretation>
interpretation(dim, DataComponentInterpretation::component_is_part_of_vector);
data.add_data_vector(this->dofHandler, this->solution,
std::vector<std::string>(dim, "displacement"), interpretation);
StrainPostprocessor<dim> strain;
data.add_data_vector(this->dofHandler, this->solution, strain);
data.build_patches();
data.write_vtu(out);
StrainPostprocessor<dim> strain;
DataOut<dim> data;
…
--
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+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.