Analysis Solution

Analysis Modeler

Creating Analysis StartUp's

Create Analysis StartUp's and store them in a catalog
Use Case

Abstract

This article accompanies the CAAAniCatalog use case and explains how to generate some StartUp's stored in a catalog. This  step includes the AeroMeshPart and AeroDynamicSet definition. This step is the preliminary one for all analysis feature creation.


What You Will Learn With This Use Case

This use case is intended to help you generate a feature catalog file containing some Analysis Startup's. This use case will include the AeroDynamic features required for the Aero dynamic import sample.

More specifically, the CAAAniCatalog use case shows how to:

[Top]

The Analysis Modeler StartUp and the StartUp Catalog

Two features need to be created:

Both objects to be created will be features [1]. They are the support for specification definition. The MSHPart intent is to keep the meshing specification and the Solution Set will support the access to the result. It is designed as a set to access to the aerodynamic physics in a Analysis document. Indeed, both must be persistent, must have a name and some attributes, can be integrated to an update engine, and must behave according to the default analysis behavior.

About StartUps and Features

A StartUp is a feature stored in a catalog. It can be instantiated and enriched to create features. When creating a new StartUp, you have to answer two main questions:

  1. How does it integrate among existing features?
  2. Which attributes does it need?

Because the AeroMeshPart need to be considered as a mesher (Meshing algorithm) specification, it is strongly recommended to make it derive from a Analysis Modeler StartUp representing an Arena on meshing and having the capability to be integrated inside the update mechanism. For this we will use the MESHPart Startup.

Since an AeroDynamicSet is a support to access result files of analysis data, it is strongly recommended to make it derive from a Analysis Modeler StartUp representing a set. Two categories of sets exist: the AnalysisSet and the SolutionSet. AnalysisSet is dedicated to support preprocessing data and SolutionSet is for post processing data. Also, SolutionSet is built by derivation of AnalysisSet and have the capability to know the case in with it is defined.

Consequently, MSHPart and SolutionSet are the good candidates.

The following figure represents the AeroDynamicSet StartUp inheritance tree.

The AeroDynamicSet StartUp derives from the SolutionSet StartUp.

[Top]

The StartUp Attributes

No specific attributes are required for the AeroMeshPart startup. We will use the Get/Set Support methods in order to keep at this feature level a link to the input file.

Now that you have met the parents of the AeroDynamicSet StartUp, you still have to define its own attributes. These attributes will be added to those inherited from its ancestors.

One attribute inherited from SolutionSet and that will be set at the level of the AeroDynamicSet StartUp is PhysicalType. This will drive the default creation of the Explicit Set in the Field model. The other attribute which is proprietary of the AeroDynamicSet StartUp is the link to the result file. This will be done by using the "SAMBCFileAccess" basiccomponent definition. This feature is designed for such capability and will provide automatically some user interface for the AeroDynamicSet. Also, all the data management is done by using the CATISamBasicComponent Interface.

This functionality can be also achieved by defining an attribute ExternalFile designed as tk_external, that is, as a symbolic link to this file, is this case the user interface may have been provided by implementing the CATIEdit interface on the AeroDynamicSet.

[Top]

The StartUp Catalog

Once defined the features StartUp's inheritance and attributes, you are ready to generate the CAAAniCatalog catalog file that will contain the AeroDynamic Feature's initial definition.

Catalogs are particular files in which StartUps are created, enhanced with new attributes, and stored. These StartUps are then instantiated into run time instances.

Here is a figure representing what will the catalog file where the AeroDynamicSet StartUp is created looks like:

You can see the AroMeshPart and AeroDynamicSet StartUp - named with an extention "_CAAAniCatalog" - included in the catalog file. Under the catalogManager, a link that is not displayed is also kept to the prerequisite catalogs that are used for derivation.

This initial StartUp will be used each time you will need to create a new Instance. This operation is called "instantiation". For this, once your catalog is loaded in memory, you need to use the corresponding  factory interface:

[Top]

The CAAAniCatalog Use Case

CAAAniCatalog is a use case of the CAAAnalysisInterfaces.edu framework that illustrates the CATIA Analysis modeler frameworks capabilities.

What Does CAAAniCatalog Do

