|
[Sponsors] |
October 25, 2011, 09:31 |
labelListList handling
|
#1 |
Member
Join Date: Oct 2011
Posts: 37
Rep Power: 15 |
Hello together
Can anyone tell me how to find out the length of the lists in a labelListList? Is there a function or do I have to iterate with a counter through the lists? Thanks a lot |
|
October 26, 2011, 04:00 |
|
#2 |
Senior Member
Tomislav Maric
Join Date: Mar 2009
Location: Darmstadt, Germany
Posts: 284
Blog Entries: 5
Rep Power: 21 |
Hi Peter,
Code:
typedef List<labelList> labelListList; so my guess is that you have to loop through to get the sizes. Check out ListOps.H and ListListOps.H for generic algorithms defined on List<> and List<List<> >. Hope this helps, Tomislav |
|
October 26, 2011, 10:12 |
|
#3 | |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,714
Rep Power: 40 |
Quote:
http://foam.sourceforge.net/docs/cpp...c0824cbecb892b |
||
October 27, 2011, 05:24 |
|
#4 |
Member
Join Date: Oct 2011
Posts: 37
Rep Power: 15 |
Hello together
Thanks a lot for your answers. I'm quite new in OpenFOAM and C++. I have another question. When I try to create an exetuble with the wmake, I get the error labeListList does not name a type labelListList was used in my code like that: const labeListList& FacesToPoint = cylField.pointFaces(); Where cylField is a vectorField which was created by a coordinate transform with cylindricalCS. What's the problem with my declaration? An other problem is that i get an error while performing the coordinate transform: error: no matching function for call to Foam::cylindricalCS::globalToLocal(const Foam::Vector<double>&) Thanks |
|
October 27, 2011, 05:34 |
|
#5 | |
Senior Member
Tomislav Maric
Join Date: Mar 2009
Location: Darmstadt, Germany
Posts: 284
Blog Entries: 5
Rep Power: 21 |
Quote:
those errors are compiler errors: there is no code in your program that implements (declares/defines) a labelListList. This type is a low-level container used by OpenFOAM. Have you created your .C and .H files manually for your application, or have you used: Code:
foamNew source App appName Just in case you haven't used "foamNew" so far: 1) create the directory named as your application 2) change to this directory 3) execute the command above 4) edit Make/files and add "appName.C" in the first line 5) wmake As for the cylindricalCS error: error: no matching function for call to ‘Foam::cylindricalCS::globalToLocal(const Foam::Vector<double>&)’ Check out the cylindricalCS.H, in there you will find globalToLocal member functions: there is a "bool" argument given to the functions as well that you need to define (bool translate). If you are using a class, always go and find it using the Doxygen or in the source, and check out the declaration, this explains how it should be used... Hope this helps.. |
||
October 27, 2011, 08:25 |
|
#6 |
Member
Join Date: Oct 2011
Posts: 37
Rep Power: 15 |
Hi Maric
Thanks a lot for your quick reply. I created my application folder manually, but the files-and options files looks the same. The aim of this application is to create a mixingplane patch. At the moment I try to implement an algorithm who is able to detect the corner-points of the original mesh. The class is named mpPolyPatch and inherits form PolyPatch. Since this is somehow similar to what coupledPolyPatch.C does, I took coupledPolyPatch as basic structure and tried to change it so that it fits to my requests. Do I need another header-file to include/declare the class labelListList or do I have to specify some additional directories in the options-file of the MAKE-folder? Thanks Peter |
|
October 27, 2011, 09:00 |
|
#7 |
Senior Member
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 22 |
If you really use this:
Code:
const labeListList& FacesToPoint = cylField.pointFaces(); |
|
October 27, 2011, 09:32 |
|
#9 |
Member
Join Date: Oct 2011
Posts: 37
Rep Power: 15 |
Thanks so much. You wan't believe how long I tried to find the bug...
Today was a very efficient day :-) |
|
October 27, 2011, 09:45 |
|
#10 | |
Senior Member
Tomislav Maric
Join Date: Mar 2009
Location: Darmstadt, Germany
Posts: 284
Blog Entries: 5
Rep Power: 21 |
Quote:
This is my reaction when this happens: Of course. |
||
October 27, 2011, 12:14 |
|
#11 |
Member
Join Date: Oct 2011
Posts: 37
Rep Power: 15 |
It seams that I was able to compile my application mpPolyPatch.C with "wmake libso". Can you tell me whether there is a possibility to check whether everthing wen't allright. For example check whether the new polyPatch, mpPolyPatch, is available in the library?
Thanks |
|
October 28, 2011, 04:58 |
|
#12 | |
Senior Member
Tomislav Maric
Join Date: Mar 2009
Location: Darmstadt, Germany
Posts: 284
Blog Entries: 5
Rep Power: 21 |
Quote:
If you have compiled it, it should be available. Check out the Make/files and see the line Code:
LIB = $(FOAM_USER_LIBBIN)/libSomeName Code:
-I/path/to/myPolyPatch/directory/lnInclude Code:
-llSomeName Note: in Make/options, every line in the directory/lib lists must end with "\" without the space (this doesn't work "\ "), except for the last one. |
||
October 28, 2011, 12:11 |
|
#13 |
Member
Join Date: Oct 2011
Posts: 37
Rep Power: 15 |
Hello Maric
Thank you so much for all your explanations. Until now the algorithm is able to properly detect the corner points of the boundary patch. What I would like to do now is reconstruct the edges surrounding the patch. I have created a labelListList containing a list with points and the edges according to each point. I did this with: const labelListList& edgesToPoint = this->pointEdges() I would now like to create a list of the points shared by one edge but I could not find a function like const labelListList& edgesToPoint = this->edgePoints(); Do I have to loop through the pointEdges labelListList to find the points according to one edge? Thanks a lot |
|
October 31, 2011, 06:10 |
|
#14 |
Member
Join Date: Oct 2011
Posts: 37
Rep Power: 15 |
Hello together
I would like to create something like an array where I can store integers inside. The reason why it is something is that I don't know the final length of the array and would therefore like to have something where I don't have to devine this. I was thinking about a list but I'm not sure whether this would be the right choice and if yes i don't really know how I have to declare it correctly. Can I write something like this? List<int> myIntList; Thanks a lot |
|
October 31, 2011, 07:49 |
|
#15 | |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,714
Rep Power: 40 |
Quote:
|
||
November 2, 2011, 05:42 |
|
#16 |
Member
Join Date: Oct 2011
Posts: 37
Rep Power: 15 |
Hello
I'd like to use the Foam memberfunction polySplineEdge but it always tells me that polySplineEdge is not a memberfunction of Foam. If I take a look at the Doxygen "documentation" I find Foam:olySplineEdge. I tried to use it like this: pointField mySpline = Foam:olySplineEdge(.....) Thanks |
|
June 25, 2012, 09:46 |
|
#17 |
Member
Join Date: Oct 2011
Posts: 37
Rep Power: 15 |
Hello together
Does anybody know how to create a labelList like it is possible with the integer arrays? Something like: labelList myLabelList = {3, 1, 5, 7, 8} Or even better, how to create a labelListList labelListList myLabelListList = {3, 1, 5, 7, 8}, {2, 3}, {3,1,8}, {................... I would like to test an utility and it would simplify the testing a lot if it would be possible to create labelListList somehow like this. Thanks in advance |
|
June 25, 2012, 09:54 |
|
#18 | |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,714
Rep Power: 40 |
Quote:
Doesn't look really pretty, but I don't see why a stream constructor should not work: Code:
labelListList myLabListList(IStringStream( "(" "(3 1 5 7 8)" "(2 3)" "(3 1 8) ")" )()); |
||
June 25, 2012, 11:39 |
|
#19 |
Member
Join Date: Oct 2011
Posts: 37
Rep Power: 15 |
Thank you very much. This works fine for me.
Have a nice day. |
|
May 20, 2014, 06:49 |
|
#20 |
New Member
Join Date: Oct 2013
Posts: 19
Rep Power: 13 |
Hi,
Does anybody know how to create a dynamic labelListList ? Because when i write : "const labelListList & listlist; " i get the error because of non-initialization. Do you have any suggestion to create empty labelListList?because i don't want to initialize it in declaration step... Tnx |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Problem with handling LES modeling with dynamic mesh | g.akbari | OpenFOAM Running, Solving & CFD | 0 | March 8, 2010 17:18 |
Error%7eerror triggers crash after handling exceptions thrown by errorexit twice | 7islands | OpenFOAM Bugs | 2 | September 4, 2007 06:24 |
Handling axisymmetry terms on the symmetry line | Sonny | Main CFD Forum | 4 | December 9, 2005 17:22 |
macros handling vectors | sivakumar | FLUENT | 0 | January 18, 2002 17:16 |