-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathSIMExplPhaseField.h
111 lines (96 loc) · 3.59 KB
/
SIMExplPhaseField.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
// $Id$
//==============================================================================
//!
//! \file SIMExplPhaseField.h
//!
//! \date May 27 2016
//!
//! \author Knut Morten Okstad / SINTEF
//!
//! \brief Solution driver representing an explicit phase-field.
//!
//==============================================================================
#ifndef _SIM_EXPL_PHASE_FIELD_H
#define _SIM_EXPL_PHASE_FIELD_H
#include "SIMbase.h"
#include "SIMdummy.h"
#include "SIMenums.h"
class SIMoutput;
class DataExporter;
class TimeStep;
class VTF;
namespace LR { class LRSpline; struct RefineData; }
/*!
\brief Driver class for an explicit phase-field.
*/
class SIMExplPhaseField : public SIMdummy<SIMbase>
{
public:
//! \brief Default constructor.
explicit SIMExplPhaseField(SIMoutput* gridOwner = nullptr);
//! \brief The destructor deletes the explicit phase field function.
virtual ~SIMExplPhaseField();
//! \brief Registers fields for data output.
void registerFields(DataExporter& exporter);
//! \brief Initializes the problem.
bool init(const TimeStep&);
//! \brief Saves the converged results of a given time step to VTF file.
bool saveStep(const TimeStep& tp, int& nBlock);
//! \brief Computes the solution for the current time step.
bool solveStep(TimeStep& tp, bool = true);
//! \brief Returns the initial crack function.
RealFunc* getInitCrack() const { return phaseFunc; }
//! \brief Dummy method.
bool postSolve(TimeStep&) { return true; }
//! \brief Dummy method.
bool advanceStep(TimeStep&) { return true; }
//! \brief Dummy method.
bool serialize(std::map<std::string,std::string>&) { return false; }
//! \brief Dummy method.
bool deSerialize(const std::map<std::string,std::string>&) { return false; }
//! \brief Dummy method.
bool dumpGeometry(std::ostream& os) const { return false; }
//! \brief Dummy method.
bool saveResidual(const TimeStep&, const Vector&, int&) { return true; }
//! \brief Dummy method.
bool checkStopCriterion () const { return false; }
//! \brief Dummy method.
void setTensileEnergy(const RealArray*) {}
//! \brief Dummy method.
void setVTF(VTF*) {}
//! \brief Dummy method.
double getNorm(Vector&, size_t = 0) const { return 0.0; }
//! \brief Dummy method.
const Vector& getGlobalNorms() const { static Vector g; return g; }
//! \brief Returns a const reference to the current solution.
const Vector& getSolution(int = 0) const { return phaseField; }
//! \brief Updates the solution vector.
void setSolution(const Vector& vec) { phaseField = vec; }
//! \brief Returns the maximum number of iterations (unlimited).
int getMaxit() const { return 9999; }
//! \brief Dummy method.
int getOutPrec() const { return 0; }
//! \brief Dummy method.
SIM::ConvStatus solveIteration(TimeStep&) { return SIM::CONVERGED; }
//! \brief Dummy method.
Vector getHistoryField() const { return Vector(); }
//! \brief Dummy method.
void setHistoryField(const RealArray&) {}
//! \brief Dummy method.
bool refine(const LR::RefineData&) { return false; }
//! \brief Dummy method.
void getBasis(std::vector<LR::LRSpline*>&) {}
//! \brief Dummy method.
bool transferHistory(const RealArray&,
std::vector<LR::LRSpline*>&) { return true; }
protected:
using SIMbase::parse;
//! \brief Parses a data section from an XML element.
virtual bool parse(const tinyxml2::XMLElement* elem);
private:
SIMoutput* myOwner; //!< The FE mesh holder
int myStep; //!< VTF file step counter
RealFunc* phaseFunc; //!< Explicit phase field function
Vector phaseField; //!< Nodal phase field values
};
#endif