Thank you guys for the help. Dan
On Tue, Jun 19, 2012 at 1:59 AM, Wolfgang Bangerth <[email protected]>wrote: > > cell->get_dof_indices (local_dof_indices); >> >> for (unsigned int k=0; k < dofs_per_cell; k++) >> prev_coeffs[k] = solution(local_dof_indices[k])**; >> > > This could be combined into a call of the form > cell->get_dof_values (solution, prev_coeffs); > But it's too cumbersome to do this, use the way Markus has suggested. > > > Would a similar call for the parallel code with the distributed >> mesh as in step-40 using the processor vector >> >> PETScWrappers::MPI::Vector locally_relevant_solution; >> >> and the local to global index >> >> std::vector<unsigned int> local_dof_indices (dofs_per_cell); >> >> work in a similar manner? The indexing would be different >> since we do not have the entire solution on each processor. >> I was how this might work? >> > > The dof indices you get a are global indices, and you can use these to get > values out of global (distributed) vectors as long as the corresponding > elements are stored locally. In the distributed case that means that you > need to make sure the vector has ghost elements -- see step-40. > > As for how to write a nonlinear program in general, take a look at the new > step-15 that's in the current development sources (which you can find via > the "subversion" link of the documentation). It shows how one would get to > the coefficients in your nonlinear matrix most easily. > > Best > W. > > -- > ------------------------------**------------------------------** > ------------ > Wolfgang Bangerth email: [email protected] > www: > http://www.math.tamu.edu/~**bangerth/<http://www.math.tamu.edu/%7Ebangerth/> > > > ______________________________**_________________ > dealii mailing list > http://poisson.dealii.org/**mailman/listinfo/dealii<http://poisson.dealii.org/mailman/listinfo/dealii> >
_______________________________________________ dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii
