forked from NaluCFD/Nalu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAlgorithm.C
58 lines (50 loc) · 1.93 KB
/
Algorithm.C
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
/*------------------------------------------------------------------------*/
/* Copyright 2014 Sandia Corporation. */
/* This software is released under the license detailed */
/* in the file, LICENSE, which is located in the top-level Nalu */
/* directory structure */
/*------------------------------------------------------------------------*/
#include <Algorithm.h>
#include <SupplementalAlgorithm.h>
#include <Kernel.h>
namespace sierra{
namespace nalu{
//==========================================================================
// Class Definition
//==========================================================================
// Algorithm - base class for algorithm
//==========================================================================
//--------------------------------------------------------------------------
//-------- constructor -----------------------------------------------------
//--------------------------------------------------------------------------
Algorithm::Algorithm(
Realm &realm,
stk::mesh::Part *part)
: realm_(realm)
{
// push back on partVec
partVec_.push_back(part);
}
// alternative; provide full partVec
Algorithm::Algorithm(
Realm &realm,
stk::mesh::PartVector &partVec)
: realm_(realm),
partVec_(partVec)
{
// nothing to do
}
//--------------------------------------------------------------------------
//-------- destructor ------------------------------------------------------
//--------------------------------------------------------------------------
Algorithm::~Algorithm()
{
std::vector<SupplementalAlgorithm *>::iterator ii;
for( ii=supplementalAlg_.begin(); ii!=supplementalAlg_.end(); ++ii )
delete *ii;
std::vector<Kernel*>::iterator ij;
for (ij = activeKernels_.begin(); ij != activeKernels_.end(); ++ij)
delete *ij;
}
} // namespace nalu
} // namespace Sierra