CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

How to use labelUList?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 8, 2019, 11:46
Default How to use labelUList?
  #1
New Member
 
samuel
Join Date: Oct 2019
Posts: 15
Rep Power: 7
Samuel Twain is on a distinguished road
Dear all:
It seems that labelUList can be constructed by constructor labelUList(val,size) which can be seen as following:
Code:
template<class T>
 inline Foam::UList<T>::UList(T* __restrict__ v, label size)
 :
     size_(size),
     v_(v)
 {}
So I constructed a labelUList class:
Code:
 labelUlist marks(0,50);
The operator[] for labelUList has been reloaded. But I failed to Info or change the element of marks by :
Code:
Info << marks[3] <<endl;
marks[4]=5;
And the erro is:
Code:
#0  Foam::error::printStack(Foam::Ostream&) at ??:?
#1  Foam::sigSegv::sigHandler(int) at ??:?
#2  ? in /lib/x86_64-linux-gnu/libc.so.6
#3  ? in ~/OpenFOAM/saumuel-v1806/platforms/linux64GccDPInt64Opt/bin/IBIcoFoamFD
#4  __libc_start_main in /lib/x86_64-linux-gnu/libc.so.6
#5  ? in ~/OpenFOAM/saumuel-v1806/platforms/linux64GccDPInt64Opt/bin/IBIcoFoamFD
Segmentation fault (core dumped)
Could anyone please give me some advices?
Thank you
samuel
Samuel Twain is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
ldUMatrix building indexing in parallel fedvasu OpenFOAM Programming & Development 2 April 28, 2019 15:20
next to wall gradient correction for SGS-model BC ThomasHultsch OpenFOAM Programming & Development 2 April 6, 2018 12:55
[Commercial meshers] star-ccm mesh to O\/F DLC OpenFOAM Meshing & Mesh Conversion 77 September 19, 2016 10:25
How to read freestream velocity vector in a new boundary condition? robyTKD OpenFOAM Programming & Development 5 April 24, 2013 10:43


All times are GMT -4. The time now is 01:55.