The goal of this use case is to create  new StartUp by deriving the existing one and to generate the Catalog File containing them. For this, all the required methods are included inside the CATSamCatalogFactory. You do not have to manage prerequisite catalog knowledge or the exact attribute names used for the modelisation.

The main methods to use inside this include are:

More specifically, the CAAAniCatalog use case shows how to:

How to Launch CAAAniCatalog

To launch CAAAniCatalog, you will need to set up the build time environment, then compile CAAAniCatalog along with its prerequisites, set up the run time environment, and then execute the use case [2]. Launch CAAAniCatalog as follows:

Windows CAAAniCatalog InstallRootDirectory\intel_a\resources\graphic\CAAAniCatalog.CATfct
AIX CAAAniCatalog InstallRootDirectory/aix_a/resources/graphic/CAAAniCatalog.CATfct
HP-UX CAAAniCatalog InstallRootDirectory/hpux_a/resources/graphic/CAAAniCatalog.CATfct
Solaris CAAAniCatalog InstallRootDirectory/solaris_a/resources/graphic/CAAAniCatalog.CATfct

where InstallRootDirectory is the directory where the CAA CD-ROM is installed.

[Top]

Where to Find the CAAAniCatalog Code

CAAAniCatalog code is located in the CAAAniCatalog.m use case module of the CAAAnalysisInterfaces.edu framework:

Windows InstallRootDirectory\CAAAnalysisInterfaces.edu\CAAAniCatalog.m\
Unix InstallRootDirectory/CAAAnalysisInterfaces.edu/CAAAniCatalog.m/

where InstallRootDirectory is the directory where the CAA CD-ROM is installed. It is made of a unique source file named CAAAniCatalog.cpp.

[Top]

Step-by-Step

There are seven logical sections in CAAAniCatalog.m. We will now comment each of those sections by looking at the code.

[Top]

Prolog

The use case begins by creating a session [1].

[Top]

Creating the StartUp Catalog

...
CATICatalog *piCatalog = NULL;
CATUnicodeString storageName = argv[1];
rc = ::CreateCatalog(&storageName, &piCatalog);
...

The CreateCatalog global function creates a StartUp catalog using the pathname passed as an argument of the use case and returns the created StartUp catalog as a pointer to CATICatalog. If the CATfct suffix were omitted in the pathname, it would be automatically added.

[Top]

Adding a Client Identification to the StartUp Catalog

...
CATUnicodeString clientId("CAAAniCatalog");
rc = piCatalog -> SetClientId(&clientId);
...

A StartUp catalog cannot be used without any client identification. This client identification is a CATUnicodeString instance set using the SetClienId method of CATICatalog.

[Top]

Creating the AeroDynamicSet StartUp

...
CATBaseUnknown *pAeroSU = NULL;
CATUnicodeString AeroSUType("AeroDynamicSet");
CATUnicodeString SolutionSUType("SolutionSet");
rc = CATSamCatalogFactory::CreateAnalysisSet (&AeroSUType,&SolutionSUType,&pAeroSU,&piCatalog);

CATISpecObject *piSpecAeroSU = (CATISpecObject*) pAeroSU;
pAeroSU -> Release();
...

The AeroDynamicSet StartUp is created using the CATSamCatalogFactory::CreateAnalysisSet method in the new catalog CAAAniCatalog. The parameters of this method are:

This StartUp derives from the StartUp "SolutionSet" found in the existing catalog we just loaded. The new StartUp is created using the CreateSUInCatalog method of CATICatalog.  This method takes as arguments:

Note that the pointer to the created StartUp must nevertheless be cast to CATISpecObject.

[Top]

Adding Attributes to the StartUp

It is now time to assign a value to the inherited PhysicalType attribute, and to create a new attribute named ExternalFile.

...
// Valuate PhysicalType attribute
CATUnicodeString PType("AERODYNAMICS_STEADY_STATE");
CATSamCatalogFactory::SetPhysicalType(pAeroSU, &PType);

// Define  ExternalFile attribute : Create New Startup of SAMBCFileAccess BasicComponent

