Accroding to my understanding:
When we get the solution of Helmoltz equation using the function
UltrasoundProblem<dim>::solve ()
template <int dim>
void UltrasoundProblem<dim>::solve ()
{
deallog << "Solving linear system... ";
Timer <https://www.dealii.org/8.3.0/doxygen/deal.II/classTimer.html> timer;
timer.start
<https://www.dealii.org/8.3.0/doxygen/deal.II/classTimer.html#a3a8b5272198d029779dc9302a54305a8>
();
SparseDirectUMFPACK
<https://www.dealii.org/8.3.0/doxygen/deal.II/classSparseDirectUMFPACK.html>
A_direct;
A_direct.initialize
<https://www.dealii.org/8.3.0/doxygen/deal.II/classSparseDirectUMFPACK.html#a25b1d3c7dbb88158a76165a4a56a16d6>
(system_matrix);
A_direct.vmult
<https://www.dealii.org/8.3.0/doxygen/deal.II/classSparseDirectUMFPACK.html#ab50b0667127c0e5847bb125ae44800a4>
(solution, system_rhs);
timer.stop
<https://www.dealii.org/8.3.0/doxygen/deal.II/classTimer.html#a988f79aa183d9d5473c13106f5babe48>
();
deallog << "done ("
<< timer ()
<< "s)"
<< std::endl;
}
The output solution will be alpha and Beta from the function
UltrasoundProblem<dim>::solve
(). It will become of the input of the class
class ComputeIntensity : public DataPostprocessorScalar
<https://www.dealii.org/8.3.0/doxygen/deal.II/classDataPostprocessorScalar.html>
<dim>.
Using this class we will calculate the uh, duh, dduh etc.
Anyone can explain to me how it is calculating the uh? I don't understand
what is the input to this class after calculating the coeeficients Alpha
nad Beta in the tutorial.
template <int dim>
class ComputeIntensity : public DataPostprocessorScalar
<https://www.dealii.org/8.3.0/doxygen/deal.II/classDataPostprocessorScalar.html>
<dim>
{
public:
ComputeIntensity ();
virtual
void
compute_derived_quantities_vector
<https://www.dealii.org/8.3.0/doxygen/deal.II/classDataPostprocessor.html#aabfd7ef3eec0d636e0c69f8740af29f9>
(const std::vector<Vector<double>
<https://www.dealii.org/8.3.0/doxygen/deal.II/classVector.html> > &uh,
const std::vector<std::vector<Tensor<1, dim>
<https://www.dealii.org/8.3.0/doxygen/deal.II/classTensor.html> > > &duh,
const std::vector<std::vector<Tensor<2, dim>
<https://www.dealii.org/8.3.0/doxygen/deal.II/classTensor.html> > > &dduh,
const std::vector<Point<dim>
<https://www.dealii.org/8.3.0/doxygen/deal.II/classPoint.html> > &normals,
const std::vector<Point<dim>
<https://www.dealii.org/8.3.0/doxygen/deal.II/classPoint.html> >
&evaluation_points,
std::vector<Vector<double>
<https://www.dealii.org/8.3.0/doxygen/deal.II/classVector.html> >
&computed_quantities) const;
};
template <int dim>
ComputeIntensity<dim>::ComputeIntensity ()
:
DataPostprocessorScalar
<https://www.dealii.org/8.3.0/doxygen/deal.II/classDataPostprocessorScalar.html><dim>
("Intensity",
update_values
<https://www.dealii.org/8.3.0/doxygen/deal.II/group__feaccess.html#ggaa94b67d2fdcc390690c523f28019e52fa4057ca2f127aa619c65886a9d3ad4aea>
)
{}
template <int dim>
void
ComputeIntensity<dim>::compute_derived_quantities_vector (
const std::vector<Vector<double>
<https://www.dealii.org/8.3.0/doxygen/deal.II/classVector.html> > &uh,
const std::vector<std::vector<Tensor<1, dim>
<https://www.dealii.org/8.3.0/doxygen/deal.II/classTensor.html> > > &
/*duh*/,
const std::vector<std::vector<Tensor<2, dim>
<https://www.dealii.org/8.3.0/doxygen/deal.II/classTensor.html> > > &
/*dduh*/,
const std::vector<Point<dim>
<https://www.dealii.org/8.3.0/doxygen/deal.II/classPoint.html> > &
/*normals*/,
const std::vector<Point<dim>
<https://www.dealii.org/8.3.0/doxygen/deal.II/classPoint.html> > &
/*evaluation_points*/,
std::vector<Vector<double>
<https://www.dealii.org/8.3.0/doxygen/deal.II/classVector.html> >
&computed_quantities
) const
{
Assert
<https://www.dealii.org/8.3.0/doxygen/deal.II/group__Exceptions.html#ga70a0bb353656e704acf927945277bbc6>(computed_quantities.size()
== uh.size(),
ExcDimensionMismatch (computed_quantities.size(), uh.size()));
for (unsigned int i=0; i<computed_quantities.size(); i++)
{
Assert
<https://www.dealii.org/8.3.0/doxygen/deal.II/group__Exceptions.html#ga70a0bb353656e704acf927945277bbc6>(computed_quantities[i].size()
== 1,
ExcDimensionMismatch (computed_quantities[i].size(), 1));
Assert
<https://www.dealii.org/8.3.0/doxygen/deal.II/group__Exceptions.html#ga70a0bb353656e704acf927945277bbc6>(uh[i].size()
== 2, ExcDimensionMismatch (uh[i].size(), 2));
computed_quantities[i](0) = std::sqrt(uh[i](0)*uh[i](0) +
uh[i](1)*uh[i](1));
}
}
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/dealii/9ac0d666-3f80-4942-85e8-614a7ab9b98b%40googlegroups.com.