|
[Sponsors] |
March 16, 2022, 09:13 |
Error using lookupObject()
|
#1 |
Member
Join Date: Jun 2020
Posts: 49
Rep Power: 5 |
Hi everyone,
I am working on a modified Version of the PaSR combustion model. In that I need to access a volScalarField which is being generated by my solver called "f". I am trying to do this using the code Code:
const volScalarField& F = this->mesh().lookupObject<volScalarField>("f"); Code:
Error: Expected primary-expression before ">" token Thank you very much! |
|
March 16, 2022, 10:52 |
|
#2 |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,686
Rep Power: 40 |
Check that you have "volFields.H" included somewhere, it could be that it simply does not know what volScalarField is in your chunk of code.
|
|
March 23, 2022, 03:21 |
|
#3 | |
Member
Join Date: Jun 2020
Posts: 49
Rep Power: 5 |
Quote:
PaSR combustion model allready uses references to other volScalarFields, but those are stored in the turbulence model and can be accessed differently. |
||
March 23, 2022, 03:51 |
|
#4 |
Member
Join Date: Jun 2020
Posts: 49
Rep Power: 5 |
Ok, I seemingly managed to solve the problem.
When I change the code to Code:
const volScalarField& F = this->mesh().objectRegistry::lookupObject<volScalarField>("f"); Problem with lookupObject functionality I still don't understand the issue, as my C++ knowledge is very slim, but maybe this helps others who encounter this problem. |
|
Tags |
lookupobject |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Problem with lookupObject functionality | Tobi | OpenFOAM Programming & Development | 9 | May 19, 2021 05:46 |
Accessing old fields: lookupObject at user defined time | em17 | OpenFOAM Programming & Development | 4 | October 7, 2019 07:10 |
Question about lookupObject function | NewKid | OpenFOAM Programming & Development | 13 | February 14, 2019 03:32 |
lookupObject | nimasam | OpenFOAM Running, Solving & CFD | 3 | June 15, 2012 12:23 |
lookupObject | nimasam | OpenFOAM Bugs | 0 | July 3, 2011 07:55 |