| 3065 | } |
| 3066 | |
| 3067 | void appendFiberData(std::vector<mpco::element::FiberData> &data, std::vector<int> &data_mat_id, |
| 3068 | std::vector<int> &sec_id, std::vector<int> &gp_id, std::vector<bool> &dummy_sec_flags, |
| 3069 | int* &temp_sec, int* &temp_gp, bool* &temp_dummy) const { |
| 3070 | if (type == mpco::ElementOutputDescriptorType::Gauss) { |
| 3071 | if (temp_gp == 0) |
| 3072 | temp_gp = new int(); |
| 3073 | *temp_gp = gp_number; |
| 3074 | } |
| 3075 | else if (type == mpco::ElementOutputDescriptorType::Section) { |
| 3076 | if (temp_sec == 0) |
| 3077 | temp_sec = new int(); |
| 3078 | if (temp_dummy == 0) |
| 3079 | temp_dummy = new bool(); |
| 3080 | *temp_sec = tag; |
| 3081 | *temp_dummy = dummy_section_flag; |
| 3082 | } |
| 3083 | else if (type == mpco::ElementOutputDescriptorType::Fiber) { |
| 3084 | data.push_back(mpco::element::FiberData(fib_y, fib_z, fib_a)); |
| 3085 | int fiber_mat_tag = -1; |
| 3086 | if (items.size() == 1) { |
| 3087 | if (items[0]->type == mpco::ElementOutputDescriptorType::Material) { |
| 3088 | fiber_mat_tag = items[0]->tag; |
| 3089 | } |
| 3090 | } |
| 3091 | data_mat_id.push_back(fiber_mat_tag); |
| 3092 | } |
| 3093 | if (type == mpco::ElementOutputDescriptorType::Fiber || items.size() == 0) { |
| 3094 | if (temp_sec) |
| 3095 | sec_id.push_back(*temp_sec); |
| 3096 | if (temp_gp) |
| 3097 | gp_id.push_back(*temp_gp); |
| 3098 | if (temp_dummy) |
| 3099 | dummy_sec_flags.push_back(*temp_dummy); |
| 3100 | /** \bug-fixed note here we MUST exit, avoiding asking to sub-items. |
| 3101 | for example if this item is a fiber, it may have sub-times like material! |
| 3102 | */ |
| 3103 | return; |
| 3104 | } |
| 3105 | // ask subitems |
| 3106 | for (size_t i = 0; i < items.size(); i++) { |
| 3107 | items[i]->appendFiberData(data, data_mat_id, |
| 3108 | sec_id, gp_id, dummy_sec_flags, temp_sec, temp_gp, temp_dummy); |
| 3109 | } |
| 3110 | } |
| 3111 | |
| 3112 | void fixFloatingFiberOutputInternal() { |
| 3113 | if (items.size() > 0) { |