This file is indexed.

/usr/include/ASL/num/aslFDElasticityBC.h is in libasl-dev 0.1.7-2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
/*
 * Advanced Simulation Library <http://asl.org.il>
 * 
 * Copyright 2015 Avtech Scientific <http://avtechscientific.com>
 *
 *
 * This file is part of Advanced Simulation Library (ASL).
 *
 * ASL is free software: you can redistribute it and/or modify it
 * under the terms of the GNU Affero General Public License as
 * published by the Free Software Foundation, version 3 of the License.
 *
 * ASL is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with ASL. If not, see <http://www.gnu.org/licenses/>.
 *
 */


#ifndef ASLFDELASTICITYBC_H
#define ASLFDELASTICITYBC_H

#include "aslBCond.h"
#include "acl/aclMath/aclVectorOfElementsDef.h"

namespace acl{
	class Kernel;
	typedef std::shared_ptr<Kernel> SPKernel;
}

namespace asl
{
	class ElasticityCommonA;
	typedef std::shared_ptr<ElasticityCommonA> SPElasticityCommonA;
	class FDElasticityIncompressibleStatic;
	typedef std::shared_ptr<FDElasticityIncompressibleStatic> SPFDElasticityIncompressibleStatic;
	class FDElasticityRelaxation;
	typedef std::shared_ptr<FDElasticityRelaxation> SPFDElasticityRelaxation;
	class FDElasticity2;
	typedef std::shared_ptr<FDElasticity2> SPFDElasticity2;
		
	/// Bondary condition corresponding to a rigid wall (\f$\vec u=0\f$ and \f$\nabla p=0\f$)
	/**	 
		 \ingroup ElasticityBC
	*/
	class BCRigidWall:public BCond
	{		
		protected:
			std::unique_ptr<acl::Kernel> kernel;			
			SPFDElasticityIncompressibleStatic num;
		public:
			BCRigidWall(SPFDElasticityIncompressibleStatic nm);
			virtual void execute();
			virtual void init();			
	};

	/// Bondary condition corresponding to a rigid wall (\f$\vec u=0\f$ and \f$\nabla p=0\f$)
	/**	 
		 \ingroup ElasticityBS
	*/

	SPBCond generateBCRigidWall(SPFDElasticityIncompressibleStatic nm, 
                                 const std::vector<SlicesNames> & sl);

	/// Bondary condition corresponding to a rigid wall (\f$\vec u=0\f$ and \f$\nabla p=0\f$)
	/**	 
		 \ingroup ElasticityBC
	*/
	class BCRigidWallRelaxation:public BCond
	{		
		protected:
			std::unique_ptr<acl::Kernel> kernel;			
			SPFDElasticityRelaxation num;
			acl::VectorOfElements value;
		public:
			BCRigidWallRelaxation(SPFDElasticityRelaxation nm);
			BCRigidWallRelaxation(SPFDElasticityRelaxation nm, acl::VectorOfElements v);
			virtual void execute();
			virtual void init();			
	};

	/// Bondary condition corresponding to a rigid wall (\f$\vec u=0\f$ and \f$\nabla p=0\f$)
	/**	 
		 \ingroup ElasticityBS
	*/

	SPBCond generateBCRigidWall(SPFDElasticityRelaxation nm, 
                                 const std::vector<SlicesNames> & sl);
	
	/// Bondary condition corresponding to a rigid wall (\f$ u=0\f$ and \f$\dot u=0\f$)
	/**	 
		 \ingroup ElasticityBC
	*/

	SPBCond generateBCRigidWall(SPFDElasticity2 nm, 
                                 const std::vector<SlicesNames> & sl);
	
	/// Bondary condition corresponding to a rigid wall (\f$ u=u_0\f$ and \f$\dot u=0\f$)
	/**	 
		 \ingroup ElasticityBC
	*/

	SPBCond generateBCRigidWall(SPFDElasticity2 nm, 
	                             const AVec<> & u0,
                                 const std::vector<SlicesNames> & sl);

	/// Bondary condition corresponding to a rigid wall (\f$ u=u_0\f$ and \f$\dot u=0\f$)
	/**	 
		 \ingroup ElasticityBC
	*/

	SPBCond generateBCRigidWall(SPFDElasticityRelaxation nm, 
	                             const AVec<> & u0,
                                 const std::vector<SlicesNames> & sl);
	
	/// Bondary condition corresponding to a free surface (\f$\partial_{\vec n}u=0\f$ and \f$\partial_{\vec n}\dot u=0\f$)
	/**	 
		 \ingroup ElasticityBC
	*/
	class BCFreeSurface:public BCond
	{		
		protected:
			std::unique_ptr<acl::Kernel> kernel;			
			FDElasticityIncompressibleStatic* num;
		public:
			BCFreeSurface(FDElasticityIncompressibleStatic* nm);
			virtual void execute();
			virtual void init();			
	};

	/// Bondary condition corresponding to a free surface (\f$\partial_{\vec n}u=0\f$)
	/**	 
		 \note The free boundary conditions have a different mathematical formulation, 
		 see BCFreeSurface2Real 
		 
		 \ingroup ElasticityBC
	*/
	class BCFreeSurface2:public BCond
	{		
		protected:
			std::unique_ptr<acl::Kernel> kernel;			
			SPFDElasticity2 num;
		public:
			BCFreeSurface2(SPFDElasticity2 nm);
			~BCFreeSurface2();			
			virtual void execute();
			virtual void init();			
	};

