← Back to team overview

dolfin team mailing list archive

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

 

On May 19, 2011, at 5:31, Kristian B. Ølgaard<question158012@xxxxxxxxxxxxxxxxxxxxx> wrote:

> Question #158012 on DOLFIN changed:
> https://answers.launchpad.net/dolfin/+question/158012
> 
>    Status: Open => Answered
> 
> Kristian B. Ølgaard proposed the following answer:
> 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

I think such a function would be very useful. Would it be possible to put a free function of this into DOLIN. It could take a FunctionSpace and a subdomain/MeshFunction as input and return an Array<uint> of dofs indices. 

This would then hopefully also just work in parallel. 

Johan

> 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
>> 
> 
> -- 
> 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