30 int inDataScalarID = inDataScalar->
getID();
43 Eigen::VectorXd &inValuesScalar = inDataScalar->
values();
44 inValuesScalar << 1.0, 2.0, 3.0;
55 int outDataScalarID = outDataScalar->
getID();
59 outMesh->
createVertex(Eigen::Vector2d::Constant(1.0 / 3.0));
81 mapping.
map(inDataScalarID, outDataScalarID);
82 const Eigen::VectorXd &outValuesScalar = outDataScalar->
values();
86 Eigen::VectorXd expected(outMesh->
nVertices());
87 expected << 2.0, 1.0, 2.0, 3.0, 1.49, 2.25, 1.5, 1.0, 2.0, 3.0;
88 BOOST_CHECK(equals(expected, outValuesScalar));
103 const double forceOnMid = 1.0;
104 const double forceOnMidAB = 2.0;
105 const double forceOnA = 10.0;
106 const double forceOnC = 7.0;
107 const double unbalancedforceOnBC = 3.0;
108 const double netForce = forceOnMid + forceOnMidAB + forceOnA + forceOnC + unbalancedforceOnBC;
112 int inDataScalarID = inDataScalar->
getID();
121 Eigen::VectorXd &inValuesScalar = inDataScalar->
values();
122 inValuesScalar << forceOnMid, forceOnMidAB, forceOnA, forceOnC, unbalancedforceOnBC;
127 int outDataScalarID = outDataScalar->
getID();
148 mapping.
map(inDataScalarID, outDataScalarID);
149 const Eigen::VectorXd &outValuesScalar = outDataScalar->
values();
153 Eigen::VectorXd expected(outMesh->
nVertices());
154 const double expectedA = forceOnMid / 3 + forceOnMidAB / 2 + forceOnA;
155 const double expectedB = forceOnMid / 3 + forceOnMidAB / 2 + unbalancedforceOnBC * 0.75;
156 const double expectedC = forceOnMid / 3 + forceOnC + unbalancedforceOnBC * 0.25;
157 expected << expectedA, expectedB, expectedC;
159 BOOST_CHECK(equals(expected, outValuesScalar));
160 BOOST_CHECK(equals(netForce, outValuesScalar.sum()));
171 int inDataScalarID = inDataScalar->
getID();
187 Eigen::VectorXd &inValuesScalar = inDataScalar->
values();
188 inValuesScalar << 1.0, 2.0, 3.0, 4.0;
193 int outDataScalarID = outDataScalar->
getID();
202 outMesh->
createVertex(Eigen::Vector3d(1.0 / 3, 1.0 / 3, -0.1));
218 mapping.
map(inDataScalarID, outDataScalarID);
219 const Eigen::VectorXd &outValuesScalar = outDataScalar->
values();
223 Eigen::VectorXd expected(outMesh->
nVertices());
224 expected << 2.5, 1.0, 2.0, 3.0, 4.0, 2.0, 3.0, 3.3, 3.6;
225 BOOST_CHECK(equals(expected, outValuesScalar));
239 const double forceOnMid = 1.0;
240 const double forceOnMidAB = 2.0;
241 const double forceOnA = 10.0;
242 const double forceOnC = 7.0;
243 const double unbalancedforceOnBC = 3.0;
244 const double unbalancedInternalForce = 11.0;
245 const double netForce = forceOnMid + forceOnMidAB + forceOnA + forceOnC + unbalancedforceOnBC + unbalancedInternalForce;
249 int inDataScalarID = inDataScalar->
getID();
251 inMesh->
createVertex(Eigen::Vector3d(0.25, 0.25, 0.25));
259 Eigen::VectorXd &inValuesScalar = inDataScalar->
values();
260 inValuesScalar << forceOnMid, forceOnMidAB, forceOnA, forceOnC, unbalancedforceOnBC, unbalancedInternalForce;
265 int outDataScalarID = outDataScalar->
getID();
282 mapping.
map(inDataScalarID, outDataScalarID);
283 const Eigen::VectorXd &outValuesScalar = outDataScalar->
values();
287 Eigen::VectorXd expected(outMesh->
nVertices());
288 const double expectedA = forceOnMid / 4 + forceOnMidAB / 2 + forceOnA + 0.4 * unbalancedInternalForce;
289 const double expectedB = forceOnMid / 4 + forceOnMidAB / 2 + unbalancedforceOnBC * 0.75 + 0.1 * unbalancedInternalForce;
290 const double expectedC = forceOnMid / 4 + forceOnC + unbalancedforceOnBC * 0.25 + 0.2 * unbalancedInternalForce;
291 const double expectedD = forceOnMid / 4 + 0.3 * unbalancedInternalForce;
293 expected << expectedA, expectedB, expectedC, expectedD;
295 BOOST_CHECK(equals(expected, outValuesScalar));
296 BOOST_CHECK(equals(netForce, outValuesScalar.sum()));
PtrData & createData(const std::string &name, int dimension, DataID id, int waveformDegree=time::Time::DEFAULT_WAVEFORM_DEGREE)
Create only data for vertex.
Tetrahedron & createTetrahedron(Vertex &vertexOne, Vertex &vertexTwo, Vertex &vertexThree, Vertex &vertexFour)
Creates and initializes a Tetrahedron object.
boost::test_tools::predicate_result equals(const std::vector< float > &VectorA, const std::vector< float > &VectorB, float tolerance)
equals to be used in tests. Compares two std::vectors using a given tolerance. Prints both operands o...