	/// Bondary condition corresponding to a free surface 
	/**	 
		 \ingroup ElasticityBC
		 
		The class is a realisation of 1st order explicit free boundary conditions
		for rectangular grid and arbitrary geometry. The geometry is defined by a levelset
		The algorithm computes value in a ghost node. This is done by cell subdivision. 
		The unit cell containing the ghost node in the center. It is splited into 
		elementary cells the spliting is described by the corresponding VTObjects. 

		 The gradient in the elementary cells is computed by the following expression:
		 \f[
		    \nabla_i u_j = (u^k_j - u^0_j E_k) T_{ki},
		 \f]
		 where \f$ u^k_j\f$ is the \f$ k^{th}\f$ point of the elementary cell, 
		 \f$ E_k \f$ is the vector filled by 1 and \f$ T_{ki} \f$ is the baricentric 
		 coordinates transformation matrix. 

		 The free boundary condition has the following expression:
		\f[
			\lambda n_i\nabla_k u_k+\mu n_j \left( \nabla_i u_j + \nabla_j u_i \right) = F_i,
		\f]
		where \f$ \lambda \f$ is a Lame first parameter, \f$ \mu \f$  is shear modulus.
		This expression can be rewriten in terms of the elementary cell expresion:
		\f[
			\lambda n_i(u^k_j - u^0_j E_k) T_{kj} + 
			\mu n_j \left( (u^k_j - u^0_j E_k) T_{ki} + (u^k_i - u^0_i E_k) T_{kj} \right) = F_i,
		\f]
		This equation can be rewritten in form of \f$ A_{ij} u^0_j = b_i \f$:
		\f[
		   A_{ij}=\lambda n_i E_kT_{kj} + \mu n_j  E_k T_{ki} + \mu n_l E_k T_{kl} \delta_{ij},
		\f]
		\f[
		   b_i = \lambda n_i u^k_j T_{kj} + \mu n_j (u^k_j T_{ki}+ u^k_i T_{kj}) - F_i.
		\f]		
		The solution of the system of equations is the seeking boundary condition.
			
		The class should obtain list of the ghost points

	*/
	class BCZeroStressMap: public BCondWithMap
	{		
		protected:
			SPAbstractDataWithGhostNodes displacement; 
			acl::VectorOfElements lambda;
			acl::VectorOfElements mu;
			acl::SPKernel kernel;
		public:
			BCZeroStressMap(SPAbstractDataWithGhostNodes displacement, 
			                acl::VectorOfElements lambda,
			                acl::VectorOfElements mu,
			                SPAbstractDataWithGhostNodes map,
			                const VectorTemplate *const t);
			~BCZeroStressMap();			
			virtual void execute();
			virtual void init();			
	};

	/// Bondary condition set given values to displacement/velocity
	/**	 
		 \ingroup ElasticityBC
	*/
	SPNumMethod generateBCZeroStress(SPElasticityCommonA nm, 
	                                 SPAbstractDataWithGhostNodes map);


	/// Bondary condition set given values to displacement/velocity
	/**	 
		 \ingroup ElasticityBC
	*/
//	SPNumMethod generateBCZeroStress(SPFDElasticityIncompressibleStatic nm, 
//	                                 SPAbstractDataWithGhostNodes map);

	/// Bondary condition set given values to displacement/velocity
	/**	 
		 \ingroup ElasticityBC
	*/
//	SPNumMethod generateBCZeroStress(SPFDElasticityRelaxation nm, 
//	                                 SPAbstractDataWithGhostNodes map);
	
	/// Bondary condition set given values to pressure
	/**	 
		 \ingroup ElasticityBC
	*/
	SPNumMethod generateBCZeroStressP(SPFDElasticityIncompressibleStatic nm, 
	                                  SPAbstractDataWithGhostNodes map);

	/// Bondary condition set given values to displacement/velocity
	/**	 
		 \ingroup ElasticityBC
	*/
	SPNumMethod generateBCZeroStressP(SPFDElasticityRelaxation nm, 
	                                  SPAbstractDataWithGhostNodes map);
	
	/// Bondary condition set given values to displacement/velocity
	/**	 
		 \ingroup ElasticityBC
	*/
	class BCImposedDisplacementVelocityValue:public BCond
	{		
		protected:
			std::unique_ptr<acl::Kernel> kernel;			
			SPFDElasticityIncompressibleStatic num;
			AVec<double> displacement;
			bool bDisplacement;
			AVec<double> velocity;
			bool bVelocity;
			bool initialized;
		public:
			BCImposedDisplacementVelocityValue(SPFDElasticityIncompressibleStatic nm);
			virtual void execute();
			virtual void init();			
			void setDisplacement(AVec<double> d);
			void setVelocity(AVec<double> v);
	};

	/// Bondary condition local force(acceleration)
	/**	 
		 \ingroup ElasticityBC
	*/
	class BCAccelerationSource2: public BCond
	{		
		protected:
			std::unique_ptr<acl::Kernel> kernel;			
			FDElasticity2* num;
			acl::VectorOfElements acceleration;
			bool initialized;
		public:
			BCAccelerationSource2(FDElasticity2* nm);
			virtual void execute();
			virtual void init();			
			void setAcceleration(AVec<double> a);
	};
		 
} //asl

#endif //ASLFDELASTICITYBC_H