From 0cd9e4075b5ad8cc379155e5dbb85bb6c779e95e Mon Sep 17 00:00:00 2001 From: hrobeers <2812522+hrobeers@users.noreply.github.com> Date: Tue, 31 Jul 2018 14:12:27 +0200 Subject: [PATCH] Ensure proper aligned_allocator definition by using vector-aligned (fixes compilation with recent eigen releases) --- examples/clarky-section/clarky-section.cpp | 12 ++++----- examples/hawt/hawt.cpp | 8 +++--- .../naca0012-section-oscillation.cpp | 2 +- examples/vawt/vawt.cpp | 4 +-- .../test-elliptic-planform.cpp | 2 +- .../test-interpolation-layer.cpp | 4 +-- .../test-naca0012-airfoil.cpp | 4 +-- tests/vortex-core/test-vortex-core.cpp | 2 +- vortexje/field-writers/vtk-field-writer.cpp | 4 +-- .../airfoils/naca4-airfoil-generator.cpp | 4 +-- .../airfoils/naca4-airfoil-generator.hpp | 5 ++-- .../shape-generators/ellipse-generator.cpp | 4 +-- .../shape-generators/ellipse-generator.hpp | 5 ++-- vortexje/solver.cpp | 26 +++++++++---------- vortexje/solver.hpp | 4 +-- vortexje/surface-builder.cpp | 2 +- vortexje/surface-builder.hpp | 4 +-- vortexje/surface-writer.cpp | 2 +- vortexje/surface-writer.hpp | 2 +- .../surface-writers/gmsh-surface-writer.cpp | 2 +- .../surface-writers/gmsh-surface-writer.hpp | 2 +- .../surface-writers/vtk-surface-writer.cpp | 2 +- .../surface-writers/vtk-surface-writer.hpp | 2 +- vortexje/surface.cpp | 2 +- vortexje/surface.hpp | 12 ++++----- vortexje/vector-aligned.hpp | 17 ++++++++++++ 26 files changed, 79 insertions(+), 60 deletions(-) create mode 100644 vortexje/vector-aligned.hpp diff --git a/examples/clarky-section/clarky-section.cpp b/examples/clarky-section/clarky-section.cpp index e1bc51b..88ae8e8 100644 --- a/examples/clarky-section/clarky-section.cpp +++ b/examples/clarky-section/clarky-section.cpp @@ -22,11 +22,11 @@ using namespace Vortexje; static const double pi = 3.141592653589793238462643383279502884; // Load airfoil data from file: -static vector > +static vector_aligned read_airfoil(const std::string &filename, int &trailing_edge_point_id) { - vector > upper_points; - vector > lower_points; + vector_aligned upper_points; + vector_aligned lower_points; // Parse file: ifstream f; @@ -67,7 +67,7 @@ read_airfoil(const std::string &filename, int &trailing_edge_point_id) f.close(); // Assemble entire airfoil: - vector > points; + vector_aligned points; for (int i = 0; i < (int) upper_points.size() - 1; i++) points.push_back(upper_points[i]); @@ -93,7 +93,7 @@ main(int argc, char **argv) // Load airfoil data: int trailing_edge_point_id; - vector > clarky_airfoil = read_airfoil("clarky.dat", trailing_edge_point_id); + vector_aligned clarky_airfoil = read_airfoil("clarky.dat", trailing_edge_point_id); // Create lifting surface object: shared_ptr wing(new LiftingSurface("main")); @@ -112,7 +112,7 @@ main(int argc, char **argv) vector > panel_strips; for (int i = 0; i < n_airfoils; i++) { - vector > airfoil_points; + vector_aligned airfoil_points; for (int j = 0; j < (int) clarky_airfoil.size(); j++) airfoil_points.push_back(Vector3d(chord * clarky_airfoil[j](0), chord * clarky_airfoil[j](1), i * span / (double) (n_airfoils - 1))); diff --git a/examples/hawt/hawt.cpp b/examples/hawt/hawt.cpp index 5bd4f69..c50b9bf 100644 --- a/examples/hawt/hawt.cpp +++ b/examples/hawt/hawt.cpp @@ -47,7 +47,7 @@ class Blade : public LiftingSurface vector > panel_strips; for (int i = 0; i < (int) blade_dr.size(); i++) { - vector > airfoil_points; + vector_aligned airfoil_points; for (int j = 0; j < (int) unscaled_airfoil_points.size(); j++) { Vector3d airfoil_point(blade_chord[i] * (unscaled_airfoil_points[j](0) - 0.25), blade_thickness[i] / unscaled_airfoil_thickness * unscaled_airfoil_points[j](1), @@ -75,7 +75,7 @@ class Blade : public LiftingSurface } private: - vector > unscaled_airfoil_points; + vector_aligned unscaled_airfoil_points; double unscaled_airfoil_thickness; int trailing_edge_point_id; @@ -89,8 +89,8 @@ class Blade : public LiftingSurface void read_airfoil(const std::string &filename) { - vector > upper_points; - vector > lower_points; + vector_aligned upper_points; + vector_aligned lower_points; // Parse file: ifstream f; diff --git a/examples/naca0012-section-oscillation/naca0012-section-oscillation.cpp b/examples/naca0012-section-oscillation/naca0012-section-oscillation.cpp index 40db0ad..73996c1 100644 --- a/examples/naca0012-section-oscillation/naca0012-section-oscillation.cpp +++ b/examples/naca0012-section-oscillation/naca0012-section-oscillation.cpp @@ -46,7 +46,7 @@ main (int argc, char **argv) vector > panel_strips; for (int i = 0; i < n_airfoils; i++) { - vector > airfoil_points = + vector_aligned airfoil_points = NACA4AirfoilGenerator::generate(0, 0, 0.12, true, chord, n_points_per_airfoil, trailing_edge_point_id); for (int j = 0; j < (int) airfoil_points.size(); j++) airfoil_points[j](2) += i * span / (double) (n_airfoils - 1); diff --git a/examples/vawt/vawt.cpp b/examples/vawt/vawt.cpp index d0d4b57..3058b05 100644 --- a/examples/vawt/vawt.cpp +++ b/examples/vawt/vawt.cpp @@ -53,7 +53,7 @@ class Blade : public LiftingSurface vector > panel_strips; for (int i = 0; i < n_airfoils; i++) { - vector > airfoil_points = + vector_aligned airfoil_points = NACA4AirfoilGenerator::generate(0, 0, 0.12, true, chord, n_points_per_airfoil, trailing_edge_point_id); for (int j = 0; j < (int) airfoil_points.size(); j++) airfoil_points[j](2) += i * span / (double) (n_airfoils - 1); @@ -98,7 +98,7 @@ class Tower : public Surface vector prev_nodes; for (int i = 0; i < n_layers; i++) { - vector > points = + vector_aligned points = EllipseGenerator::generate(r, r, n_points); for (int j = 0; j < (int) points.size(); j++) points[j](2) += i * h / (double) (n_layers - 1); diff --git a/tests/elliptic-planform/test-elliptic-planform.cpp b/tests/elliptic-planform/test-elliptic-planform.cpp index d7208a4..ec0191a 100644 --- a/tests/elliptic-planform/test-elliptic-planform.cpp +++ b/tests/elliptic-planform/test-elliptic-planform.cpp @@ -70,7 +70,7 @@ run_test(double alpha) double chord_y = chord * sqrt(1.0 - pow(2.0 * y / span, 2)); double offset_x = (chord - chord_y) / 2.0; - vector > airfoil_points; + vector_aligned airfoil_points; if (i == 0 || i == n_airfoils - 1) { Vector3d tip_point(0.0, 0.0, 0.0); for (int j = 0; j < n_points_per_airfoil; j++) diff --git a/tests/interpolation-layer/test-interpolation-layer.cpp b/tests/interpolation-layer/test-interpolation-layer.cpp index ed5a385..657dfff 100644 --- a/tests/interpolation-layer/test-interpolation-layer.cpp +++ b/tests/interpolation-layer/test-interpolation-layer.cpp @@ -50,13 +50,13 @@ main (int argc, char **argv) double alpha = pi * 5.0 / 180.0; AngleAxis rotation(-alpha, Vector3d::UnitZ()); - vector > airfoil_points = + vector_aligned airfoil_points = NACA4AirfoilGenerator::generate(0.09, 0.4, 0.12, true, chord, n_points_per_airfoil, trailing_edge_point_id); for (int i = 0; i < n_points_per_airfoil; i++) airfoil_points[i] = rotation * airfoil_points[i]; for (int i = 0; i < n_airfoils; i++) { - vector > translated_airfoil_points = airfoil_points; + vector_aligned translated_airfoil_points = airfoil_points; for (int j = 0; j < (int) airfoil_points.size(); j++) translated_airfoil_points[j](2) += i * span / (double) (n_airfoils - 1); diff --git a/tests/naca0012-airfoil/test-naca0012-airfoil.cpp b/tests/naca0012-airfoil/test-naca0012-airfoil.cpp index b03827d..1e9d98a 100644 --- a/tests/naca0012-airfoil/test-naca0012-airfoil.cpp +++ b/tests/naca0012-airfoil/test-naca0012-airfoil.cpp @@ -46,7 +46,7 @@ run_test(double alpha) vector > panel_strips; for (int i = 0; i < n_airfoils; i++) { - vector > airfoil_points = + vector_aligned airfoil_points = NACA4AirfoilGenerator::generate(0, 0, 0.12, true, chord, n_points_per_airfoil, trailing_edge_point_id); for (int j = 0; j < (int) airfoil_points.size(); j++) airfoil_points[j](2) += i * span / (double) (n_airfoils - 1); @@ -102,7 +102,7 @@ int main (int argc, char **argv) { // Load reference values. - std::vector > reference_results; + vector_aligned reference_results; ifstream f; f.open("naca0012-reference-data.txt"); diff --git a/tests/vortex-core/test-vortex-core.cpp b/tests/vortex-core/test-vortex-core.cpp index abb5e50..829a4b6 100644 --- a/tests/vortex-core/test-vortex-core.cpp +++ b/tests/vortex-core/test-vortex-core.cpp @@ -47,7 +47,7 @@ main (int argc, char **argv) vector > panel_strips; for (int i = 0; i < n_airfoils; i++) { - vector > airfoil_points = + vector_aligned airfoil_points = NACA4AirfoilGenerator::generate(0, 0, 0.12, true, chord, n_points_per_airfoil, trailing_edge_point_id); for (int j = 0; j < (int) airfoil_points.size(); j++) airfoil_points[j](2) += i * span / (double) (n_airfoils - 1); diff --git a/vortexje/field-writers/vtk-field-writer.cpp b/vortexje/field-writers/vtk-field-writer.cpp index e18d2d3..5b7e886 100644 --- a/vortexje/field-writers/vtk-field-writer.cpp +++ b/vortexje/field-writers/vtk-field-writer.cpp @@ -60,7 +60,7 @@ VTKFieldWriter::write_velocity_field(const Solver &solver, const std::string &fi // Compute velocity vector field: cout << "VTKFieldWriter: Computing velocity vector field." << endl; - vector > velocities; + vector_aligned velocities; velocities.resize(nx * ny * nz); int i; @@ -88,7 +88,7 @@ VTKFieldWriter::write_velocity_field(const Solver &solver, const std::string &fi // Velocity vector field; f << "VECTORS Velocity double" << endl; - vector >::const_iterator it; + vector_aligned::const_iterator it; for (it = velocities.begin(); it != velocities.end(); it++) { Vector3d v = *it; f << v(0) << " " << v(1) << " " << v(2) << endl; diff --git a/vortexje/shape-generators/airfoils/naca4-airfoil-generator.cpp b/vortexje/shape-generators/airfoils/naca4-airfoil-generator.cpp index 020ec66..310f4b9 100644 --- a/vortexje/shape-generators/airfoils/naca4-airfoil-generator.cpp +++ b/vortexje/shape-generators/airfoils/naca4-airfoil-generator.cpp @@ -76,7 +76,7 @@ compute_y_t(double x, double max_camber, double max_camber_dist, double max_thic @note See S. Yon, J. Katz, and A. Plotkin, Effect of Airfoil (Trailing-Edge) Thickness on the Numerical Solution of Panel Methods Based on the Dirichlet Boundary Condition, AIAA Journal, Vol. 30, No. 3, March 1992, for the issues that may arise when using an infinitely thin trailing edge. */ -vector > +vector_aligned NACA4AirfoilGenerator::generate(double max_camber, double max_camber_dist, double max_thickness, bool finite_te_thickness, double chord, int n_points, int &trailing_edge_point_id) { if (n_points % 2 == 1) { @@ -84,7 +84,7 @@ NACA4AirfoilGenerator::generate(double max_camber, double max_camber_dist, doubl exit(1); } - vector > airfoil_points; + vector_aligned airfoil_points; // Add upper nodes: for (int i = 0; i < n_points / 2; i++) { diff --git a/vortexje/shape-generators/airfoils/naca4-airfoil-generator.hpp b/vortexje/shape-generators/airfoils/naca4-airfoil-generator.hpp index 28409c9..f7d26d9 100644 --- a/vortexje/shape-generators/airfoils/naca4-airfoil-generator.hpp +++ b/vortexje/shape-generators/airfoils/naca4-airfoil-generator.hpp @@ -10,7 +10,8 @@ #define __NACA4_AIRFOIL_GENERATOR_HPP__ #include -#include + +#include namespace Vortexje { @@ -23,7 +24,7 @@ namespace Vortexje class NACA4AirfoilGenerator { public: - static std::vector > generate(double max_camber, double max_camber_dist, double max_thickness, bool finite_te_thickness, double chord, int n_points, int &trailing_edge_point_id); + static vector_aligned generate(double max_camber, double max_camber_dist, double max_thickness, bool finite_te_thickness, double chord, int n_points, int &trailing_edge_point_id); }; }; diff --git a/vortexje/shape-generators/ellipse-generator.cpp b/vortexje/shape-generators/ellipse-generator.cpp index fcebdd7..b164683 100644 --- a/vortexje/shape-generators/ellipse-generator.cpp +++ b/vortexje/shape-generators/ellipse-generator.cpp @@ -25,10 +25,10 @@ static const double pi = 3.141592653589793238462643383279502884; @returns List of points. */ -vector > +vector_aligned EllipseGenerator::generate(double a, double b, int n_points) { - vector > points; + vector_aligned points; // Go in the clockwise (negative) direction, for consistency with the airfoil generators. double dt = -2 * pi / (double) n_points; diff --git a/vortexje/shape-generators/ellipse-generator.hpp b/vortexje/shape-generators/ellipse-generator.hpp index 402f1a7..1fa7938 100644 --- a/vortexje/shape-generators/ellipse-generator.hpp +++ b/vortexje/shape-generators/ellipse-generator.hpp @@ -10,7 +10,8 @@ #define __ELLIPSE_GENERATOR_HPP__ #include -#include + +#include namespace Vortexje { @@ -23,7 +24,7 @@ namespace Vortexje class EllipseGenerator { public: - static std::vector > generate(double a, double b, int n_points); + static vector_aligned generate(double a, double b, int n_points); }; }; diff --git a/vortexje/solver.cpp b/vortexje/solver.cpp index c0cd710..88b2243 100644 --- a/vortexje/solver.cpp +++ b/vortexje/solver.cpp @@ -460,10 +460,10 @@ Solver::moment(const std::shared_ptr &surface, const Eigen::Vector3d &x @returns A list of points tracing the streamline. */ -vector > +vector_aligned Solver::trace_streamline(const SurfacePanelPoint &start) const { - vector > streamline; + vector_aligned streamline; SurfacePanelPoint cur(start.surface, start.panel, start.point); @@ -1000,7 +1000,7 @@ Solver::update_wakes(double dt) cout << "Solver: Convecting wakes." << endl; // Compute velocity values at wake nodes, with the wakes in their original state: - vector >, Eigen::aligned_allocator > > wake_velocities; + vector_aligned > wake_velocities; vector >::const_iterator bdi; for (bdi = bodies.begin(); bdi != bodies.end(); bdi++) { @@ -1010,7 +1010,7 @@ Solver::update_wakes(double dt) for (lsi = bd->body->lifting_surfaces.begin(); lsi != bd->body->lifting_surfaces.end(); lsi++) { const shared_ptr &d = *lsi; - vector > local_wake_velocities; + vector_aligned local_wake_velocities; local_wake_velocities.resize(d->wake->n_nodes()); int i; @@ -1037,7 +1037,7 @@ Solver::update_wakes(double dt) shared_ptr d = *lsi; // Retrieve local wake velocities: - vector > &local_wake_velocities = wake_velocities[idx]; + vector_aligned &local_wake_velocities = wake_velocities[idx]; idx++; // Convect wake nodes that coincide with the trailing edge. @@ -1137,7 +1137,7 @@ Solver::log(int step_number, SurfaceWriter &writer) const offset += d->surface->n_panels(); vector view_names; - vector > view_data; + vector_aligned view_data; view_names.push_back(VIEW_NAME_DOUBLET_DISTRIBUTION); view_data.push_back(non_lifting_surface_doublet_coefficients); @@ -1184,7 +1184,7 @@ Solver::log(int step_number, SurfaceWriter &writer) const offset += d->lifting_surface->n_panels(); vector view_names; - vector > view_data; + vector_aligned view_data; view_names.push_back(VIEW_NAME_DOUBLET_DISTRIBUTION); view_data.push_back(lifting_surface_doublet_coefficients); @@ -1484,12 +1484,12 @@ Eigen::Vector3d Solver::compute_velocity_interpolated(const Eigen::Vector3d &x, std::set &ignore_set) const { // Lists of close velocities, ordered by primacy: - vector > close_panel_velocities; - vector > close_panel_edge_velocities; - vector > interior_close_panel_velocities; - vector > interior_close_panel_edge_velocities; + vector_aligned close_panel_velocities; + vector_aligned close_panel_edge_velocities; + vector_aligned interior_close_panel_velocities; + vector_aligned interior_close_panel_edge_velocities; - vector >* > velocity_lists; + vector* > velocity_lists; velocity_lists.push_back(&close_panel_velocities); velocity_lists.push_back(&close_panel_edge_velocities); velocity_lists.push_back(&interior_close_panel_velocities); @@ -1662,7 +1662,7 @@ Solver::compute_velocity_interpolated(const Eigen::Vector3d &x, std::set &i if (velocity_lists[i]->size() > 0) { // Average: Vector3d velocity = Vector3d(0, 0, 0); - vector >::iterator it; + vector_aligned::iterator it; for (it = velocity_lists[i]->begin(); it != velocity_lists[i]->end(); it++) velocity += *it; diff --git a/vortexje/solver.hpp b/vortexje/solver.hpp index 1c354fd..9605ddb 100644 --- a/vortexje/solver.hpp +++ b/vortexje/solver.hpp @@ -15,11 +15,11 @@ #include #include -#include #include #include #include +#include namespace Vortexje { @@ -147,7 +147,7 @@ class Solver Eigen::Vector3d point; }; - std::vector > trace_streamline(const SurfacePanelPoint &start) const; + vector_aligned trace_streamline(const SurfacePanelPoint &start) const; void log(int step_number, SurfaceWriter &writer) const; diff --git a/vortexje/surface-builder.cpp b/vortexje/surface-builder.cpp index 38ea2e6..7712a8b 100644 --- a/vortexje/surface-builder.cpp +++ b/vortexje/surface-builder.cpp @@ -35,7 +35,7 @@ SurfaceBuilder::SurfaceBuilder(Surface &surface) : surface(surface) @returns A list of new node numbers. */ vector -SurfaceBuilder::create_nodes_for_points(const vector > &points) +SurfaceBuilder::create_nodes_for_points(const vector_aligned &points) { vector new_nodes; diff --git a/vortexje/surface-builder.hpp b/vortexje/surface-builder.hpp index a33b8cc..94aca3b 100644 --- a/vortexje/surface-builder.hpp +++ b/vortexje/surface-builder.hpp @@ -10,9 +10,9 @@ #define __SURFACE_BUILDER_HPP__ #include -#include #include +#include namespace Vortexje { @@ -34,7 +34,7 @@ class SurfaceBuilder */ Surface &surface; - std::vector create_nodes_for_points(const std::vector > &points); + std::vector create_nodes_for_points(const vector_aligned &points); std::vector create_panels_between_shapes(const std::vector &first_nodes, const std::vector &second_nodes, bool cyclic = true); diff --git a/vortexje/surface-writer.cpp b/vortexje/surface-writer.cpp index 41ea442..926d52d 100644 --- a/vortexje/surface-writer.cpp +++ b/vortexje/surface-writer.cpp @@ -41,7 +41,7 @@ SurfaceWriter::write(const std::shared_ptr &surface, const std::string int node_offset, int panel_offset) { vector empty_names; - vector > empty_data; + vector_aligned empty_data; return write(surface, filename, 0, 0, empty_names, empty_data); } diff --git a/vortexje/surface-writer.hpp b/vortexje/surface-writer.hpp index f2f52bc..bf800fd 100644 --- a/vortexje/surface-writer.hpp +++ b/vortexje/surface-writer.hpp @@ -56,7 +56,7 @@ class SurfaceWriter */ virtual bool write(const std::shared_ptr &surface, const std::string &filename, int node_offset, int panel_offset, - const std::vector &view_names, const std::vector > &view_data) = 0; + const std::vector &view_names, const vector_aligned &view_data) = 0; }; }; diff --git a/vortexje/surface-writers/gmsh-surface-writer.cpp b/vortexje/surface-writers/gmsh-surface-writer.cpp index cfa8c8c..ea9e860 100644 --- a/vortexje/surface-writers/gmsh-surface-writer.cpp +++ b/vortexje/surface-writers/gmsh-surface-writer.cpp @@ -42,7 +42,7 @@ GmshSurfaceWriter::file_extension() const bool GmshSurfaceWriter::write(const std::shared_ptr &surface, const string &filename, int node_offset, int panel_offset, - const std::vector &view_names, const vector > &view_data) + const std::vector &view_names, const vector_aligned &view_data) { cout << "Surface " << surface->id << ": Saving to " << filename << "." << endl; diff --git a/vortexje/surface-writers/gmsh-surface-writer.hpp b/vortexje/surface-writers/gmsh-surface-writer.hpp index 1cf54c9..950c9c2 100644 --- a/vortexje/surface-writers/gmsh-surface-writer.hpp +++ b/vortexje/surface-writers/gmsh-surface-writer.hpp @@ -28,7 +28,7 @@ class GmshSurfaceWriter : public SurfaceWriter bool write(const std::shared_ptr &surface, const std::string &filename, int node_offset, int panel_offset, - const std::vector &view_names, const std::vector > &view_data); + const std::vector &view_names, const vector_aligned &view_data); }; }; diff --git a/vortexje/surface-writers/vtk-surface-writer.cpp b/vortexje/surface-writers/vtk-surface-writer.cpp index 8549af5..c6b06f1 100644 --- a/vortexje/surface-writers/vtk-surface-writer.cpp +++ b/vortexje/surface-writers/vtk-surface-writer.cpp @@ -42,7 +42,7 @@ VTKSurfaceWriter::file_extension() const bool VTKSurfaceWriter::write(const std::shared_ptr &surface, const string &filename, int node_offset, int panel_offset, - const std::vector &view_names, const vector > &view_data) + const std::vector &view_names, const vector_aligned &view_data) { cout << "Surface " << surface->id << ": Saving to " << filename << "." << endl; diff --git a/vortexje/surface-writers/vtk-surface-writer.hpp b/vortexje/surface-writers/vtk-surface-writer.hpp index ddd24eb..a3f2586 100644 --- a/vortexje/surface-writers/vtk-surface-writer.hpp +++ b/vortexje/surface-writers/vtk-surface-writer.hpp @@ -28,7 +28,7 @@ class VTKSurfaceWriter : public SurfaceWriter bool write(const std::shared_ptr &surface, const std::string &filename, int node_offset, int panel_offset, - const std::vector &view_names, const std::vector > &view_data); + const std::vector &view_names, const vector_aligned &view_data); }; }; diff --git a/vortexje/surface.cpp b/vortexje/surface.cpp index 2f3275a..2622824 100644 --- a/vortexje/surface.cpp +++ b/vortexje/surface.cpp @@ -267,7 +267,7 @@ Surface::compute_geometry(int panel) panel_coordinate_transformations[panel] = transformation; // Create transformed points. - vector > single_panel_transformed_points; + vector_aligned single_panel_transformed_points; single_panel_transformed_points.reserve(single_panel_nodes.size()); for (int j = 0; j < (int) single_panel_nodes.size(); j++) single_panel_transformed_points.push_back(transformation * nodes[single_panel_nodes[j]]); diff --git a/vortexje/surface.hpp b/vortexje/surface.hpp index 648a8e0..a4c8481 100644 --- a/vortexje/surface.hpp +++ b/vortexje/surface.hpp @@ -16,9 +16,9 @@ #include #include -#include #include +#include namespace Vortexje { @@ -59,7 +59,7 @@ class Surface /** Node number to point map. */ - std::vector > nodes; + vector_aligned nodes; /** Node number to neigboring panel numbers map. @@ -88,7 +88,7 @@ class Surface /** Panel number to comprising vertex points (in the panel coordinate system) map. */ - std::vector > > panel_transformed_points; + std::vector > panel_transformed_points; void rotate(const Eigen::Vector3d &axis, double angle); virtual void transform(const Eigen::Matrix3d &transformation); @@ -123,17 +123,17 @@ class Surface /** Panel number to collocation point map. */ - std::vector > panel_collocation_points[2]; + vector_aligned panel_collocation_points[2]; /** Panel number to normal map. */ - std::vector > panel_normals; + vector_aligned panel_normals; /** Panel number to panel coordinate transformation map. */ - std::vector, Eigen::aligned_allocator > > panel_coordinate_transformations; + vector_aligned > panel_coordinate_transformations; /** Panel number to surface area map. diff --git a/vortexje/vector-aligned.hpp b/vortexje/vector-aligned.hpp new file mode 100644 index 0000000..043cd39 --- /dev/null +++ b/vortexje/vector-aligned.hpp @@ -0,0 +1,17 @@ +// +// Vortexje -- std::vector using eigen's aligned_allocator +// + +#ifndef __ALIGNED_VECTOR_HPP__ +#define __ALIGNED_VECTOR_HPP__ + +#include +#include + +namespace Vortexje +{ + template + using vector_aligned = std::vector >; +}; + +#endif // __ALIGNED_VECTOR_HPP__