← Back to team overview

dolfin team mailing list archive

Re: [Question #158012]: Extracting data from specific points

 

Question #158012 on DOLFIN changed:
https://answers.launchpad.net/dolfin/+question/158012

Anders Logg proposed the following answer:
On Thu, May 19, 2011 at 02:30:18PM +0200, Kristian Ølgaard wrote:
> On 19 May 2011 14:15, Kyle <question158012@xxxxxxxxxxxxxxxxxxxxx> wrote:
> > Question #158012 on DOLFIN changed:
> > https://answers.launchpad.net/dolfin/+question/158012
> >
> >    Status: Answered => Open
> >
> > Kyle is still having a problem:
> > Hi Johan,
> >
> > Thanks this helped me a bit, so now I have
> >
> > solver.solve(problem,s.vector())
> > (U, P) = s.split(deepcopy=True)
> >
> > values = P.vector()
> >
> > This is working fine it seems, but I am still unsure how to extract
> > specific data points from 'values' say from x[0.3 to 0.5] & y[0.0 to
> > 0.3] as an example
>
> I think you need to:
>   get the dofmap of P,
>   loop the cells in the mesh,
>     tabulate the dofs on each cell
>     tabulate the coordinates of each dof on the cell
>     check which dofs satisfy your criterion and then extract the
> values from the P vector using the dofs

Why not just call U(x), P(x) with the points in question?

--
Anders

-- 
You received this question notification because you are a member of
DOLFIN Team, which is an answer contact for DOLFIN.


References