In case anyone else is looking for a simple solution. The model 2pnc includes a 
static vector of size numDofs, (staticDat_) so all that has to be done is  add 
a bool item to the structure and use this field to indicate if the particular 
item is of interest or not. With that, a loop of with action on a selection of 
global indexes is straight forward and easy.

Dumux has a pretty cool design :-)

Regards to all

Edscott

-----Mensaje original-----
De: Dumux [mailto:[email protected]] En nombre de Timo 
Koch
Enviado el: viernes, 6 de octubre de 2017 06:26 p. m.
Para: DuMuX User Forum; Edscott Wilson
Asunto: Re: [DuMuX] globalpos from this->numDofs()


> Am 06.10.2017 um 22:23 schrieb Ed Scott Wilson Garcia <[email protected]>:
> 
> Hello,
> 
>   I hope someone on this list can help me with this, which apparently should 
> have a simple solution.
>  I have added a loop indexed from zero to this->numDofs() in the 
> 2pnc/implicit/model.hh, but I need to obtain a GlobalPosition from the index. 
> I see that the GlobalPosition can be obtained from the element and the 
> subcontrol volume indexes (scvIdx), but I am looking for a simpler solution 
> with a plain loop on the degrees of freedom,  numDofs.
>   Is this possible? If so, could someone point me to an example code?

Hi Edscott,

this is not possible. Unless you want to store a vector of ElementSeeds or a 
vector of all global dof positions first. There is no random index access for 
grid entities in Dune. 

Why would you want to have a raw index loop instead of an iterator loop / 
range-based for loop over elements in your case?

Best wishes
Timo
> Thanks in advance,
> 
> Edscott Wilson Garcia
> IMP
> _______________________________________________
> Dumux mailing list
> [email protected]
> https://listserv.uni-stuttgart.de/mailman/listinfo/dumux

_______________________________________________
Dumux mailing list
[email protected]
https://listserv.uni-stuttgart.de/mailman/listinfo/dumux
_______________________________________________
Dumux mailing list
[email protected]
https://listserv.uni-stuttgart.de/mailman/listinfo/dumux

Reply via email to