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')

  • set the correspondence between node names and values using a structure
     mo1=sdth.urn('nmap.Node.set',mo1,struct('value',1:4,'ID',{{'A','B','C','D'}}));
    
  • set using a list of strings giving ID:name
     mo1=sdth.urn('nmap.Node.set',mo1,{'1:A','2:B'});
    
  • get from map nodes, names or simply display with no output argument
     [n1,name]=sdth.urn... % get node and name
               sdt.urn ... % display names and nodes in the console
     % Without output, display in console : NodeName = Nodeid, matid proid gid, x y z
     sdth.urn('nmap.Node',mo1,{'A','B'}) % Get from names
     sdth.urn('nmap.Node',mo1,{1,2}) % Get from id
     sdth.urn('nmap.Node',mo1,'[AB]') % Get from matched regular expressions on names
     [n1,name]=sdth.urn('nmap.Node',mo1,{'A','[CD]',2}) % Get from mixed ID/name/regular exp list
     [n1,name]=sdth.urn('nmap.Node.{A,[CD],2}',mo1) % Alternate call format with node selection directly after nmap.Node.
    

    sdth.findobj('_sub.','nmap.Node([1:3 7])') % get from NodeId list

  • combine two maps using append method
     nodeM1=mo1.nmap('Map:Nodes');
     nodeM2=mo2.nmap('Map:Nodes');
     nodeM1.append(nodeM2)
    

list #

Currently defined standard maps are

  • Map:ProName name, ID of element properties. Nominal local name is proM.
  • Map:MatName name, ID of material properties. Nominal local name is matM.
  • Map:BaseName name, ID orientation basis
  • Map:ProColor ProID , RGB colors (in the [0 1] interval);
  • Map:MatColor MatID , RGB colors (in the [0 1] interval);
  • Map:tlab sensor name, sensor ID. Nominal local name is tlabM.
  • Map:TestLab original (TestLab) sensor name, sensor name to be used in SDT. Nominal local name is TestLabM.
  • Map:Cin contains GUI buttons to be assembled together. See sdtm.pcin for example. This is work in progress.
  • Map:NGroup node group used by polytec,
  • Map:Elts

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)