Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

put() CPO vs IDS
Code Block
languagecpp
titleITM
linenumberstrue
#include "UALClasses.h"
using namespace ItmNs;

int main(int argc, char *argv[])
{
	int number = 10; //number of elements
	
	//Create a new instance of database
    ItmNs::Itm itm(123, 1, 123, 1);
    itm.create(); 

  	ItmNs::Itm::equilibriumArray cpoArray = itm._equilibriumArray;





	

	// allocate the CPO structures
    cpoArray.array.resize(number);
    




	//Fill someCPO fields of the CPO arrayinstances
    for(int k = 0; k < number; k++)
    {
           		cpoArray(k).codeparam.parameters.assign("xmltoken")x.y = VALUE;
            
		//Never forgetDo tonot store theforget time for time dependent CPOs!!
            cpoArray(k).time = kTIME;
    }

    	//Now the CPO array is filled, we storeSave data in the database via method put()
    cpoArray.put();
	
	// Close the pulse file
 	itm.close();
}
Code Block
languagecpp
titleIMAS
linenumberstrue
#include "UALClasses.h"
using namespace IdsNs;

int main(int argc, char *argv[])
{
	int number = 10; //number of elements

	//Create a new instance of database
  	IdsNs::IDS imas(123, 1, 123, 1);
  	imas.create();
	
  	IdsNs::IDS::core_profiles ids= imas._core_profiles;
	
	//! Mandatory to define this property
	ids.ids_properties.homogeneous_time = 1; 
	
	//! Fillallocate the CPO structures
	ids.time.resize(number);
	ids fields with data.global_quantities.ip.resize(number);

	// Fill IDS time-independent fields
	ids.ids_properties.comment = "This is a test Test ids V3 Putput by C++";
	
	// allocateFill theIDS CPOtime-dependent structures
	ids.time.resize(number);
	ids.global_quantities.ip.resize(number);
	fields
 	for(int i=0; i < number; i++)
	{
  		ids.global_quantitiesx.ipy(i) = VALUE(i * 10 ;
  ) ;
		
		// Do not forget time!!
 		ids.time(i) = iTIME;
	}
 	printf("\nStart Putting the core_profiles IDS\n");	
	// Save data in the database
 	ids.put();
 	
	// Close the pulse file
 	imas.close();
}

 

 

3.2.3 CPO/IDS putSlice

...