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

IOField<List<scalar > >

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 6, 2011, 07:38
Default IOField<List<scalar > >
  #1
Senior Member
 
Join Date: Dec 2009
Posts: 112
Rep Power: 16
heavy_user is on a distinguished road
Hey Foamers,

i would like to add some information to my particles.
Therefore I added a member "List<scalar> myList" to myparticle class.
So each instance/particle will have that list.
I would like to write out that data so i tried to add that to the mypartticleClassIO.C file.
When I compile I get an error message and im am stuck right now..
Code:
/// in myParticlesClassIO.C
//this one works:
	  IOField<scalar> m(c.fieldIOobject("m",IOobject::NO_READ),np);
//this one not: 
    	  IOField<List<scalar > >  myList(c.fieldIOobject("myList",IOobject::NO_READ),np);
And i get the error message:

Code:
/opt/openfoam171/src/OpenFOAM/lnInclude/Field.H:87: error: no type named ‘cmptType’ in ‘class Foam::pTraits<Foam::List<double> >’
So two questions:
1.) How do I add a lot of scalars (lets say 50-100) to my particle class, so that i have proper IO ?
2.) If the answer is list, how do I manage the IO?

Thanks!!

Last edited by heavy_user; October 7, 2011 at 10:59.
heavy_user is offline   Reply With Quote

Old   June 19, 2012, 17:29
Default
  #2
Senior Member
 
Hisham's Avatar
 
Hisham Elsafti
Join Date: Apr 2011
Location: Braunschweig, Germany
Posts: 257
Blog Entries: 10
Rep Power: 16
Hisham is on a distinguished road
I hope my response is not too late. I do not know what you need exactly but a scalarField works for the IOField so as vectorField and symmTensorField

Code:
IOField<scalarField> matHistoryScalar(
				      IOobject
				      (
				       ...
				      );

Best Regards
Hisham
Hisham is offline   Reply With Quote

Old   July 24, 2017, 06:03
Default
  #3
New Member
 
Fengli Shen
Join Date: Dec 2016
Posts: 7
Rep Power: 9
qiang92 is on a distinguished road
I also meet the problem right now. Did you solve you problem, I don't want to write Ifstrem to output the data of some variables which it not vetor or scalar defined in OpenFOAM. I create a FixedList<scalar, 5> a, variable a, I can output it through the way IOField.
If you solve your problem, please reply to me. Thanks
qiang92 is offline   Reply With Quote

Old   July 26, 2017, 05:45
Default
  #4
New Member
 
Fengli Shen
Join Date: Dec 2016
Posts: 7
Rep Power: 9
qiang92 is on a distinguished road
I solved my problem using IOList instead of IOField,the full name of the type is IOList<scalarList>
qiang92 is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
1.7.x -> buoyantPimpleFoam -> hRhoThermo -> incompressible and icoPoly3ThermoPhysics? will.logie OpenFOAM Programming & Development 1 February 16, 2011 21:52
1.7.x -> buoyantPimpleFoam -> hRhoThermo -> incompressible and icoPoly3ThermoPhysics? will.logie OpenFOAM 0 December 16, 2010 08:08
CAD -> gMsh -> enGrid -> OpenFOAM Problem AlGates OpenFOAM 7 August 6, 2010 13:46
[Netgen] Geometry > Netgen > OpenFOAM ericnutsch OpenFOAM Meshing & Mesh Conversion 9 February 22, 2010 08:39
Point Data -> Spline -> Iges Tim Franke Main CFD Forum 1 July 6, 2000 13:14


All times are GMT -4. The time now is 12:46.