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

Is there tip on Openfoam programming about arbitrary unknown function?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 11, 2024, 04:04
Default Is there tip on Openfoam programming about arbitrary unknown function?
  #1
Member
 
Song Young Ik
Join Date: Apr 2022
Location: South Korea
Posts: 59
Rep Power: 4
songyi719 is on a distinguished road
For example, when I want to analyse what line does, lets say there is line


const face compactFace(identityMap(newFace.size()));


I can guess that I am defining constant face named 'compactFace' and initializing as value identityMap(newFace.size()), where newFace is value given in the code before, so we can guess it will be initialized as identityMap(known value).


But problem here is that identityMap isn't forementioned in this code, so it must have been from other file which header is mentioned at start of the file.


Is there easy way to find origin of such function easily and figure out what these things do? Or is it only way to search for every class file mentioned?
songyi719 is offline   Reply With Quote

Old   February 11, 2024, 05:30
Default
  #2
Senior Member
 
Join Date: Oct 2017
Posts: 133
Rep Power: 9
Krapf is on a distinguished road
You could use the C++ Source Code Guide: https://api.openfoam.com/2312/ or https://cpp.openfoam.org/v11/ (Depends on which OpenFOAM fork you are using.).
Krapf is offline   Reply With Quote

Old   February 12, 2024, 03:14
Default
  #3
New Member
 
Martin
Join Date: Jul 2022
Posts: 16
Rep Power: 4
skaal is on a distinguished road
or you could use grep(https://linux.fandom.com/wiki/Grep) on your local OpenFOAM source code ...
skaal is offline   Reply With Quote

Old   February 12, 2024, 06:06
Default
  #4
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,715
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
Quote:
Originally Posted by songyi719 View Post
For example, when I want to analyse what line does, lets say there is line


const face compactFace(identityMap(newFace.size()));


I can guess that I am defining constant face named 'compactFace' and initializing as value identityMap(newFace.size()), where newFace is value given in the code before, so we can guess it will be initialized as identityMap(known value).


But problem here is that identityMap isn't forementioned in this code, so it must have been from other file which header is mentioned at start of the file.


Is there easy way to find origin of such function easily and figure out what these things do? Or is it only way to search for every class file mentioned?



This also looks like someone's special code definition somewhere. I would normally use the Foam identity() function:
Code:
const face compactFace(identity(newFace.size()));
If you go to https://api.openfoam.com/2312/ and type "identity" into the search bar. Currently it returns https://api.openfoam.com/2312/namesp...e588eab475eabf which gives a description:
Code:
  Return an identity map of the given length with (map[i] == i),
works like std::iota() but returning a list of label values.
Optionally with an alternative start index, so that (map[i] == i+start)
olesen is offline   Reply With Quote

Reply

Tags
class, function, header, identitymap, programming


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
Error in enabling the python wrapper Jinn SU2 Installation 2 April 23, 2022 14:52
[Other] mesh airfoil NACA0012 anand_30 OpenFOAM Meshing & Mesh Conversion 13 March 7, 2022 18:22
Map of the OpenFOAM Forum - Understanding where to post your questions! wyldckat OpenFOAM 10 September 2, 2021 06:29
ParaView for OF-1.6-ext Chrisi1984 OpenFOAM Installation 0 December 31, 2010 07:42
Droplet Evaporation Christian Main CFD Forum 2 February 27, 2007 07:27


All times are GMT -4. The time now is 09:33.