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

Function OPS_ParticleGroup

SRC/element/PFEMElement/ParticleGroup.cpp:35–357  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33#include <sstream>
34
35int OPS_ParticleGroup() {
36 if (OPS_GetNumRemainingInputArgs() < 2) {
37 opserr << "WARNING: tag? type? pts?\n";
38 return -1;
39 }
40
41 // get mesh tag
42 int tag;
43 int num = 1;
44 if (OPS_GetIntInput(&num, &tag) < 0) {
45 opserr << "WARNING: failed to get mesh tag\n";
46 return -1;
47 }
48
49 // get particle group
50 ParticleGroup *group = dynamic_cast<ParticleGroup *>(OPS_getMesh(tag));
51 if (group == 0) {
52 group = new ParticleGroup(tag);
53 if (group == 0) {
54 opserr << "WARNING: failed to create/get new particle group\n";
55 return -1;
56 }
57 if (OPS_addMesh(group) == false) {
58 opserr << "WARNING: failed to add particle group\n";
59 return -1;
60 }
61 }
62
63 // get geometry
64 int ndm = OPS_GetNDM();
65 VDouble p1(ndm), p2(ndm), p3(ndm), p4(ndm);
66 VDouble p5(ndm), p6(ndm), p7(ndm), p8(ndm);
67 VDouble pointdata;
68 VInt nump(3);
69 const char *geotype = OPS_GetString();
70 if (strcmp(geotype, "quad") == 0) {
71 if (OPS_GetNumRemainingInputArgs() < 4 * ndm + 2) {
72 opserr << "WARNING: insufficient args\n";
73 return -1;
74 }
75
76 // node coord
77 if (OPS_GetDoubleInput(&ndm, &p1[0]) < 0) {
78 opserr << "WARNING: failed to get coordinates for first point\n";
79 return -1;
80 }
81 if (OPS_GetDoubleInput(&ndm, &p2[0]) < 0) {
82 opserr << "WARNING: failed to get coordinates for second point\n";
83 return -1;
84 }
85 if (OPS_GetDoubleInput(&ndm, &p3[0]) < 0) {
86 opserr << "WARNING: failed to get coordinates for third point\n";
87 return -1;
88 }
89 if (OPS_GetDoubleInput(&ndm, &p4[0]) < 0) {
90 opserr << "WARNING: failed to get coordinates for fourth point\n";
91 return -1;
92 }

Callers 1

OPS_meshFunction · 0.85

Calls 15

OPS_getMeshFunction · 0.85
OPS_addMeshFunction · 0.85
pointlistMethod · 0.80
setEleArgsMethod · 0.80
qua_dMethod · 0.80
cubeMethod · 0.80
triMethod · 0.80
lineMethod · 0.80
OPS_GetNDMFunction · 0.70
OPS_GetIntInputFunction · 0.50
OPS_GetStringFunction · 0.50

Tested by

no test coverage detected