Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removed the analytic part #6

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 8 additions & 26 deletions src/fortran/burgers_static.F90
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ PROGRAM burgers_static
INTEGER(CMISSIntg), PARAMETER :: EquationsSetUserNumber=11
INTEGER(CMISSIntg), PARAMETER :: ProblemUserNumber=12
INTEGER(CMISSIntg), PARAMETER :: ControlLoopNode=0
INTEGER(CMISSIntg), PARAMETER :: AnalyticFieldUserNumber=13
INTEGER(CMISSIntg), PARAMETER :: SolverUserNumber=1

!Program variables
Expand Down Expand Up @@ -62,22 +61,21 @@ PROGRAM burgers_static
TYPE(cmfe_DecompositionType) :: Decomposition
TYPE(cmfe_EquationsType) :: Equations
TYPE(cmfe_EquationsSetType) :: EquationsSet
TYPE(cmfe_FieldType) :: GeometricField,EquationsSetField,DependentField,MaterialsField,AnalyticField
TYPE(cmfe_FieldType) :: GeometricField,EquationsSetField,DependentField,MaterialsField
TYPE(cmfe_FieldsType) :: Fields
TYPE(cmfe_GeneratedMeshType) :: GeneratedMesh
TYPE(cmfe_MeshType) :: Mesh
TYPE(cmfe_NodesType) :: Nodes
TYPE(cmfe_ProblemType) :: Problem
TYPE(cmfe_ControlLoopType) :: ControlLoop
TYPE(cmfe_RegionType) :: Region,WorldRegion
TYPE(cmfe_SolverType) :: Solver, LinearSolver, NonlinearSolver
TYPE(cmfe_SolverType) :: Solver,LinearSolver,NonlinearSolver
TYPE(cmfe_SolverEquationsType) :: SolverEquations
LOGICAL :: EXPORT_FIELD

!Generic CMISS variables
INTEGER(CMISSIntg) :: NumberOfComputationalNodes,ComputationalNodeNumber,BoundaryNodeDomain
INTEGER(CMISSIntg) :: EquationsSetIndex
INTEGER(CMISSIntg) :: Err
INTEGER(CMISSIntg) :: EquationsSetIndex,Err

!Intialise OpenCMISS
CALL cmfe_Initialise(WorldCoordinateSystem,WorldRegion,Err)
Expand Down Expand Up @@ -246,19 +244,7 @@ PROGRAM burgers_static
!Finish the equations set material field variables
CALL cmfe_EquationsSet_MaterialsCreateFinish(EquationsSet,Err)
!Initialise materials field
CALL cmfe_Field_ComponentValuesInitialise(MaterialsField,CMFE_FIELD_U_VARIABLE_TYPE,CMFE_FIELD_VALUES_SET_TYPE, &
& 1,NU_PARAM,Err)

!-----------------------------------------------------------------------------------------------------------
! ANALYTIC FIELD
!-----------------------------------------------------------------------------------------------------------

!Create the equations set analytic field variables
!CALL cmfe_Field_Initialise(AnalyticField,Err)
!CALL cmfe_EquationsSet_AnalyticCreateStart(EquationsSet,CMFE_EQUATIONS_SET_BURGERS_EQUATION_ONE_DIM_1,AnalyticFieldUserNumber, &
! & AnalyticField,Err)
!Finish the equations set analytic field variables
!CALL cmfe_EquationsSet_AnalyticCreateFinish(EquationsSet,Err)
CALL cmfe_Field_ComponentValuesInitialise(MaterialsField,CMFE_FIELD_U_VARIABLE_TYPE,CMFE_FIELD_VALUES_SET_TYPE,1,NU_PARAM,Err)

!-----------------------------------------------------------------------------------------------------------
! EQUATIONS
Expand All @@ -273,9 +259,6 @@ PROGRAM burgers_static
!Finish the equations set equations
CALL cmfe_EquationsSet_EquationsCreateFinish(EquationsSet,Err)

!Create the equations set boundary conditions
!CALL cmfe_EquationsSetBoundaryConditionsAnalytic(EquationsSet,Err)

!-----------------------------------------------------------------------------------------------------------
!PROBLEM
!-----------------------------------------------------------------------------------------------------------
Expand All @@ -292,7 +275,7 @@ PROGRAM burgers_static
CALL cmfe_Problem_ControlLoopCreateStart(Problem,Err)
!Get the control loop
CALL cmfe_Problem_ControlLoopGet(Problem,CMFE_CONTROL_LOOP_NODE,ControlLoop,Err)
CALL cmfe_ControlLoop_OutputTypeSet(ControlLoop,CMFE_CONTROL_LOOP_PROGRESS_OUTPUT,Err)
CALL cmfe_ControlLoop_OutputTypeSet(ControlLoop,CMFE_CONTROL_LOOP_NO_OUTPUT,Err)

!Finish creating the problem control loop
CALL cmfe_Problem_ControlLoopCreateFinish(Problem,Err)
Expand Down Expand Up @@ -387,17 +370,16 @@ PROGRAM burgers_static
!-----------------------------------------------------------------------------------------------------------

!Solve the problem
WRITE(*,'(A)') "Solving problem..."
CALL cmfe_Problem_Solve(Problem,Err)
WRITE(*,'(A)') "Problem solved!"

!-----------------------------------------------------------------------------------------------------------
!OUTPUT
!-----------------------------------------------------------------------------------------------------------

!Output Analytic analysis
!Call cmfe_AnalyticAnalysis_Output(DependentField,"BurgersAnalytics_1D",Err)

!export fields
EXPORT_FIELD=.TRUE.
EXPORT_FIELD=.FALSE.
IF(EXPORT_FIELD) THEN
CALL cmfe_Fields_Initialise(Fields,Err)
CALL cmfe_Fields_Create(Region,Fields,Err)
Expand Down
32 changes: 2 additions & 30 deletions src/fortran/visualiseBurgersStatic.cmgui
Original file line number Diff line number Diff line change
@@ -1,33 +1,5 @@
#gfx read node burgers_static.part0.exnode;
#gfx read elem burgers_static.part0.exelem;

$dt=1; # frequency
$steps=100; # number of time steps
$cores=1; # number of processors

$w=500; # width of the graphical window
$h=1000; # height of the graphical window

#Read in the sequence of nodal positions.
for($i=0; $i < $steps; $i=$i+$dt)
{
$time = $i/$dt
for ($j=0; $j < $cores; $j=$j+1)
{
$filename = sprintf("./output/MainTime_%01d.part%01d.exnode", $i, $j);
print "Reading $filename time $time\n";
gfx read node "$filename" time $i;
#$filename = sprintf("./Burgers_%d.jpg", $i);
#gfx print window 1 jpg file "$filename" height 1000 width 1000
}
}

#Read in the element description
for ($k=0;$k<$cores;$k=$k+1)
{
$filename = sprintf("./output/MainTime_0.part%01d.exelem", $k);
gfx read element "$filename";
}
gfx read node "./output/STATIC_SOLUTION.part0.exnode";
gfx read element "./output/STATIC_SOLUTION.part0.exelem";

gfx define faces egroup BurgersRegion

Expand Down