| 209 | } |
| 210 | |
| 211 | Parallel3DMaterial::Parallel3DMaterial( |
| 212 | int tag, |
| 213 | const std::vector<NDMaterial*>& theMaterials, |
| 214 | const std::vector<double>& theWeights) |
| 215 | : NDMaterial(tag, ND_TAG_Parallel3DMaterial) |
| 216 | , m_materials(theMaterials.size(), nullptr) |
| 217 | , m_weights(theWeights) |
| 218 | { |
| 219 | // copy the materials |
| 220 | for (std::size_t i = 0; i < theMaterials.size(); ++i) { |
| 221 | NDMaterial* the_copy = theMaterials[i]->getCopy("ThreeDimensional"); |
| 222 | if (the_copy == 0) { |
| 223 | opserr << |
| 224 | "nDMaterial Paralell3D Error: failed to get a (3D) copy of the material at location " << |
| 225 | static_cast<int>(i)+1 << " of " << static_cast<int>(theMaterials.size()) << "\n"; |
| 226 | exit(-1); |
| 227 | } |
| 228 | m_materials[i] = the_copy; |
| 229 | } |
| 230 | computeInitialTangent(); |
| 231 | computeTangent(); |
| 232 | } |
| 233 | |
| 234 | Parallel3DMaterial::Parallel3DMaterial() |
| 235 | : NDMaterial(0, ND_TAG_Parallel3DMaterial) |