|
[Sponsors] |
April 15, 2014, 02:21 |
How to access protected variable?
|
#1 |
Member
Manjunath Reddy
Join Date: Jun 2013
Posts: 47
Rep Power: 13 |
Hiiii,
While making Ldumatrix.C in which is in test folder. I'm getting error with this lines UEqnp.addBoundaryDiag(U3Eqnp.diag(), 0); UEqnp.addBoundarySource(U3Eqnp.source(), false); That is /opt/openfoam222/src/finiteVolume/lnInclude/fvMatrix.C:150:6: error: ‘void Foam::fvMatrix<Type>::addBoundarySource(Foam::Fiel d<Type>&, bool) const [with Type = Foam::Vector<double>]’ is protected which is showing addBoundarySource is protected how to access that please help me... Regards Manjunath |
|
October 22, 2015, 08:05 |
|
#2 | |
New Member
Join Date: Oct 2015
Posts: 15
Rep Power: 11 |
Hi Manjunath,
I have the same problem when accessing protected variables with addBoundaryDiag and addBoundarySource. Did you find any information on how to solve it? Regards, --CME Quote:
|
||
October 22, 2015, 10:06 |
|
#3 | |
Senior Member
Matvey Kraposhin
Join Date: Mar 2009
Location: Moscow, Russian Federation
Posts: 355
Rep Power: 21 |
Quote:
Or 2) Create a nested class which inherits base class (fvMatrix)
__________________
MDPI Fluids (Q2) special issue for OSS software: https://www.mdpi.com/journal/fluids/..._modelling_OSS GitHub: https://github.com/unicfdlab Linkedin: https://linkedin.com/in/matvey-kraposhin-413869163 RG: https://www.researchgate.net/profile/Matvey_Kraposhin |
||
October 22, 2015, 10:31 |
|
#4 | ||
New Member
Join Date: Oct 2015
Posts: 15
Rep Power: 11 |
Quote:
Undortunately, my minimal C++ skills are not enopugh to understand it. For this very simple example that does not compile Quote:
Thanks in advance for youe help. Regards, --Carlos |
|||
October 22, 2015, 10:51 |
|
#5 | |||
Senior Member
Matvey Kraposhin
Join Date: Mar 2009
Location: Moscow, Russian Federation
Posts: 355
Rep Power: 21 |
In both cases it is not a trivial task:
1) In the first case you must declare any some function like Quote:
Quote:
2) In the second case you can use inheritace mechanism: Quote:
Any way, you will need a good knowledge of C++
__________________
MDPI Fluids (Q2) special issue for OSS software: https://www.mdpi.com/journal/fluids/..._modelling_OSS GitHub: https://github.com/unicfdlab Linkedin: https://linkedin.com/in/matvey-kraposhin-413869163 RG: https://www.researchgate.net/profile/Matvey_Kraposhin |
||||
October 22, 2015, 11:17 |
|
#6 |
New Member
Join Date: Oct 2015
Posts: 15
Rep Power: 11 |
thanks again mkraposhin
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How access member variable of a boundary condition | Vesposo | OpenFOAM Programming & Development | 1 | March 13, 2014 08:49 |
emag beta feature: charge density | charlotte | CFX | 4 | March 22, 2011 10:14 |
error in COMSOL:'ERROR:6164 Duplicate Variable' | bhushas | COMSOL | 1 | May 30, 2008 05:35 |
Error: access: unbound variable | cfd-novice | FLUENT | 0 | April 3, 2003 05:53 |
Replace periodic by inlet-outlet pair | lego | CFX | 3 | November 5, 2002 21:09 |