Skip to content
Snippets Groups Projects
Commit 50d02c5e authored by Oliver Sander's avatar Oliver Sander Committed by sander@FU-BERLIN.DE
Browse files

Method 'makeStraightRod' works for non-uniform grids and is a non-static method now

[[Imported from SVN: r6749]]
parent 549e08b0
No related branches found
No related tags found
No related merge requests found
...@@ -153,7 +153,8 @@ int main (int argc, char *argv[]) try ...@@ -153,7 +153,8 @@ int main (int argc, char *argv[]) try
// Initial solution // Initial solution
// ////////////////////////// // //////////////////////////
RodFactory<RodGridType::LeafGridView>::makeStraightRod(rodX, complex.rodGrids_["rod"]->size(1), rodRestEndPoint[0], rodRestEndPoint[1]); RodFactory<RodGridType::LeafGridView> rodFactory(complex.rodGrids_["rod"]->leafView());
rodFactory.create(rodX, rodRestEndPoint[0], rodRestEndPoint[1]);
// ///////////////////////////////////////// // /////////////////////////////////////////
// Read Dirichlet values // Read Dirichlet values
......
...@@ -28,7 +28,7 @@ public: ...@@ -28,7 +28,7 @@ public:
\param[in] n The number of vertices \param[in] n The number of vertices
*/ */
template <int dim> template <int dim>
static void makeStraightRod(std::vector<RigidBodyMotion<dim> >& rod, int n, void create(std::vector<RigidBodyMotion<dim> >& rod,
const Dune::FieldVector<double,3>& beginning, const Dune::FieldVector<double,3>& end) const Dune::FieldVector<double,3>& beginning, const Dune::FieldVector<double,3>& end)
{ {
// Compute the correct orientation // Compute the correct orientation
...@@ -48,16 +48,8 @@ template <int dim> ...@@ -48,16 +48,8 @@ template <int dim>
if (angle != 0) if (angle != 0)
orientation = Rotation<3,double>(axis, angle); orientation = Rotation<3,double>(axis, angle);
// Set the values // Set the values
rod.resize(n); create(rod, RigidBodyMotion<dim>(beginning,orientation), RigidBodyMotion<dim>(end,orientation));
for (int i=0; i<n; i++) {
rod[i].r = beginning;
rod[i].r.axpy(double(i) / (n-1), end-beginning);
rod[i].q = orientation;
}
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment