Hello,
-- following up on this, I implemented initialize_info and the code compiles
and runs. However, the value of the functional is not assembled correctly (I
get
a value of zero after the computations are complete). My assembly code looks as
follows:
//assemble routine
MeshWorker::DoFInfo<dim> dof_info(dof_handler);
MeshWorker::Assembler::Functional<double> assembler;
//a single scalar functional that does not depend on data on the interior
faces
assembler.initialize(1);
MeshWorker::integration_loop<dim, dim>
(dof_handler.begin_active(), dof_handler.end(),
dof_info, info_box,
boost::bind(&EllipticOptimalitySystemSolver<dim>::integrate_cell_term_functional,
this, _1, _2),
boost::bind(&EllipticOptimalitySystemSolver<dim>::integrate_boundary_term_functional,
this, _1, _2),
boost::bind(&EllipticOptimalitySystemSolver<dim>::integrate_face_term_functional,
this, _1, _2, _3, _4),
assembler, true);
return assembler(0);
Since the functional is defined on the boundary, i do all computations in the
integrate_boundary_term_functional:
void
EllipticOptimalitySystemSolver<dim>::integrate_boundary_term_functional_1(DoFInfo&
dinfo, CellInfo& info)
{
const FEValuesBase<dim>& fe_v = info.fe_values();
double local_value = dinfo.value(0);
const std::vector<double> &JxW = fe_v.get_JxW_values ();
const std::vector<Point<dim> > &normals = fe_v.get_normal_vectors ();
//get values, gradients, and what else is required...
//this is the value of the functional on the current boundary edge
for (unsigned int point = 0; point < fe_v.n_quadrature_points; ++point)
for (unsigned int i = 0; i < fe_v.dofs_per_cell; ++i)
local_value += ....
//even if i add local_value to dinfo.value(0) i still get a zero at the end
//but local_value is non-zero...
dinfo.value(0) += local_value;
}
What am I doing wrong here? How should I update the functional value to include
the contribution computed on this edge?
Thanks in advance for your help!
-- Mihai
________________________________
Von: mihai alexe <[email protected]>
An: Praveen C <[email protected]>
CC: deal.ii <[email protected]>
Gesendet: Mittwoch, den 9. Februar 2011, 0:12:03 Uhr
Betreff: Re: [deal.II] MeshWorker::Assembler::Functional initialize_info
It seems to be required, it's called by other internal routines in the
integration_loop.
I still get link errors even when I don't call initialize_info in my own code.
This is a bit odd. I will look into it more tomorrow.
-- Mihai
________________________________
Von: Praveen C <[email protected]>
An: mihai alexe <[email protected]>
CC: deal.ii <[email protected]>
Gesendet: Mittwoch, den 9. Februar 2011, 0:07:35 Uhr
Betreff: Re: [deal.II] MeshWorker::Assembler::Functional initialize_info
For Functional, initialize is allocating all the memory required for storing
the
results. I think initialize_info is not even necessary.
praveen
On Wed, Feb 9, 2011 at 10:00 AM, mihai alexe <[email protected]> wrote:
Actually, as far as I can see, the method initialize_info as declared below is
not even implemented yet (or it's in a different file that I can't locate)...
_______________________________________________
dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii