-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathVFHeat.c
110 lines (76 loc) · 1.79 KB
/
VFHeat.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
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
/*
VFHeat.c
Generic interface to heat solvers
(c) 2011-2013 C. Chukwudozie, LSU
*/
#include "petsc.h"
#include "VFCartFE.h"
#include "VFCommon.h"
#include "VFHeat.h"
#include "VFHeat_SNESFEM.h"
#undef __FUNCT__
#define __FUNCT__ "BCTInit"
extern PetscErrorCode BCTInit(VFBC *BCT,VFCtx *ctx)
{
PetscErrorCode ierr;
PetscFunctionBegin;
ierr = VFBCCreate(BCT,1);CHKERRQ(ierr);
PetscFunctionReturn(0);
}
#undef __FUNCT__
#define __FUNCT__ "BCQTInit"
extern PetscErrorCode BCQTInit(VFBC *BCQT,VFCtx *ctx)
{
PetscErrorCode ierr;
PetscFunctionBegin;
ierr = VFBCCreate(BCQT,3);CHKERRQ(ierr);
PetscFunctionReturn(0);
}
/*
VFHeatTimeStep: Does one time step of the flow solver selected in ctx.heatsolver
*/
#undef __FUNCT__
#define __FUNCT__ "VF_HeatTimeStep"
extern PetscErrorCode VF_HeatTimeStep(VFCtx *ctx,VFFields *fields)
{
PetscErrorCode ierr;
PetscFunctionBegin;
switch (ctx->heatsolver) {
case HEATSOLVER_SNESFEM:
ierr = VF_HeatFEMSNESSolve(ctx,fields);CHKERRQ(ierr);
break;
default:
break;
}
PetscFunctionReturn(0);
}
#undef __FUNCT__
#define __FUNCT__ "VF_HeatSolverFinalize"
extern PetscErrorCode VF_HeatSolverFinalize(VFCtx *ctx,VFFields *fields)
{
PetscErrorCode ierr;
PetscFunctionBegin;
switch (ctx->heatsolver) {
case HEATSOLVER_SNESFEM:
ierr = VF_FEMSNESHeatSolverFinalize(ctx,fields);CHKERRQ(ierr);
break;
default:
break;
}
PetscFunctionReturn(0);
}
#undef __FUNCT__
#define __FUNCT__ "VF_HeatSolverInitialize"
extern PetscErrorCode VF_HeatSolverInitialize(VFCtx *ctx,VFFields *fields)
{
PetscErrorCode ierr;
PetscFunctionBegin;
switch (ctx->heatsolver) {
case HEATSOLVER_SNESFEM:
ierr = VF_FEMSNESHeatSolverInitialize(ctx,fields);CHKERRQ(ierr);
break;
default:
break;
}
PetscFunctionReturn(0);
}