| 54 | } |
| 55 | |
| 56 | void PeriodicMaterial::check_validity() const { |
| 57 | Float axis_length = m_axis.norm(); |
| 58 | if (axis_length < 0.9) { |
| 59 | std::stringstream err_msg; |
| 60 | err_msg << "Axis of periodicity (" << m_axis << ") is denerated."; |
| 61 | throw RuntimeError(err_msg.str()); |
| 62 | } |
| 63 | |
| 64 | if (m_ratio > 1.0 || m_ratio < 0.0) { |
| 65 | std::stringstream err_msg; |
| 66 | err_msg << "Material ratio (" << m_ratio << ") is not in [0,1]"; |
| 67 | throw RuntimeError(err_msg.str()); |
| 68 | } |
| 69 | |
| 70 | if (m_phase > 1.0 || m_phase < -1.0) { |
| 71 | std::stringstream err_msg; |
| 72 | err_msg << "Starting phase (" << m_phase << ") is not in [-1,1]"; |
| 73 | throw RuntimeError(err_msg.str()); |
| 74 | } |
| 75 | } |
nothing calls this directly
no test coverage detected