Analysis Solution

Analysis Modeler

Creating Analysis Features - Part 1

Customize an analysis document for Aerodynamic data

Use Case

Abstract

This article accompanies the Analysis New FeatureOverview technical article.

This use case explains how to instantiate the Aero-dynamic Set Startup inside an analysis document and implement all required interfaces in order to integrate it inside the analysis infrastructure and display its content as an image. After the CAAAniCatalog generation, this use case will focus on the implementation of an analysis transition. This step will customize the analysis document for Aero-dynamic data scenario. All the files and physical data that are included in this scenario are dummy data.


What You Will Learn With This Use Case

This use case is intended to help you to customize an analysis document. For this, we will put in place all the necessary data useful for the scenario:

[Top]

About Analysis Workbench Transition.

A transition is an interface that allow to customize an analysis document. It can be seen as a document startup (conception model) that allow you to create all prerequisite data for a given scenario. By default, without any transition, the analysis document specification tree will look like the following figure.

This transition is automatically called by a Workbench's initialization as the "New Analysis Case" window. For this, the workbench needs to be built on the basic one provided by Analysis Infrastructure called CATISamWorkshop. The "CATISamAnalysisTransition" interface is the appropriate interface for this customization. Each Workbench's may decide the kind of transition that it may allow, if a new Workbench needs to be created, refer to

After implementing this transition, the user interface will follow the next steps:

Selected Line correspond to the implementation of a new transition done in sample. The transition is define by it's name as defined in the implementation.

Note that if your workbench allows only on transition, this user interaction will not be displayed and the transition will be run automatically.

This is the specification tree of an Analysis Document if no transition is implemented.
This is the specification tree of an Analysis Document after executing the Transition of the sample. It creates a new case and the Aero Dynamic Solution Set.

Note: A transition is not limited to interactive use. If you need to use them in batch mode, use the CATSamTransitionSetup method that will build the associated object to the transition and run it on a document. For this, you can write some code that will look like:

...
#include "CATSamTransitionSetup.h"
  
CATDocument *pDoc; // Pointer on the document to be customized.
rc = ::CATSamTransitionSetup (pDoc,"AeroDynamic");
...

The method have two input arguments:

[Top]

The CAAAniAeroDTransition Use Case

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

What Does CAAAniAeroDTransition Do

The goal of this use case is to implement the transition that will produce the images seen previously.

[Top]

How to Launch CAAAniAeroDTransition

Compile the code, use the mkcreateruntimeview command in order to setup properly the environment. The module generated is a Shared Library. All this module have to be compiled in order to be taken into account for CATIA Interactive applications. This will customize the user interface of Analysis Workbenches by adding an Aero Dynamic line in the "New Analysis Case" window. You can also enter an Analysis Workbench by creating a new Analysis Document, the same window will appear. For additional information's, refer to [5].

[Top]

Where to Find the CAAAniAeroDTransition Code

The CAAAniAeroDTransition use case is located in the CAAAniAeroDTransition.m module of the CAAAnalysisInterfaces.edu framework:

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

where InstallRootDirectory is the directory where the CAA CD-ROM is installed. Only the cpp file CAAAniAeroDynamicTransition and its associated include are necessary.

[Top]

Step-by-Step

Implement a Transition needs to perform the following steps:

[Top]

Defining a New Implementation

...
CATImplementClass(CAAAniAeroDynamicTransition,CodeExtension,CATBaseUnknown,AeroDynamic);
  
// Tie the implementation to its interface
// ---------------------------------------
#include "TIE_CATISamAnalysisTransition.h"
TIE_CATISamAnalysisTransition( CAAAniAeroDynamicTransition);

//-----------------------------------------------------------------------------
// Implements CATISamAnalysisTransition::ExecuteTransition
//-----------------------------------------------------------------------------
HRESULT CAAAniAeroDynamicTransition::ExecuteTransition (const CATDocument* iDocument)
{
  ...
}
...

Associated to this setup of code must be defined inside the Object Modeler Dictionary. See CAAAnalysisInterfaces.edu.dico file defined in CAAAnalysisInterfaces.edu\CNEXT\code\dictionary. This definition line associates the AeroDynamic implementation of CATISamAnalysisTransition interface inside the shared library libCAAAniAeroDTransition

AeroDynamic  CATISamAnalysisTransition  libCAAAniAeroDTransition

Only one method needs to be implemented ExecuteTransition. This method has as an input a pointer to the current CATAnalysis document defined as a CATDocument*.

[Top]

Loading the Catalog

