Back to index

salome-smesh  6.5.0
Namespaces | Functions | Variables
spadderpy Namespace Reference

Namespaces

namespace  configreader
namespace  gui

Functions

def getRootDir
def getTestDataDir
def getMeshJobParameterList
def getSpadderCatalogFilename
def loadSpadderCatalog

Variables

tuple DEFAULT_CONCRETE_FILENAME = os.path.join(getTestDataDir(),'concrete.med')
list DEFAULT_STEELBAR_LISTFILENAME

Function Documentation

def spadderpy.getMeshJobParameterList (   concrete_filename = DEFAULT_CONCRETE_FILENAME,
  steelbar_listfilename = DEFAULT_STEELBAR_LISTFILENAME 
)
This helper function creates a complete set of parameters (a
MeshJobParameterList) for a simple test case, i.e. a case with a
concrete filename and a single steelbar filename.

Definition at line 49 of file __init__.py.

00049 
00050                             steelbar_listfilename=DEFAULT_STEELBAR_LISTFILENAME):
00051     '''
00052     This helper function creates a complete set of parameters (a
00053     MeshJobParameterList) for a simple test case, i.e. a case with a
00054     concrete filename and a single steelbar filename.
00055     '''
00056     # Note that a CORBA sequence (MeshJobParameterList) is mapped on a
00057     # simple list in python
00058     meshJobParameterList = []
00059     # We can add some parameters
00060     param = MeshJobParameter(
00061         file_name  = concrete_filename,
00062         file_type  = MESHJOB.MED_CONCRETE,
00063         group_name = "concrete")
00064     meshJobParameterList.append(param)
00065 
00066     for steelbar_filename in steelbar_listfilename:
00067         param = MeshJobParameter(
00068             file_name  = steelbar_filename,
00069             file_type  = MESHJOB.MED_STEELBAR,
00070             group_name = "steelbar")
00071         meshJobParameterList.append(param)
00072 
00073     return meshJobParameterList
00074 

This returns the root directory where the module SPADDER is
installed. All test files are looked up from this location.

Definition at line 25 of file __init__.py.

00025 
00026 def getRootDir():
00027     '''
00028     This returns the root directory where the module SPADDER is
00029     installed. All test files are looked up from this location.
00030     '''
00031     return os.environ['SMESH_ROOT_DIR']

Here is the caller graph for this function:

Definition at line 75 of file __init__.py.

00075 
00076 def getSpadderCatalogFilename():
00077     filename=os.path.join(getRootDir(),"share/salome/resources/smesh/SPADDERCatalog.xml")
00078     return filename

Here is the call graph for this function:

Here is the caller graph for this function:

This function gives the absolute path to the directory containing
the data files for test (realistic med files).

Definition at line 32 of file __init__.py.

00032 
00033 def getTestDataDir():
00034     '''
00035     This function gives the absolute path to the directory containing
00036     the data files for test (realistic med files).
00037     '''
00038     datadir=os.path.join(getRootDir(),"share/salome/resources/smesh/padderexe")
00039     return datadir

Here is the call graph for this function:

Definition at line 79 of file __init__.py.

00079 
00080 def loadSpadderCatalog():
00081     import salome
00082     salome.salome_init()
00083     obj = salome.naming_service.Resolve('Kernel/ModulCatalog')
00084     import SALOME_ModuleCatalog
00085     catalog = obj._narrow(SALOME_ModuleCatalog.ModuleCatalog)
00086     if not catalog:
00087         raise RuntimeError, "Can't accesss module catalog"
00088 
00089     filename = getSpadderCatalogFilename()
00090     catalog.ImportXmlCatalogFile(filename)
00091 
00092     from salome.kernel import services
00093     print "The list of SALOME components is now:" 
00094     print services.getComponentList()

Here is the call graph for this function:


Variable Documentation

tuple spadderpy.DEFAULT_CONCRETE_FILENAME = os.path.join(getTestDataDir(),'concrete.med')

Definition at line 43 of file __init__.py.

Initial value:
00001 [
00002     os.path.join(getTestDataDir(),'ferraill.med')
00003     ]

Definition at line 44 of file __init__.py.