← Back to team overview

dolfin team mailing list archive

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

 

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

Kristian

> --
> You received this question notification because you are a member of
> DOLFIN Team, which is an answer contact for DOLFIN.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~dolfin
> Post to     : dolfin@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dolfin
> More help   : https://help.launchpad.net/ListHelp
>


Follow ups

References