Thanks a lot, Konrad!
I will try to compare your "map" method to the "FE_DGQ" method in terms of
efficiency. And may come back to report later.
Best regards,
Z. B. Zhang
On Tuesday, October 22, 2019 at 4:06:15 PM UTC-4, Konrad Simon wrote:
>
> Hi Zhidong,
>
> On Monday, October 21, 2019 at 1:42:30 AM UTC+2, Zhidong Brian Zhang wrote:
>>
>> Thank you very much for your prompt reply, Konrad!
>>
>> My confusion is the output of cell->id(), for example,
>> 0_3:000
>> 0_3:200
>> 0_3:003
>> 0_3:006
>> 0_3:406
>> 0_3:606
>> 0_3:206
>> 0_3:007
>> 0_3:407
>> 0_3:607
>> 0_3:207.
>>
>> What type I need to use as the key in std::map? And is the map
>> parallel-distributed? Because my model requires that.
>>
>> You can use the CellId object as a key itself:
>
> std::map<CellId, ClassWithCellInfo> cell_info_map;
>
> If you need the map distributed across nodes according to the distribution
> of cells then you can initialize the map (on each node separately) through
>
> for (; cell!=endc; ++cell)
> {
> if (cell->is_locally_owned())
> {
> CellId current_cell_id(cell->id());
>
> std::pair<typename std::map<CellId, ClassWithCellInfo>::iterator, bool >
> result;
> result = cell_basis_map.insert(std::make_pair(cell->id(),
> cell_info_map));
>
> // ClassWithCellInfo must have a copy constructor
> Assert(result.second,
> ExcMessage ("Insertion of cell_info_map into std::map failed. "
> "Problem with copy constructor?"));
> } // end if
> } // end ++cell
>
> Best,
> Konrad
>
--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see
https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to the Google Groups
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/dealii/fad5c35e-263c-4632-9e36-d483ee619634%40googlegroups.com.