|
[Sponsors] |
May 30, 2013, 08:33 |
Combining 2 scalarList into scalarListList?
|
#1 |
New Member
Kie Hian
Join Date: Aug 2011
Location: Singapore
Posts: 19
Rep Power: 15 |
Dear foamers,
This might be more of a C++ question... I've got a function that is supposed to return List that is made up of 2 scalarLists, i.e. scalarListList dsf(2) whereby dsf[0] = scalarList dsf0 and dsf[1] = scalarList dsf1 My code extract is as follows: Code:
scalarListList testMesh::calcDSF ( const scalar xi_ , const scalar eta_ ) const { Info<<"Calculating shape functions derivatives"<<endl; scalarList dSfdXi(8); scalarList dSfdEta(8); scalarListList dsf(2); // calculate shape func derivative wrt to Xi: dSfdXi dSfdXi[0] = .................... ........ dSfdXi[7] = ........................; // calculate shape func derivative wrt to eta: dSfdEta dSfdEta[0] = ...............; .............. dSfdEta[7] = ............; dsf[0] = dSfdXi; dsf[1] = dSfdEta; return dsf; } My objective is to create a 2 x 8 matrix where the 1st column stores the dSfdXi values and the 2nd column the dSfdEta values (for calculating jacobian, transforming to parametric coordinates). Any ideas or alternative implementation (instead of using OF's Lists) would be much appreciated! Thanks! ckh |
|
May 30, 2013, 10:39 |
|
#2 |
New Member
Kie Hian
Join Date: Aug 2011
Location: Singapore
Posts: 19
Rep Power: 15 |
Doing a more thorough search through the forums, I believe an autoPtr might be needed, i.e.
Code:
List< autoPtr<scalarList> > dsf(2); dsf[0].setSize(8); dsf[0][0] = /* some code to calculate each of the dSfdXi... ... dsf[0][7] = .... */ dsf[1].setSize(8); dsf[1][0] = /* some more code to calculate each of the dSfdEta... ... dsf[1][7] = .... */ Thanks in advance! ckh |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Combining CFD-Post Report Information | fatirishman53 | ANSYS | 0 | October 14, 2012 15:59 |
[blockMesh] A script for combining two blockMeshDict | yingfeng | OpenFOAM Meshing & Mesh Conversion | 0 | August 26, 2009 17:05 |
combining dynamic mesh functions | sean_mcintyre | OpenFOAM Running, Solving & CFD | 0 | August 3, 2009 15:52 |
Combining BCs: wall - outlet. Boundary layer disappears | MartinaF | OpenFOAM Running, Solving & CFD | 1 | July 20, 2009 19:14 |
Combining Transient results after a backup | Dre | CFX | 9 | February 18, 2008 09:43 |