[Getdp] Build in function to get the number of elements of a given group

Patrick Dular Patrick.Dular at ulg.ac.be
Wed Dec 21 18:59:13 CET 2016


Dear Mang Cai,

The built-in function GetNumElements[]{.} does that, e.g.,

   GetNumElements [] {myNUMOFREGION}
with
   myNUMOFREGION = 10;

gives you the number of elements of physical number 10 (given in the 
function parameters list).

With the "automated nightly builds" version of GetDP (available 
tomorrow), that function is now extended to allow more than one physical 
number, e.g.,

   GetNumElements [] {10,35}

or
   GetNumElements [] { myRegionNumberList() }
with
   myRegionNumberList() = {10,35};

or
   GetNumElements [] { GetRegions[myRegionGroup] }
with
   Group{
     myRegionGroup = Region[{10,35}];
   }

As seen in the last example, another new function, GetRegions[.], is 
also now available. It gives back the list of region numbers of a Region 
Group, e.g.,

   myRegionNumberList() = GetRegions[myRegionGroup];

Regards,

Patrick


On 17/12/16 22:00, Mang Cai wrote:
> Dear Getdp-users,
>
> Is there a build in function to get the number of elements of a given 
> group?
> Or how can I get this number in an efficient way?
>
> For my post - processing written in python, I need this number to 
> efficiently extract the right field solutions given from Getdp.
>
> Thank you for the help,
> Mang Cai
>
>
>
> _______________________________________________
> getdp mailing list
> getdp at onelab.info
> http://onelab.info/mailman/listinfo/getdp

-- 
Patrick Dular, Prof. Dr. Ir.,
Research Director F.R.S.-FNRS
Department of Electrical Engineering and Computer Science
Unit of Applied and Computational Electromagnetics (ACE)
University of Liege - Montefiore Institute - B28 - Parking P32
B-4000 Liege - Belgium - Tel. +32-4 3663710 - Fax +32-4 3662910
E-mail: Patrick.Dular at ulg.ac.be

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://onelab.info/pipermail/getdp/attachments/20161221/ec635acc/attachment.html>


More information about the getdp mailing list