| 823 | } // main |
| 824 | |
| 825 | void |
| 826 | record_position(const FEMechanicsExplicitIntegrator* const fem_solver, |
| 827 | EquationSystems* beam_systems, |
| 828 | vector<libMesh::Point> evaluation_points, |
| 829 | const double loop_time) |
| 830 | { |
| 831 | System& x_system = beam_systems->get_system(fem_solver->getCurrentCoordinatesSystemName()); |
| 832 | DofMap& x_dof_map = x_system.get_dof_map(); |
| 833 | std::vector<unsigned int> vars; |
| 834 | x_system.get_all_variable_numbers(vars); |
| 835 | |
| 836 | NumericVector<double>* x_vec = x_system.solution.get(); |
| 837 | std::unique_ptr<NumericVector<Number>> x_serial_vec = NumericVector<Number>::build(x_vec->comm()); |
| 838 | x_serial_vec->init(x_vec->size(), true, SERIAL); |
| 839 | x_vec->localize(*x_serial_vec); |
| 840 | |
| 841 | MeshFunction mesh_fcn(*beam_systems, *x_serial_vec, x_dof_map, vars, 0); |
| 842 | mesh_fcn.init(); |
| 843 | vector<DenseVector<Number>> x(evaluation_points.size()); |
| 844 | for (unsigned int i = 0; i < evaluation_points.size(); i++) mesh_fcn(evaluation_points[i], loop_time, x[i]); |
| 845 | |
| 846 | if (SAMRAI_MPI::getRank() == 0) |
| 847 | { |
| 848 | x_stream << loop_time; |
| 849 | y_stream << loop_time; |
| 850 | z_stream << loop_time; |
| 851 | for (unsigned int i = 0; i < evaluation_points.size(); i++) |
| 852 | { |
| 853 | x_stream << " " << x[i](0); |
| 854 | y_stream << " " << x[i](1); |
| 855 | z_stream << " " << x[i](2); |
| 856 | } |
| 857 | x_stream << "\n"; |
| 858 | y_stream << "\n"; |
| 859 | z_stream << "\n"; |
| 860 | } |
| 861 | |
| 862 | return; |
| 863 | } |