CATUnicodeString NewBCType("ANIFileLink");
CATUnicodeString DeriveBCType("SAMBCFileAccess");
CATBaseUnknown * piOut = NULL;
CATSamCatalogFactory::CreateBasicComponent (&NewBCType,&DeriveBCType,&piOut,&piCatalog);
if (piOut)
{
   CATISamBasicComponent_var spComponent(piOut);
   if (!!spComponent)
   {
// Valuate the External file attributethat defined the type of files to select:
//      spComponent -> SetStringValue("print;fif","LinkType"); // Example for Multi file extension selection
     spComponent -> SetStringValue("print","LinkType");
   }
   piOut -> Release();
}
// Associate the Basicomponent as a parameter of the set
  CATISamAnalysisSet *piAnalysisSet =NULL;
  pAeroSU -> QueryInterface(IID_CATISamAnalysisSet,(void **)& piAnalysisSet);
  if (piAnalysisSet)
  {
    piAnalysisSet -> AddBasicComponent("ANIFileLink","ANIFileLink");
    piAnalysisSet -> Release();
  }

...

The physical type attribute is common to all Analysis feature, to set it in the catalog file the CATSamCatalogFactory::SetPhysicalType method may be used. This method uses the pointer on the created startup set as a CATISpecObject and the CATUnicodeString that represent the the physical type.

To create a new attribute, use the existing pointer to CATISpecObject onto the StartUp to retrieve the CATISamAnalysisSet interface pointer, and use the AddBasicComponent method. This method will instantiate the SAMBCFileAccess with a customized name defined as ANIFileLink. The" LinkType" attribute is also prevaluated in order to set up the kind of file that can be linked by the basic component.

Note that it is important to define a new startup of the basic component in order to define an NLS Customization and to valuate some private attributes at the level of the statup (in this case, the LinkType attribute).

[Top]

Creating the AeroMeshPart StartUp

...
CCATBaseUnknown *pMpAeroSU = NULL;
CATUnicodeString MPType("AeroMeshPart");
rc = CATSamCatalogFactory::CreateMSHPart (&MPType,&pMpAeroSU,&piCatalog);

if (NULL == pMpAeroSU) 
{
    cout << "ERROR in creating Mesh Part StartUp" << endl << flush;
    piCatalog -> Release();
    return 3;
}
else cout << "Mesh Part StartUp created OK" << endl << flush;
//
CATISpecObject *piMshMart = (CATISpecObject*) pMpAeroSU;
if ( NULL != piMshMart)
{
   CATISpecAttribute * Attribute = piMshMart->AddAttribute("InputLink",tk_specobject,sp_IN);
   if (Attribute) Attribute-> Release();Attribute = NULL;
}
...

The AeroMeshPartStartUp is created using the CATSamCatalogFactory::CreateMSHPart method in the new catalog CAAAniCatalog. This is the same kind on method as for the AeroDynamic Set. The parameters of this method are:

Also this new startup is completed by an attribute InputLink defined as tk_specobject that will keep the link to the Import feature.

[Top]

Epilog

The StartUp catalog is saved as any StartUp catalog by retrieving a CATILinkableObject pointer onto the StartUp catalog, retrieving a CATDocument instance from this pointer, saving the document, and deleting the session [1].

...
//===============================================================================
// Save the catalog and delete the session.
//===============================================================================
if (piCatalog)
{
  rc = ::SaveCatalog(&piCatalog,&storageName);
  if (piCatalog) piCatalog -> Release();
  piCatalog = NULL;
}
if (FAILED(rc))
{
  cout << "ERROR in saving catalog document" << endl << flush;
  return 2;
}
//===============================================================================
// Delete session
//===============================================================================
rc = ::Delete_Session(sessionName);
if (FAILED(rc))
{
  cout << "ERROR in deleting session" << endl << flush;
  return 1;
}
...

[Top]

In Short

This use case has demonstrated how to create some Analysis StartUp's in the newly created CAAAniCatalog catalog. All kinds of Analysis StartUps can be created using the same process.

This StartUp will later be used to instantiate this features inside an Analysis document. These tasks are described in next use cases [4].

[Top]


References

[1] Feature Modeler
[2] Building and Launching a CAA V5 Use Case
[3] Analysis Modeler Overview
[4] Integrate new Feature inside Analysis
[Top]

History

Version: 1 [Sep 2000] Document created
[Top]

Copyright © 2000, Dassault Systèmes. All rights reserved.