CAE::Nastran::Nasmod::Entity - an entity of a nastran model
use CAE::Nastran::Nasmod::Entity; # create new Entity (an empty nastran card) my $entity = CAE::Nastran::Nasmod::Entity->new(); # define its content $entity->setComment("just a test"); # comment $entity->setCol(1, "GRID"); # column 1: cardname $entity->setCol(2, 1000); # column 2: id $entity->setCol(4, 17); # column 4: x $entity->setCol(5, 120); # column 5: y $entity->setCol(6, 88); # column 6: z # print entity to STDOUT $entity->print();
create new entities, set data fields, extract data, match against filters and print data
creates and returns a new Entity
# create a new Entity my $entity = CAE::Nastran::Nasmod::Entity->new();
sets the comment of the entity (and deletes existent comment)
# set a new comment $entity->setComment("hi there"); # set a new comment $entity->setComment("im the first line", "and i'm the second one"); # set a new comment my @comment = ("i'm the first line", "and i'm the second one"); $entity->setComment(\@comment);
adds a line of comment to an entity without deleting existent comment
# add a line $entity->addComment("hi there"); # add a second line $entity->addComment("i'm the second line");
sets the value for a certain column
# set column 1 to value 'hello' $entity->setCol(1, 'hello');
gets the value of a certain column
# get column 1 my $value = $entity->getCol(1);
returns all data columns as an array.
my @row = $entity->getRow();
match all data against a filter. returns true if filter matches otherwise returns undef
# filter for GRID (NID=1000) my @filter = ( "", # pos 0 filters comment: entities pass which match // in the comment. (comment => no anchors in the regex) "GRID", # pos 1 filters column 1: only entities pass which match /^GRID$/ in column 1. (note the anchors in the regex) "1000" # pos 2 filters column 2: entities pass which match /^1000$/ in column 2. (note the anchors in the regex) "" # pos 3 filters column 3: entities pass which match // in column 3. (empty => no anchors in the regex) ) my $result = $entity->match(\@filter);
prints the entity in nastran format to STDOUT
$entity->print(); # prints to STDOUT
CA, CAE, FEA, FEM, Nastran, perl, Finite Elements, CAE Automation, CAE Automatisierung
Alexander Vogel <avoge@cpan.org>
Copyright (c) 2012-2014, Alexander Vogel, All Rights Reserved. You may redistribute this under the same terms as Perl itself.
To install CAE::Nastran::Nasmod, copy and paste the appropriate command in to your terminal.
cpanm
cpanm CAE::Nastran::Nasmod
CPAN shell
perl -MCPAN -e shell install CAE::Nastran::Nasmod
For more information on module installation, please visit the detailed CPAN module installation guide.