SDT-base         Contents     Functions         Previous Next     PDF Index

vhandle.nmap

Purpose

Class constructor for SDT name map handle objects.

Description

Examples can be found in d_feplot('TutoVhandle.nmap').

nmap handle objects is a handle to a containers.Map which stores several maps linking names to identifiers. The list of common maps can be found below in the documentation below.

The list of maps stored in nmap can be retrieved with command keys(nmap). The value associated with the nmap key (for example the map named Map:Nodes) is itself a containers.Map used to link names (as keys) with identifiers (as values).

Syntax sdth.urn

To ease operations on these maps, the sdth.urn methods supports a number of overloads. Commands below illustrate main manipulations with sdth.urn methods, applied on the map Map:Nodes

Map:Nodes

This development is still not fully stable and you should look at test examples in d_feplot('vhandle.nmap')

list

Currently defined standard maps are

Call example to give name to element and material properties :

   % Your model is mo1
   % Create an empty nmap if none already there
   mo1.nmap=vhandle.nmap;
   % Material prop name/id list
   matL={...
    'Mat1Name',1
    'Mat2Name',2};
   matM=mo1.nmap('Map:MatName');
   matM.append(matL)
   % Element prop name/id list
   proL={...
    'Pro10Name',10
    'Pro20Name',20};
   proM=mo1.nmap('Map:ProName');
   proM.append(proL)
   % Execute line below to display the entries
   mo1.nmap
   matM
   proM

nmap methods and controller

append,missing

append(m1,m2); Allows merging two maps m1 and m2 into m1 by adding all keys ot the second one m2 to the first one m1. Option missing adds only non-existing entries.

renumber

m1=vhandle.nmap.renumber(m1,shift); performs renumering operations with a shift, on standard nmaps that are associated to node or elements identifiers.

invMap

m2=vhandle.nmap.invMap(m1)

Generates a new nmap with inverted keys and values.

.DeepCopy

m2=vhandle.nmap.DeepCopy(m1) generates a new nmap m2 that is fully decoupled from m1. This is recursive, all nmaps present m1 are also deep copied.

.getStruct

r1=m1.getStruct outputs a structure equivalent for the map m1, its keys must be compatible strings.

.getController()

Provides access to the nmap controller. In particular the controller provides a list of all existing nmaps and allows recovering an nmap object by its uid with its findobj method.

r1=vhandle.nmap; 
r1('test')=5;
r2=vhandle.nmap;

mc=vhandle.nmap.getController();
list=mc.findobj('nmap')

st1=r1.uid;
r3=vhandle.nmap.getController.findobj('nmap',st1)

©1991-2024 by SDTools
Previous Up Next