The catalog defining the startup must be loaded in memory in order to create the feature instance. This catalog is stored in a path that should point to a resources/graphic directory.

From the pointer to the CATDocument, we have to retrieve the Analysis Container that allow to load the applicative catalog by using the AccessCatalog of the CATCatalogFactoryServices include of services.

  ...
//===================================================================================
// Looking for Analysis Container
CATISamAccess_var spAccess((CATBaseUnknown*)iDocument);
CATIContainer* piCont = NULL;
spAccess->GetSpecContainer(piCont);
if (NULL == piCont) return (hr);
//===================================================================================
// Load the Feature Catalog for Startup On the CATIContainer
CATICatalog * pcatalog = NULL;
CATUnicodeString CataName ("CAAAniCatalog.CATfct");
CATUnicodeString CataId   ("CAAAniCatalog");

AccessCatalog(&CataName,&CataId,piCont,&pcatalog);
if (pcatalog)   pcatalog   -> Release();
pcatalog = NULL;

  ...

[Top]

Retrieving in the Document the Analysis Factory and Analysis Manager

The factory is useful for the feature creation. (Creation of the Case and Aero Dynamic Set). The Analysis Manager allows to retrieve the Finite element Model (Analysis Model) in order to associate the Case to this feature.

...
//===================================================================================
// Looking for CATISamAnalysisContainer Manager's adhesion
CATISamAnalysisContainer_var spAnalysisCont(piCont);
if(NULL_var == spAnalysisCont) return (hr);
CATISamAnalysisManager_var spManager = NULL_var;
hr = spAnalysisCont->GetAnalysisManager(spManager);
//===================================================================================
// Looking for CATISamAnalysisModelFactory  adhesion for st creation
CATISamAnalysisModelFactory_var spFactory = piCont;
piCont -> Release (); piCont = NULL;	
...

[Top]

Creating a New Case

The output set may be created in a case. For this, use the CreateAnalysisCase method of the CATISamAnalysisModelFactory interface. This method will take as input argument the name of the case and return a pointer on a CATISamAnalysisCase. The case is associated to an analysis model by using the SetWorkingModel of the CATISamAnalysisCase. To customize the case, the SetSolver method is used.

...
// Create a new case
//================================================================
CATUnicodeString caseName("Aero Case");
CATISamAnalysisCase* piCase = spFactory->CreateAnalysisCase(caseName);
if(NULL == piCase) return E_FAIL;
// Attach the Case under the FEM Model

CATISpecObject* piFEMModel = NULL;
hr = spManager->GetCurrentModel(piFEMModel);
if( NULL == piFEMModel)  return E_FAIL;
CATISamAnalysisModel_var spAnalysisModel(piFEMModel);
spAnalysisModel->AddCase(piCase);
piCase->SetWorkingModel(piFEMModel);
piCase->SetSolver("Aero_Solver");
...

[Top]

Creating the AeroDynamicSet Instance

The Set is instantiated by using the CreateUserSet method of the CATISamAnalysisModelFactory interface. This method will return a pointer on a CATISamAnalysisSet. The input Arguments are used as follow:

CreateUserSet("AeroDynamicSet" Feature type
"AERO DYNAMIC Solution Set" Name of the feature (If Blank, Nls name is built according to the CATNls File).
piFEMModel); Pointer on the Analysis model father of the new feature
...
//===================================================================================
// Creation of solution as output of the analysis case
CATISamAnalysisScan_var spScan(piCase);
CATISamAnalysisSet* piSet = NULL;
// Creating the solution set
piSet = spFactory->CreateUserSet("AeroDynamicSet",   // Solution Type  
			     "",                 // Identifier
			     piFEMModel);
if(piSet)
{
// The created set must be referenced as an output of the AnalysisCase
  hr = spScan->AddSet(piSet,Sam_OUT);
  if (!SUCCEEDED(hr)) return E_FAIL ;
  CATISamSolution_var spSolution(piSet);
  if(NULL_var != spSolution) spSolution->SetCase(piCase);
  piSet->Release(); piSet = NULL;
}
piCase -> Release (); piCase = NULL;
piFEMModel -> Release (); piFEMModel= NULL;

}

[Top]


In Short

This use case has demonstrated how to instantiate the Aero-Dynamic Set Feature's in an Analysis document. All kind of Analysis feature can be done by using the same overview. Next step is to implement some physics behavior on this instance.

[Top]


References

[1] Feature Modeler documentation
[2] Analysis Modeler Overview
[3] Integrate new Feature inside Analysis.
[4] Building and Launching a CAA V5 Use Case
[5] Creating a New Analysis Workbench
[Top]

History

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

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