LifeV
WallTensionEstimatorData.cpp
Go to the documentation of this file.
1 //@HEADER
2 /*
3 *******************************************************************************
4 
5  Copyright (C) 2004, 2005, 2007 EPFL, Politecnico di Milano, INRIA
6  Copyright (C) 2010 EPFL, Politecnico di Milano, Emory University
7 
8  This file is part of LifeV.
9 
10  LifeV is free software; you can redistribute it and/or modify
11  it under the terms of the GNU Lesser General Public License as published by
12  the Free Software Foundation, either version 3 of the License, or
13  (at your option) any later version.
14 
15  LifeV is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  Lesser General Public License for more details.
19 
20  You should have received a copy of the GNU Lesser General Public License
21  along with LifeV. If not, see <http://www.gnu.org/licenses/>.
22 
23 *******************************************************************************
24 */
25 //@HEADER
26 
27 /*!
28  * @file
29  * @brief DataStructure - File containing a data container for wall tension analysis
30  *
31  * @version 1.0
32  * @date 19-04-2012
33  * @author Paolo Tricerri
34  *
35  * @maintainer Paolo Tricerri <paolo.tricerri@epfl.ch>
36  */
37 
38 #include <lifev/structure/solver/WallTensionEstimatorData.hpp>
39 
40 namespace LifeV
41 {
42 
43 //=====================================================
44 // Constructors
45 //=====================================================
46 WallTensionEstimatorData::WallTensionEstimatorData() :
47  M_nameFile ( ),
48  M_analysisType ( ),
49  M_recoveryVariable ( ),
50  M_initialTime ( ),
51  M_finalTime ( ),
52  M_iterStart ( ),
53  M_iterEnd ( )
54 {
55 }
56 
57 WallTensionEstimatorData::WallTensionEstimatorData ( const WallTensionEstimatorData& wallTensionEstimatorData ) :
58  M_nameFile ( wallTensionEstimatorData.M_nameFile ),
59  M_analysisType ( wallTensionEstimatorData.M_analysisType ),
60  M_recoveryVariable ( wallTensionEstimatorData.M_recoveryVariable ),
61  M_initialTime ( wallTensionEstimatorData.M_initialTime ),
62  M_finalTime ( wallTensionEstimatorData.M_finalTime ),
63  M_iterStart ( wallTensionEstimatorData.M_iterStart ),
64  M_iterEnd ( wallTensionEstimatorData.M_iterEnd )
65 {
66 }
67 
68 // ===================================================
69 // Operators
70 // ===================================================
71 WallTensionEstimatorData&
72 WallTensionEstimatorData::operator= ( const WallTensionEstimatorData& wallTensionEstimatorData )
73 {
74  if ( this != &wallTensionEstimatorData )
75  {
76  M_nameFile = wallTensionEstimatorData.M_nameFile;
77  M_analysisType = wallTensionEstimatorData.M_analysisType;
78  M_recoveryVariable = wallTensionEstimatorData.M_recoveryVariable;
79  M_initialTime = wallTensionEstimatorData.M_initialTime;
80  M_finalTime = wallTensionEstimatorData.M_finalTime;
81  M_iterStart = wallTensionEstimatorData.M_iterStart;
82  M_iterEnd = wallTensionEstimatorData.M_iterEnd;
83 
84  }
85 
86  return *this;
87 }
88 
89 // ===================================================
90 // Methods
91 // ===================================================
92 void
93 WallTensionEstimatorData::setup ( const GetPot& dataFile, const std::string& section )
94 {
95 
96  // physics
97  M_nameFile = dataFile ( ( section + "/analysis/nameFile" ).data(), "NO_DEFAULT_NAME_FILE" );
98  M_typeFile = dataFile ( ( section + "/analysis/typeFile" ).data(), "NO_DEFAULT_FILE_TYPE" );
99 
100  M_analysisType = dataFile ( ( section + "/analysis/analysisType" ).data(), "NO_DEFAULT_ANALYSIS_TYPE" );
101  M_recoveryVariable = dataFile ( ( section + "/analysis/recoveryVariable" ).data(), "NO_DEFAULT_ANALYSIS_TYPE" );
102 
103  UInt timesNumber (0);
104 
105  if ( !M_analysisType.compare ("istant") )
106  {
107  timesNumber = 1;
108  }
109  else
110  {
111  timesNumber = dataFile.vector_variable_size ( ( section + "/analysis/start" ).data() );
112  }
113 
114  //Resizing the vectors to store the right number of iterations & times
115  M_initialTime.resize (timesNumber);
116  M_finalTime.resize (timesNumber);
117 
118  M_iterStart.resize (timesNumber);
119  M_iterEnd.resize (timesNumber);
120 
121  for ( UInt i (0); i < timesNumber ; ++i)
122  {
123  M_initialTime[i] = dataFile ( ( section + "/analysis/start" ).data(), 0., i );
124  M_finalTime[i] = dataFile ( ( section + "/analysis/end" ).data(), 0., i );
125 
126  M_iterStart[i] = dataFile ( ( section + "/analysis/iterationStart" ).data(), "00000", i );
127  M_iterEnd[i] = dataFile ( ( section + "/analysis/iterationEnd" ).data(), "00000", i );
128  }
129 }
130 
131 void
132 WallTensionEstimatorData::showMe ( std::ostream& output ) const
133 {
134  // physics
135  output << "\n*** Values for wall tension analysis [solid/analysis]\n\n";
136  output << "Name File = " << M_nameFile << std::endl;
137  output << "Type File = " << M_typeFile << std::endl;
138  output << "Analysis Type = " << M_analysisType << std::endl;
139  output << "Recovery Variable = " << M_recoveryVariable << std::endl;
140  output << "The numbers of intervals is = " << M_initialTime.size() << std::endl;
141 
142  for ( UInt i (0); i < M_initialTime.size() ; ++i )
143  {
144  output << i + 1 << " Interval: " << std::endl;
145  output << "initial Time " << i + 1 << " = " << M_initialTime[i] << std::endl;
146  output << "final Time " << i + 1 << " = " << M_finalTime[i] << std::endl;
147 
148  output << "iteration Start " << i + 1 << "= " << M_iterStart[i] << std::endl;
149  output << "iteration End " << i + 1 << "= " << M_iterEnd[i] << std::endl;
150  }
151 }
152 
153 }
void updateInverseJacobian(const UInt &iQuadPt)
uint32_type UInt
generic unsigned integer (used mainly for addressing)
Definition: LifeV.hpp:191