|
[Sponsors] |
August 3, 2020, 10:15 |
Foam::DynamicList<Type>.append( new Type );
|
#1 |
Senior Member
Gerry Kan
Join Date: May 2016
Posts: 350
Rep Power: 10 |
Howdy Foamers:
I have a C++ question. I think I know the answer empirically, but I don't know if my conception is correct. I have created a DynamicList of some data type (let's call it "Type"). Its starts off with zero elements and I would like to append new terms in it. Currently I would have to declare a new instance in a dummy variable of this "Type" and append this into the list: Code:
Foam::DynamicList<Type> myList(0); Type dummy; myList.append ( dummy ); Code:
Foam::DynamicList<Type> myList(0); myList.append ( new Type ); Thanks in advance, Gerry. Last edited by Gerry Kan; August 4, 2020 at 03:20. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
2DOF Planning hull resistance study with overset | CFD_fan | OpenFOAM Running, Solving & CFD | 7 | July 13, 2021 05:03 |
[OpenFOAM.org] compile error in dynamicMesh and thermophysicalModels libraries | NickG | OpenFOAM Installation | 3 | December 30, 2019 00:21 |
rhoPimpleFoam hardship | petrus | OpenFOAM Running, Solving & CFD | 0 | October 7, 2016 02:41 |
interFoam/kOmegaSST tank filling with printStackError/Mules | simpomann | OpenFOAM Running, Solving & CFD | 3 | February 17, 2014 17:06 |
[swak4Foam] Air Conditioned room groovyBC | Sebaj | OpenFOAM Community Contributions | 7 | October 31, 2012 14:16 |