MCPcopy Create free account
hub / github.com/OpenSees/OpenSees / setCol

Method setCol

SRC/recorder/FilePlotter.cpp:634–666  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

632
633
634int
635FilePlotter::setCol(const ID &theCols)
636{
637 if (theCols.Size()%2 != 0) {
638 opserr << "FilePlotter::setCol() - the size of the cols ID " << theCols.Size() << " is not a multiple of 2\n";
639 return -1;
640 }
641
642 for (int i=0; i<theCols.Size(); i++) {
643 if (theCols(i) < 1) {
644 opserr << "FilePlotter::FilePlotter() - a value of the cols " << theCols(i) << " is < 1\n";
645 return -2;
646 }
647 }
648 // check colX is valid, i.e. >= 1
649 // if valid set colX using c indexing
650
651 if (cols != 0) {
652 if (cols->Size() != theCols.Size()) {
653 delete cols;
654 cols = 0;
655 } else
656 *cols = theCols;
657 }
658
659 if (cols == 0)
660 cols = new ID(theCols);
661
662 for (int j=0; j<cols->Size(); j++)
663 (*cols)(j) -= 1;
664
665 return 0;
666}
667
668
669

Callers 1

TclCreateRecorderFunction · 0.80

Calls 1

SizeMethod · 0.45

Tested by

no test coverage detected