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(); //Create a new instance of database

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





	

	// allocate the CPO structures
    cpoArray.array.resize(number);
    //Fill some fields of the CPO arrayinstances
    for(int k = 0; k < number; k++)
    {
           cpoArray(k).codeparam.parameters.assign("xmltoken");
            //Never forget to store the time for time dependent CPOs!!
            cpoArray(k).time = k;
    }
    //Now the CPO array is filled, we store in the database via method put()
    cpoArray.put();
    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();
	 //
	//! Fill the ids fields with data
  	IdsNs::IDS::core_profiles ids= imas._core_profiles;
	
	//! Mandatory to define this property
	ids.ids_properties.homogeneous_time = 1; 
	
	//! Fill Mandatorythe toids definefields thiswith propertydata
	ids.ids_properties.comment = "This is a test ids V3 Put by C++";

	// allocate the CPO structures
	ids.time.resize(10number);
	ids.global_quantities.ip.resize(10number);
	for(int i=0; i < 10number; i++)
	{
  		ids.global_quantities.ip(i) = i * 10 ;
  		ids.time(i) = i;
	}
 	printf("\nStart Putting the core_profiles IDS\n");
 	ids.put();
 	
 	imas.close();
}

...