]> SALOME platform Git repositories - tools/solverlab.git/commitdiff
Salome HOME
Added a function Field::getFieldValues
authormichael <michael@localhost.localdomain>
Mon, 17 May 2021 07:58:33 +0000 (09:58 +0200)
committermichael <michael@localhost.localdomain>
Mon, 17 May 2021 07:58:33 +0000 (09:58 +0200)
CDMATH/mesh/inc/Field.hxx
CDMATH/mesh/src/Field.cxx

index 70cfc8046a8f6c1148cf80ed90a9d20fc3ab65dd..bc4ff85bd0166235838b39a0f60c467ff9e14659 100755 (executable)
@@ -257,6 +257,8 @@ class Field
 
     void setTime ( double time, int iter );
 
+    std::vector< double > getFieldValues(int compo=0) const ;
+
     Vector getValuesOnComponent(int compo) const ;
 
     Vector getValuesOnAllComponents(int elem) const ;
index 2934d6a922de1d4de2019957fa1d4d26f4ee1809..b7a4e94c363105167337b89efc0127702074a129 100755 (executable)
@@ -1108,6 +1108,15 @@ Field::getValuesOnComponent(int compo) const
        return v;
 }
 
+std::vector< double > 
+Field::getFieldValues(int compo) const 
+{
+       std::vector< double > v(getNumberOfElements());
+       for(int i=0;i<getNumberOfElements();i++)
+               v[i]=(*this)(i,compo);
+       return v;
+}
+
 std::ostream& operator<<(std::ostream& out, const Field& field )
 {
        cout << "Field " << field.getName() << " : " << endl ;