MCPcopy Create free account
hub / github.com/PyMesh/PyMesh / check_validity

Method check_validity

tools/Assembler/Materials/PeriodicMaterial.cpp:56–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54}
55
56void 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}

Callers

nothing calls this directly

Calls 3

RuntimeErrorClass · 0.85
normMethod · 0.80
strMethod · 0.45

Tested by

no test coverage detected