Analysis Solution |
Analysis Modeler |
Creating Analysis Features - Part 1Customize an analysis document for Aerodynamic data |
Use Case |
AbstractThis 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. |
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:
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:
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:
A pointer to the document to be customized
The name of the transition to be selected.
CAAAniAeroDTransition is a use case of the CAAAnalysisInterfaces.edu framework that illustrates the CATIA Analysis infrastructure frameworks capabilities.
The goal of this use case is to implement the transition that will produce the images seen previously.
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].
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.
Implement a Transition needs to perform the following steps:
... 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*.
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; ... |
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; ... |
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"); ... |
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; } |
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.
[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] |
Version: 1 [Mar 2000] | Document created |
[Top] |
Copyright © 2000, Dassault Systèmes. All rights reserved.