SDT-base Contents   Functions      PDF Index |
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
This development is still not fully stable and you should look at test examples in d_feplot('vhandle.nmap')
mo1=sdth.urn('nmap.Node.set',mo1,struct('value',1:4,'ID',{{'A','B','C','D'}}));
mo1=sdth.urn('nmap.Node.set',mo1,{'1:A','2:B'});
[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
nodeM1=mo1.nmap('Map:Nodes'); nodeM2=mo2.nmap('Map:Nodes'); nodeM1.append(nodeM2)
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(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.
m1=vhandle.nmap.renumber(m1,shift); performs renumbering operations with a shift, on standard nmaps that are associated to node or elements identifiers.
m2=vhandle.nmap.invMap(m1)
Generates a new nmap with inverted keys and values.
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.
r1=m1.getStruct outputs a structure equivalent for the map m1, its keys must be compatible strings.
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)