@@ -80,7 +80,6 @@ InterfaceWithCleaverAlgorithm::InterfaceWithCleaverAlgorithm()
8080
8181boost::shared_ptr<Cleaver::ScalarField> InterfaceWithCleaverAlgorithm::makeCleaverFieldFromLatVol (FieldHandle field )
8282{
83- // TODO: this function assumes input is completely valid, may want to move various checks from run() function here.
8483 VMesh* vmesh = field->vmesh ();
8584 VField* vfield = field->vfield ();
8685 VMesh::dimension_type dims;
@@ -90,8 +89,6 @@ boost::shared_ptr<Cleaver::ScalarField> InterfaceWithCleaverAlgorithm::makeCleav
9089
9190 auto cleaverField = boost::make_shared<Cleaver::FloatField>(dims[0 ], dims[1 ], dims[2 ], ptr);
9291
93- cleaverField->setCenter (Cleaver::FloatField::CellCentered);
94-
9592 BBox bbox=vmesh->get_bounding_box ();
9693 Point bmin, bmax;
9794 if (bbox.valid ())
@@ -110,13 +107,6 @@ boost::shared_ptr<Cleaver::ScalarField> InterfaceWithCleaverAlgorithm::makeCleav
110107
111108 cleaverField->setScale (Cleaver::vec3 (x_spacing,y_spacing,z_spacing));
112109
113- // TODO: Cleaver FloatField needs more setup (constructor is not sufficient)
114- // 1.
115- // setBounds(BoundingBox). Convert vmesh->get_bounding_box() to Cleaver BoundingBox.
116- // 2.
117- // setScale(vec3). Need to figure out which vmesh function to call, and convert to Cleaver::vec3.
118- // 3. unit test heavily.
119-
120110 return cleaverField;
121111}
122112
@@ -182,9 +172,9 @@ FieldHandle InterfaceWithCleaverAlgorithm::run(const std::vector<FieldHandle>& i
182172 }
183173
184174 // 0 = constant, 1 = linear
185- if (0 != vfield1->basis_order ())
175+ if (1 != vfield1->basis_order ())
186176 {
187- THROW_ALGORITHM_INPUT_ERROR (" Input data need to be defined on elements. You can use the module MapFieldDataFromNodeToElem to do that ." );
177+ THROW_ALGORITHM_INPUT_ERROR (" Input data need to be defined on input mesh nodes ." );
188178 }
189179
190180 if (vfield1->is_float ())
@@ -209,11 +199,7 @@ FieldHandle InterfaceWithCleaverAlgorithm::run(const std::vector<FieldHandle>& i
209199 }
210200
211201 boost::shared_ptr<Cleaver::Volume> volume (new Cleaver::Volume (toVectorOfRawPointers (fields)));
212- /*
213- Cleaver::BoundingBox m_bounds=fields[0]->bounds();
214- std::cout << "bsize: " << m_bounds.size.x << " " << m_bounds.size.y << " " << m_bounds.size.z << std::endl;
215- std::cout << "borin: " << m_bounds.origin.x << " " << m_bounds.origin.y << " " << m_bounds.origin.z << std::endl;
216- */
202+
217203 const double xScale = get (VolumeScalingX).toDouble ();
218204 const double yScale = get (VolumeScalingY).toDouble ();
219205 const double zScale = get (VolumeScalingZ).toDouble ();
0 commit comments