LifeV
LevelSetData.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 Contains the data container for the LevelSetSolver
30 
31  @author Samuel Quinodoz <samuel.quinodoz@epfl.ch>
32  @date 10-11-2010
33 
34  @contributor Samuel Quinodoz <samuel.quinodoz@epfl.ch>
35  @mantainer Samuel Quinodoz <samuel.quinodoz@epfl.ch>
36 
37  */
38 
39 #include <lifev/level_set/solver/LevelSetData.hpp>
40 
41 namespace LifeV
42 {
43 
44 // ===================================================
45 // Constructors & Destructor
46 // ===================================================
49  M_time ( ),
50  M_timeAdvance ( ),
51  M_stabilization ( ),
52  M_IPTreatment ( ),
53  M_IPCoef ( )
54 {}
55 
56 // ===================================================
57 // Methods
58 // ===================================================
59 void
61 setup ( const GetPot& dataFile, const std::string& section)
62 {
63  // If data time has not been set
64  if ( !M_time.get() )
65  {
66  M_time.reset ( new time_Type ( dataFile, section + "/time_discretization" ) );
67  }
68 
69  if ( !M_timeAdvance.get() )
70  {
71  M_timeAdvance.reset ( new timeAdvance_Type ( dataFile, section + "/time_discretization" ) );
72  }
73 
74  std::string stabName = dataFile ( (section + "/stabilization").data(), "none");
75  setStabilization (stabName);
76  std::string ipName = dataFile ( (section + "/ip/treatment").data(), "implicit");
77  setIPTreatment (ipName);
78  M_IPCoef = dataFile ( (section + "/ip/coefficient").data(), 0.0);
79 }
80 
81 void
83 showMe (std::ostream& output) const
84 {
85  output << " Time data : " << std::endl;
86  M_time->showMe ( output );
87  M_timeAdvance->showMe ( output );
88 
89  output << " Stabilization : ";
90  if (M_stabilization == NONE)
91  {
92  output << "none" << std::endl;
93  }
94  if (M_stabilization == IP)
95  {
96  output << "ip" << std::endl;
97  }
98 
99  output << " IP Treatment : ";
100  if (M_IPTreatment == IMPLICIT)
101  {
102  output << "implicit" << std::endl;
103  }
105  {
106  output << "semi-implicit" << std::endl;
107  }
108  if (M_IPTreatment == EXPLICIT)
109  {
110  output << "explicit" << std::endl;
111  }
112 
113  output << " IP coefficient : " << M_IPCoef << std::endl;
114 }
115 
116 // ===================================================
117 // Set Methods
118 // ===================================================
119 void
120 DataLevelSet::
121 setStabilization (const std::string& stab)
122 {
123  if (stab.compare ("ip") == 0)
124  {
126  }
127  else
128  {
129  ASSERT ( stab.compare ("none") == 0, " Unknown stabilization! ");
131  }
132 }
133 
134 void
135 DataLevelSet::
136 setIPTreatment (const std::string& treat)
137 {
138  if (treat.compare ("implicit") == 0)
139  {
141  }
142  else if (treat.compare ("semi-implicit") == 0)
143  {
145  }
146  else
147  {
148  ASSERT ( treat.compare ("explicit") == 0, " Unknown IP treatment! ");
150  }
151 }
152 
153 
154 } // Namespace LifeV
Completly explicit, not very usefull but available.
Semi-implicit, best choice for faster computations.
void showMe(std::ostream &out=std::cout) const
ShowMe method.
Fully implicit stabilization (standard procedure)
timeAdvancePtr_Type M_timeAdvance
stabilization_type M_stabilization
DataLevelSet()
Empty Constructor.
void updateInverseJacobian(const UInt &iQuadPt)
IPTreatment_type M_IPTreatment
#define ASSERT(X, A)
Definition: LifeAssert.hpp:90
The IP stabiilzation will be used.
void setStabilization(const std::string &stab)
Set the stabilization type.
void setup(const GetPot &dataFile, const std::string &section="level-set")
Fill the DataLevelSet with the informations of the GetPot object.
No stabilization will be added.
void setIPTreatment(const std::string &treat)
Set the treatment for the IP stabilization.
dataLevelSet - Container for the data for the level set solver