KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
stl_vector_io.h
Go to the documentation of this file.
1 // | / |
2 // ' / __| _` | __| _ \ __|
3 // . \ | ( | | ( |\__ `
4 // _|\_\_| \__,_|\__|\___/ ____/
5 // Multi-Physics
6 //
7 // License: BSD License
8 // Kratos default license: kratos/license.txt
9 //
10 // Main authors: Carlos A. Roig
11 //
12 //
13 
14 #if !defined(KRATOS_STL_VECTOR_IO_H_INCLUDED )
15 #define KRATOS_STL_VECTOR_IO_H_INCLUDED
16 
17 // System includes
18 #include <iostream>
19 #include <vector>
20 
21 namespace Kratos {
22 
23 template<class T>
24 std::ostream& operator<<(std::ostream& rOStream, const std::vector<T>& rVec) {
25 
26  std::size_t vector_size = rVec.size();
27 
28  rOStream << "[";
29  if(vector_size>0) rOStream << rVec[0];
30  if(vector_size>1) {
31  for(std::size_t i = 1; i < vector_size; i++)
32  rOStream<<", "<<rVec[i];
33  }
34  rOStream << "]";
35 
36  return rOStream;
37 }
38 
39 } //namespace Kratos
40 
41 
42 #endif // KRATOS_STL_VECTOR_IO_H_INCLUDED defined
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
std::ostream & operator<<(std::ostream &rOStream, const LinearMasterSlaveConstraint &rThis)
output stream function
Definition: linear_master_slave_constraint.h:432
integer i
Definition: TensorModule.f:17