Opened 19 years ago

Closed 19 years ago

Last modified 17 years ago

#14 closed defect (invalid)

Fatal error after calling Common::Parameter::ICapeParameterSpec::Type()

Reported by: gogolenk Owned by: miha
Priority: major Milestone:
Component: DianaKernel Version:
Severity: fatal Keywords:
Cc:

Description

After calling of par->Type() in this simple code on my PC occured fatal error. Furthermore bounds of real parameters of model "HafkeReactor?" initialized incorrect.

#include <iostream>
#include <CapeOpen.hpp>
#include <Diana.hpp>


using namespace Common::Types;
using namespace Common::Error;
using namespace Numeric::Solvers::Eso;
using namespace Numeric::Solvers::Model;
using namespace Numeric::Solvers::Solver;
using namespace Diana;

int main(int argc,char **argv) {
    int ierr, i;

    try {
	// create DianaMain object
	Common::Types::CapeArrayString args;
	IDianaMain* dmain=GetDianaMain(args);

	// get solver factory & genetic optimizer
	ICapeNumericSolverFactory* sfactory=dmain->GetSolverFactory();

	ICapeNumericModelManager * mm=dmain->GetModelManager();
	ICapeNumericContinuousModel* model=dynamic_cast<DianaContinuousModel*>(mm->CreateModel(CAPE_CONTINUOUS, "../models/HafkeReactor/HafkeReactor.so"));
	model->Initialize();
	ICapeNumericESO* eso=dynamic_cast<DianaDAESO*>(model->GetActiveESO());
	eso->Initialize();

	ICapeCollection* collESOPars = dynamic_cast<IDianaDAESO*>(model->GetActiveESO())->GetParameters();     /* Pointer to ESO parameters*/
	const Common::Parameter::ICapeRealParameterSpec* par = static_cast<Common::Parameter::ICapeRealParameterSpec*>(collESOPars->ItemByIndex(0));

	std::cerr<<*collESOPars<<std::endl;

	std::cerr << par->Type() << std::endl;

    } catch(ECapeUser& exc) {
	std::cerr << "Init test: " << exc <<  std::endl;
    } catch(std::bad_alloc& e) {
	std::cerr<<"bad_alloc"<<std::endl;
    } catch(...) {
	std::cerr<<"other exception"<<std::endl;
    }
    return 0;
}

Change History (2)

comment:1 Changed 19 years ago by miha

  • Resolution set to invalid
  • Status changed from new to closed

comment:2 Changed 17 years ago by rempel

  • Milestone Promot 1.0 deleted
Note: See TracTickets for help on using tickets.