Debian Codegraph @

src/num/aslInterfaceTrackingAlg1.cxx

raw
1 /*
2 * Advanced Simulation Library <http://asl.org.il>
3 *
4 * Copyright 2015 Avtech Scientific <http://avtechscientific.com>
5 *
6 *
7 * This file is part of Advanced Simulation Library (ASL).
8 *
9 * ASL is free software: you can redistribute it and/or modify it
10 * under the terms of the GNU Affero General Public License as
11 * published by the Free Software Foundation, version 3 of the License.
12 *
13 * ASL is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Affero General Public License for more details.
17 *
18 * You should have received a copy of the GNU Affero General Public License
19 * along with ASL. If not, see <http://www.gnu.org/licenses/>.
20 *
21 */
22
23
24 #include "aslInterfaceTrackingAlg1.h"
25 #include "math/aslTemplates.h"
26 #include "data/aslDataWithGhostNodes.h"
27 #include "acl/acl.h"
28 #include "acl/Kernels/aclKernel.h"
29 #include "acl/Kernels/aclKernelConfigurationTemplates.h"
30 #include "acl/Kernels/aclKernelMerger.h"
31 #include "acl/aclGenerators.h"
32 #include "acl/aclMath/aclVectorOfElements.h"
33 #include "acl/aclMath/aclBarycentric.h"
34 #include "math/aslTemplates.h"
35 #include "math/aslTemplateVE.h"
36 #include "math/aslTemplatesExtras.h"
37 #include "math/aslDistanceFunction.h"
38 #include <algorithm>
39
40 namespace asl
41 {
42
43 InterfaceTrackingAlg1::~InterfaceTrackingAlg1()
44 {}
45
46 InterfaceTrackingAlg1::InterfaceTrackingAlg1()
47 {
48 }
49
50 InterfaceTrackingAlg1::InterfaceTrackingAlg1(Data df, DataGen v):
51 LevelSetLinear(df),
52 velocity(v)
53 {
54 }
55
56
57 void InterfaceTrackingAlg1::initVelocityComputation()
58 {
59 auto & kk(*kernel);
60 unsigned int nv(vectorTemplate->vectors.size());
61 unsigned int nd(nD(*vectorTemplate));
62
63 vector<TemplateVE> velocityT(nd);
64 for(unsigned int i(0); i < nd; ++i)
65 {
66 velocityT[i].init(*velocity, *vectorTemplate, i);
67 kk << velocityT[i].initValues;
68 }
69
70 lVelocities.resize(nv);
71 for(unsigned int i(0); i < nv; ++i)
72 {
73 copy(subVE(velocityT[0].values,i,i), lVelocities[i]);
74 for(unsigned int j(1); j < nd; ++j)
75 copy(cat(lVelocities[i],
76 subVE(velocityT[j].values,i,i)),
77 lVelocities[i]);
78 }
79
80 }
81
82 } // asl