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

Function OPS_MeshRegion

SRC/interpreter/OpenSeesMiscCommands.cpp:784–1051  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

782}
783
784int OPS_MeshRegion()
785{
786 int tag;
787 double alphaM = 0.0;
788 double betaK = 0.0;
789 double betaK0 = 0.0;
790 double betaKc = 0.0;
791 Damping *theDamping = 0;
792
793 ID *theNodes = 0;
794 ID *theElements = 0;
795 int numNodes = 0;
796 int numElements = 0;
797
798 Domain* theDomain = OPS_GetDomain();
799 if (theDomain == 0) return -1;
800
801 // first get tag for region
802 if (OPS_GetNumRemainingInputArgs() < 1) {
803 opserr << "WARNING region tag? - no tag specified\n";
804 return -1;
805 }
806
807 int numdata = 1;
808 if (OPS_GetIntInput(&numdata, &tag) < 0) {
809 opserr << "WARNING region tag? .. - invalid tag " << endln;
810 return -1;
811 }
812
813 // now continue until end of command
814 bool only = false;
815 while (OPS_GetNumRemainingInputArgs() > 0) {
816
817 const char* flag = OPS_GetString();
818
819 if (strcmp(flag,"-ele") == 0 || strcmp(flag,"-eleOnly") == 0) {
820
821 // ensure no segmentation fault if user messes up
822 if (OPS_GetNumRemainingInputArgs() < 1) {
823 opserr << "WARNING region tag? .. -ele tag1? .. - no ele tags specified\n";
824 return -1;
825 }
826
827 //
828 // read in a list of ele until end of command or other flag
829 //
830 if (theElements == 0) {
831 theElements = new ID(0, 64);
832 }
833 int eleTag;
834 while (OPS_GetNumRemainingInputArgs() > 0) {
835 if (OPS_GetIntInput(&numdata, &eleTag) < 0) {
836 // back one arg
837 OPS_ResetCurrentInputArg(-1);
838 break;
839 }
840
841 (*theElements)[numElements++] = eleTag;

Callers 2

Tcl_ops_regionFunction · 0.85
Py_ops_regionFunction · 0.85

Calls 15

OPS_getDampingFunction · 0.85
setElementsOnlyMethod · 0.80
setNodesOnlyMethod · 0.80
OPS_GetDomainFunction · 0.70
OPS_GetIntInputFunction · 0.70
OPS_GetStringFunction · 0.70
OPS_ResetCurrentInputArgFunction · 0.70
OPS_GetDoubleInputFunction · 0.70
getRegionMethod · 0.45
addRegionMethod · 0.45
setElementsMethod · 0.45

Tested by

no test coverage detected