1 #ifndef MIXEDMODELFACTORY_H
2 #define MIXEDMODELFACTORY_H
4 #define NO_INSTANCE std::cout<<"Constructing model object from template class:"<<std::endl \
5 <<"return static_cast<Model_Base*>(new ModelTemplate<CompKernelTemplate<" \
7 <<nDOF_mesh_trial_elementIn<<"," \
8 <<nDOF_trial_elementIn<<"," \
9 <<nDOF_test_elementIn<<">,CompKernelTemplate_v<" \
11 <<nDOF_mesh_trial_elementIn<<"," \
12 <<nDOF_v_trial_elementIn<<"," \
13 <<nDOF_v_test_elementIn<<">," \
15 <<nQuadraturePoints_elementIn<<"," \
16 <<nDOF_mesh_trial_elementIn<<"," \
17 <<nDOF_trial_elementIn<<"," \
18 <<nDOF_test_elementIn<<"," \
19 <<nDOF_v_trial_elementIn<<"," \
20 <<nDOF_v_test_elementIn<<"," \
21 <<nQuadraturePoints_elementBoundaryIn<<">());" \
22 <<std::endl<<std::flush
26 template<
class Model_Base,
27 template<
class CompKernelType,
28 class CompKernelType_v,
30 int nQuadraturePoints_element,
31 int nDOF_mesh_trial_element,
32 int nDOF_trial_element,
33 int nDOF_test_element,
34 int nDOF_v_trial_element,
35 int nDOF_v_test_element,
36 int nQuadraturePoints_elementBoundary>
39 int nDOF_mesh_trial_element,
40 int nDOF_trial_element,
41 int nDOF_test_element>
42 class CompKernelTemplate_v,
44 int nDOF_mesh_trial_element,
45 int nDOF_v_trial_element,
46 int nDOF_v_test_element>
47 class CompKernelTemplate>
49 int nQuadraturePoints_elementIn,
50 int nDOF_mesh_trial_elementIn,
51 int nDOF_trial_elementIn,
52 int nDOF_test_elementIn,
53 int nDOF_v_trial_elementIn,
54 int nDOF_v_test_elementIn,
55 int nQuadraturePoints_elementBoundaryIn,
58 if (CompKernelFlag == 0)
62 if (nDOF_mesh_trial_elementIn == nDOF_trial_elementIn)
64 if (nDOF_mesh_trial_elementIn == 4)
66 if (nDOF_v_trial_elementIn == nDOF_trial_elementIn)
68 if (nQuadraturePoints_elementIn == 5)
69 return static_cast<Model_Base*
>(
new ModelTemplate<CompKernelTemplate<3,4,4,4>,CompKernelTemplate_v<3,4,4,4>,3,5,4,4,4,4,4,4>());
72 else if (nQuadraturePoints_elementIn == 15 && nQuadraturePoints_elementBoundaryIn == 7)
73 return static_cast<Model_Base*
>(
new ModelTemplate<CompKernelTemplate<3,4,4,4>,CompKernelTemplate_v<3,4,4,4>,3,15,4,4,4,4,4,7>());
74 else if (nQuadraturePoints_elementIn == 24 && nQuadraturePoints_elementBoundaryIn == 12)
75 return static_cast<Model_Base*
>(
new ModelTemplate<CompKernelTemplate<3,4,4,4>,CompKernelTemplate_v<3,4,4,4>,3,24,4,4,4,4,4,12>());
82 else if (nDOF_v_trial_elementIn == 10)
84 if (nQuadraturePoints_elementIn == 5)
85 return static_cast<Model_Base*
>(
new ModelTemplate<CompKernelTemplate<3,4,4,4>,CompKernelTemplate_v<3,4,10,10>,3,5,4,4,4,10,10,4>());
88 else if (nQuadraturePoints_elementIn == 15 && nQuadraturePoints_elementBoundaryIn == 7)
89 return static_cast<Model_Base*
>(
new ModelTemplate<CompKernelTemplate<3,4,4,4>,CompKernelTemplate_v<3,4,10,10>,3,15,4,4,4,10,10,7>());
102 else if (nDOF_mesh_trial_elementIn == 8)
104 if (nDOF_v_trial_elementIn == nDOF_trial_elementIn)
106 if (nQuadraturePoints_elementIn == 8)
108 if ( nQuadraturePoints_elementBoundaryIn == 4)
109 return static_cast<Model_Base*
>(
new ModelTemplate<CompKernelTemplate<3,8,8,8>,CompKernelTemplate_v<3,8,8,8>,3,8,8,8,8,8,8,4>());
136 else if (nDOF_v_trial_elementIn == 27)
138 if (nQuadraturePoints_elementIn == 8)
140 if ( nQuadraturePoints_elementBoundaryIn == 4)
141 return static_cast<Model_Base*
>(
new ModelTemplate<CompKernelTemplate<3,8,8,8>,CompKernelTemplate_v<3,8,27,27>,3,8,8,8,8,27,27,4>());
222 else if (nDOF_mesh_trial_elementIn == 4)
224 if (nDOF_trial_elementIn == 10)
226 if (nQuadraturePoints_elementIn == 4 && nQuadraturePoints_elementBoundaryIn == 3)
228 return static_cast<Model_Base*
>(
new ModelTemplate<CompKernelTemplate<3,4,10,10>,CompKernelTemplate_v<3,4,10,10>,3,4,4,10,10,10,10,3>());
287 template<
class Model_Base,
288 template<
class CompKernelType,
289 class CompKernelType_v,
291 int nQuadraturePoints_element,
292 int nDOF_mesh_trial_element,
293 int nDOF_trial_element,
294 int nDOF_test_element,
295 int nDOF_v_trial_element,
296 int nDOF_v_test_element,
297 int nQuadraturePoints_elementBoundary>
300 int nDOF_mesh_trial_element,
301 int nDOF_trial_element,
302 int nDOF_test_element>
303 class CompKernelTemplate,
305 int nDOF_mesh_trial_element,
306 int nDOF_v_trial_element,
307 int nDOF_v_test_element>
308 class CompKernelTemplate_v>
310 int nQuadraturePoints_elementIn,
311 int nDOF_mesh_trial_elementIn,
312 int nDOF_trial_elementIn,
313 int nDOF_test_elementIn,
314 int nDOF_v_trial_elementIn,
315 int nDOF_v_test_elementIn,
316 int nQuadraturePoints_elementBoundaryIn,
319 if (CompKernelFlag == 0)
323 if (nDOF_mesh_trial_elementIn == nDOF_trial_elementIn)
325 if (nDOF_trial_elementIn == nDOF_v_trial_elementIn)
327 if (nDOF_mesh_trial_elementIn == 3)
329 if (nQuadraturePoints_elementIn == 1)
331 if (nQuadraturePoints_elementBoundaryIn == 1)
332 return static_cast<Model_Base*
>(
new ModelTemplate<CompKernelTemplate<2,3,3,3>,CompKernelTemplate_v<2,3,3,3>,2,1,3,3,3,3,3,1>());
339 else if (nQuadraturePoints_elementIn == 3)
341 if (nQuadraturePoints_elementBoundaryIn == 2)
342 return static_cast<Model_Base*
>(
new ModelTemplate<CompKernelTemplate<2,3,3,3>,CompKernelTemplate_v<2,3,3,3>,2,3,3,3,3,3,3,2>());
349 else if (nQuadraturePoints_elementIn == 4)
351 if (nQuadraturePoints_elementBoundaryIn == 3)
352 return static_cast<Model_Base*
>(
new ModelTemplate<CompKernelTemplate<2,3,3,3>,CompKernelTemplate_v<2,3,3,3>,2,4,3,3,3,3,3,3>());
359 else if (nQuadraturePoints_elementIn == 6)
361 if (nQuadraturePoints_elementBoundaryIn == 4)
362 return static_cast<Model_Base*
>(
new ModelTemplate<CompKernelTemplate<2,3,3,3>,CompKernelTemplate_v<2,3,3,3>,2,6,3,3,3,3,3,4>());
369 else if (nQuadraturePoints_elementIn == 7)
371 if (nQuadraturePoints_elementBoundaryIn == 5)
372 return static_cast<Model_Base*
>(
new ModelTemplate<CompKernelTemplate<2,3,3,3>,CompKernelTemplate_v<2,3,3,3>,2,7,3,3,3,3,3,5>());
379 else if (nQuadraturePoints_elementIn == 12)
381 if (nQuadraturePoints_elementBoundaryIn == 6)
382 return static_cast<Model_Base*
>(
new ModelTemplate<CompKernelTemplate<2,3,3,3>,CompKernelTemplate_v<2,3,3,3>,2,12,3,3,3,3,3,6>());
395 else if(nDOF_mesh_trial_elementIn == 4)
397 if (nQuadraturePoints_elementIn == 4)
399 if (nQuadraturePoints_elementBoundaryIn == 2)
400 return static_cast<Model_Base*
>(
new ModelTemplate<CompKernelTemplate<2,4,4,4>,CompKernelTemplate_v<2,4,4,4>,2,4,4,4,4,4,4,2>());
407 else if (nQuadraturePoints_elementIn == 25)
409 if (nQuadraturePoints_elementBoundaryIn == 5)
410 return static_cast<Model_Base*
>(
new ModelTemplate<CompKernelTemplate<2,4,4,4>,CompKernelTemplate_v<2,4,4,4>,2,25,4,4,4,4,4,5>());
424 else if (nDOF_v_trial_elementIn == 6)
426 if (nDOF_mesh_trial_elementIn == 3)
428 if (nQuadraturePoints_elementIn == 1)
430 if (nQuadraturePoints_elementBoundaryIn == 1)
431 return static_cast<Model_Base*
>(
new ModelTemplate<CompKernelTemplate<2,3,3,3>,CompKernelTemplate_v<2,3,6,6>,2,1,3,3,3,6,6,1>());
438 else if (nQuadraturePoints_elementIn == 7)
440 if (nQuadraturePoints_elementBoundaryIn == 5)
441 return static_cast<Model_Base*
>(
new ModelTemplate<CompKernelTemplate<2,3,3,3>,CompKernelTemplate_v<2,3,6,6>,2,7,3,3,3,6,6,5>());
448 else if (nQuadraturePoints_elementIn == 12)
450 if (nQuadraturePoints_elementBoundaryIn == 6)
451 return static_cast<Model_Base*
>(
new ModelTemplate<CompKernelTemplate<2,3,3,3>,CompKernelTemplate_v<2,3,6,6>,2,12,3,3,3,6,6,6>());
476 else if (nDOF_mesh_trial_elementIn == 3)
478 if (nDOF_trial_elementIn == 6)
480 if (nQuadraturePoints_elementIn == 1)
482 if (nQuadraturePoints_elementBoundaryIn == 1)
483 return static_cast<Model_Base*
>(
new ModelTemplate<CompKernelTemplate<2,3,6,6>,CompKernelTemplate_v<2,3,6,6>,2,1,3,6,6,6,6,1>());