Merge lp:~jon-hill/fluidity/diagnostic_check into lp:fluidity

Proposed by Jon Hill
Status: Needs review
Proposed branch: lp:~jon-hill/fluidity/diagnostic_check
Merge into: lp:fluidity
Diff against target: 554 lines (+382/-51)
11 files modified
diagnostics/Diagnostic_Fields_New.F90.in (+74/-9)
preprocessor/Additional_Field_Locations.F90 (+88/-0)
preprocessor/Makefile.dependencies (+8/-0)
preprocessor/Makefile.in (+2/-2)
preprocessor/Populate_State.F90 (+1/-40)
tests/additional_fields_diagnostics_check/Makefile (+24/-0)
tests/additional_fields_diagnostics_check/additional_fields_diagnostics_check.xml (+33/-0)
tests/additional_fields_diagnostics_check/diagnostics.flml (+115/-0)
tests/additional_fields_diagnostics_check/square.edge (+12/-0)
tests/additional_fields_diagnostics_check/square.ele (+12/-0)
tests/additional_fields_diagnostics_check/square.node (+13/-0)
To merge this branch: bzr merge lp:~jon-hill/fluidity/diagnostic_check
Reviewer Review Type Date Requested Status
Stephan Kramer Needs Fixing
sam Pending
Review via email: mp+203042@code.launchpad.net

Description of the change

Fix the lookup paths for diagnostics check_options to search for hidden paths. Test for this too. Made a new module that contains all these weird and wonderful paths for both Populate_state and diagnostics. And anything else that needs them too!

To post a comment you must log in.
Revision history for this message
Jon Hill (jon-hill) wrote :

Waiting on a green buildbot.

Revision history for this message
Stephan Kramer (s-kramer) wrote :

A few points:
* you have a few ALL CAPS words in there that shouldn't be: .OR. and DEP_LOOP
* in case(2) split_dependency(1) is the phase_name and split_dependency(2) is the field name, so the checks for additional fields after that as they currently are, don't make any sense.
* where is additional_diagnostic_fields defined? I can't find it anywhere...

review: Needs Fixing
Revision history for this message
Jon Hill (jon-hill) wrote :

1) The ALL CAPS are my code styling. I'll change the .OR. to .or., but the DEP_LOOP stays (I find it easier to spot in amongst the lower case code)

2) Not sure I entirely follow - if you have multiple phase support in your diagnostic, then it will appear in case(2) and you may still want to use, say, DistanceToBottom, which is one of the extra fields that can be checked for. The relative_path fields are checked within the correct material phase, but the others are absolute paths. Unless I got all this wrong! :)

3) Forgot to add the new module that contains the variables...fixed.

4307. By Jon Hill

Helps if you add your new files

Revision history for this message
Stephan Kramer (s-kramer) wrote :

Ad 1) Fine, but in all other Fluidity code ALLCAPS is only used for parameters. If do loop labels are hard to find, it means that the loop is too long (as in this case: the code under both cases are a copy and paste, so that should really just be separated out in a subroutine)

Ad 2) For the relative paths you have "scalar_field::" // trim(split_dependency(1)) everywhere, where split_dependency(1) is a phase name. For the absolute paths, I'm not really sure it makes sense for the user to specify PhaseName::DistanceToTop as the user has no clue that these fields are actually put in one of the (or in this case all) states, so they should just refer to it as DistanceToTop. If you want to allow it however I have no objections to that.

Revision history for this message
sam (samuel-d-parkinson) wrote :

Hi Jon. I'll check this on Monday. Have a good weekend
On 24 Jan 2014 11:36, "Jon Hill" <email address hidden> wrote:

> Waiting on a green buildbot.
> --
>
> https://code.launchpad.net/~jon-hill/fluidity/diagnostic_check/+merge/203042
> You are requested to review the proposed merge of
> lp:~jon-hill/fluidity/diagnostic_check into lp:fluidity.
>

Unmerged revisions

4307. By Jon Hill

Helps if you add your new files

4306. By Jon Hill

Merge from trunk

4305. By Jon Hill

Fix dependency search paths to look in hidden places

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'diagnostics/Diagnostic_Fields_New.F90.in'
--- diagnostics/Diagnostic_Fields_New.F90.in 2013-01-24 05:46:32 +0000
+++ diagnostics/Diagnostic_Fields_New.F90.in 2014-01-24 12:43:19 +0000
@@ -36,6 +36,7 @@
36 use global_parameters, only : FIELD_NAME_LEN, OPTION_PATH_LEN36 use global_parameters, only : FIELD_NAME_LEN, OPTION_PATH_LEN
37 use spud37 use spud
38 use state_module38 use state_module
39 use additional_field_locations
3940
40USE_MODULES41USE_MODULES
41 42
@@ -973,9 +974,9 @@
973 974
974 character(len = OPTION_PATH_LEN) :: dependency, field_name, field_path, field_type_path, state_name, state_path975 character(len = OPTION_PATH_LEN) :: dependency, field_name, field_path, field_type_path, state_name, state_path
975 character(len = OPTION_PATH_LEN), dimension(:), allocatable :: dependencies, split_dependency976 character(len = OPTION_PATH_LEN), dimension(:), allocatable :: dependencies, split_dependency
976 integer :: i, j, k, l, m, stat977 integer :: i, j, k, l, m, af, stat
977 978
978 if(option_count("/material_phase/scalar_field/diagnostic") + &979 if(option_count("/material_phase/scalar_field/diagnostic") + &
979 & option_count("/material_phase/vector_field/diagnostic") + &980 & option_count("/material_phase/vector_field/diagnostic") + &
980 & option_count("/material_phase/tensor_field/diagnostic") == 0) then981 & option_count("/material_phase/tensor_field/diagnostic") == 0) then
981 ! Nothing to check982 ! Nothing to check
@@ -1017,28 +1018,92 @@
1017 if(stat /= SPUD_NO_ERROR) cycle1018 if(stat /= SPUD_NO_ERROR) cycle
1018 1019
1019 call tokenize(trim(dependency), dependencies, ",")1020 call tokenize(trim(dependency), dependencies, ",")
1020 do m = 1, size(dependencies)1021 DEP_LOOP: do m = 1, size(dependencies)
1021 call tokenize(trim(dependencies(m)), split_dependency, "::")1022 call tokenize(trim(dependencies(m)), split_dependency, "::")
1022 select case(size(split_dependency))1023 select case(size(split_dependency))
1023 case(1)1024 case(1)
1024 if(option_count(trim(state_path) // "/scalar_field::" // trim(split_dependency(1))) + &1025 if(option_count(trim(state_path) // "/scalar_field::" // trim(split_dependency(1))) + &
1025 & option_count(trim(state_path) // "/vector_field::" // trim(split_dependency(1))) + &1026 & option_count(trim(state_path) // "/vector_field::" // trim(split_dependency(1))) + &
1026 & option_count(trim(state_path) // "/tensor_field::" // trim(split_dependency(1))) == 0) then1027 & option_count(trim(state_path) // "/tensor_field::" // trim(split_dependency(1))) > 0) then
1027 call field_error(state_name, field_name, "Field depends on " // split_dependency(1))1028 cycle DEP_LOOP
1028 end if1029 end if
1030 ! We now need to check additional paths as the field may
1031 ! be hidden.
1032 ! check absolute fields
1033 do af=1, size(additional_fields_absolute)
1034 if (have_option(trim(additional_fields_absolute(af)) // "/scalar_field::" // trim(split_dependency(1))) .OR. &
1035 & have_option(trim(additional_fields_absolute(af)) // "/vector_field::" // trim(split_dependency(1))) .OR. &
1036 & have_option(trim(additional_fields_absolute(af)) // "/tensor_field::" // trim(split_dependency(1)))) then
1037 cycle DEP_LOOP
1038 end if
1039 end do
1040
1041 ! check relative paths
1042 do af=1, size(additional_fields_relative)
1043 if (have_option(trim(state_path) // trim(additional_fields_relative(af)) // "/scalar_field::" // trim(split_dependency(1))) .OR. &
1044 & have_option(trim(state_path) // trim(additional_fields_relative(af)) // "/vector_field::" // trim(split_dependency(1))) .OR. &
1045 & have_option(trim(state_path) // trim(additional_fields_relative(af)) // "/tensor_field::" // trim(split_dependency(1)))) then
1046 cycle DEP_LOOP
1047 end if
1048 end do
1049
1050 ! check other paths
1051 do af=1, size(additional_diagnostic_paths)
1052 if (have_option(trim(additional_diagnostic_paths(af)) // "/scalar_field::" // trim(split_dependency(1))) .OR. &
1053 & have_option(trim(additional_diagnostic_paths(af)) // "/vector_field::" // trim(split_dependency(1))) .OR. &
1054 & have_option(trim(additional_diagnostic_paths(af)) // "/tensor_field::" // trim(split_dependency(1)))) then
1055 cycle DEP_LOOP
1056 end if
1057 end do
1058
1059 ! Still not found it...then error
1060 call field_error(state_name, field_name, "Field depends on " // split_dependency(1))
1061
1029 case(2)1062 case(2)
1030 if(option_count("/material_phase::" // trim(split_dependency(1)) // "/scalar_field::" // trim(split_dependency(2))) + &1063 if(option_count("/material_phase::" // trim(split_dependency(1)) // "/scalar_field::" // trim(split_dependency(2))) + &
1031 & option_count("/material_phase::" // trim(split_dependency(1)) // "/vector_field::" // trim(split_dependency(2))) + &1064 & option_count("/material_phase::" // trim(split_dependency(1)) // "/vector_field::" // trim(split_dependency(2))) + &
1032 & option_count("/material_phase::" // trim(split_dependency(1)) // "/tensor_field::" // trim(split_dependency(2))) == 0) then1065 & option_count("/material_phase::" // trim(split_dependency(1)) // "/tensor_field::" // trim(split_dependency(2))) > 0) then
1033 call field_error(state_name, field_name, "Field depends on " // trim(split_dependency(2)) // " in state " // split_dependency(1))1066 cycle DEP_LOOP
1034 end if1067 end if
1068 ! We now need to check additional paths as the field may
1069 ! be hidden.
1070
1071 ! check absolute fields
1072 do af=1, size(additional_fields_absolute)
1073 if (have_option(trim(additional_fields_absolute(af)) // "/scalar_field::" // trim(split_dependency(1))) .OR. &
1074 & have_option(trim(additional_fields_absolute(af)) // "/vector_field::" // trim(split_dependency(1))) .OR. &
1075 & have_option(trim(additional_fields_absolute(af)) // "/tensor_field::" // trim(split_dependency(1)))) then
1076 cycle DEP_LOOP
1077 end if
1078 end do
1079
1080 ! check relative paths
1081 do af=1, size(additional_fields_relative)
1082 if (have_option("/material_phase::" // trim(split_dependency(1)) // trim(additional_fields_relative(af)) // "/scalar_field::" // trim(split_dependency(1))) .OR. &
1083 & have_option("/material_phase::" // trim(split_dependency(1)) // trim(additional_fields_relative(af)) // "/vector_field::" // trim(split_dependency(1))) .OR. &
1084 & have_option("/material_phase::" // trim(split_dependency(1)) // trim(additional_fields_relative(af)) // "/tensor_field::" // trim(split_dependency(1)))) then
1085 cycle DEP_LOOP
1086 end if
1087 end do
1088
1089 ! check other paths - err, these are
1090 do af=1, size(additional_diagnostic_paths)
1091 if (have_option(trim(additional_diagnostic_paths(af)) // "/scalar_field::" // trim(split_dependency(1))) .OR. &
1092 & have_option(trim(additional_diagnostic_paths(af)) // "/vector_field::" // trim(split_dependency(1))) .OR. &
1093 & have_option(trim(additional_diagnostic_paths(af)) // "/tensor_field::" // trim(split_dependency(1)))) then
1094 cycle DEP_LOOP
1095 end if
1096 end do
1097
1098 call field_error(state_name, field_name, "Field depends on " // trim(split_dependency(2)) // " in state " // split_dependency(1))
1099
1035 case default1100 case default
1036 ewrite(-1, *) "For dependency " // trim(dependencies(m))1101 ewrite(-1, *) "For dependency " // trim(dependencies(m))
1037 call field_error(state_name, field_name, "Invalid dependency")1102 call field_error(state_name, field_name, "Invalid dependency")
1038 end select1103 end select
1039 1104
1040 deallocate(split_dependency)1105 deallocate(split_dependency)
1041 end do1106 end do DEP_LOOP
1042 deallocate(dependencies)1107 deallocate(dependencies)
1043 end do1108 end do
1044 end do1109 end do
10451110
=== added file 'preprocessor/Additional_Field_Locations.F90'
--- preprocessor/Additional_Field_Locations.F90 1970-01-01 00:00:00 +0000
+++ preprocessor/Additional_Field_Locations.F90 2014-01-24 12:43:19 +0000
@@ -0,0 +1,88 @@
1! Copyright (C) 2006 Imperial College London and others.
2!
3! Please see the AUTHORS file in the main source directory for a full list
4! of copyright holders.
5!
6! Prof. C Pain
7! Applied Modelling and Computation Group
8! Department of Earth Science and Engineering
9! Imperial College London
10!
11! amcgsoftware@imperial.ac.uk
12!
13! This library is free software; you can redistribute it and/or
14! modify it under the terms of the GNU Lesser General Public
15! License as published by the Free Software Foundation,
16! version 2.1 of the License.
17!
18! This library is distributed in the hope that it will be useful,
19! but WITHOUT ANY WARRANTY; without even the implied warranty of
20! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21! Lesser General Public License for more details.
22!
23! You should have received a copy of the GNU Lesser General Public
24! License along with this library; if not, write to the Free Software
25! Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
26! USA
27
28#include "fdebug.h"
29
30module additional_field_locations
31
32 use global_parameters, only: OPTION_PATH_LEN
33
34 implicit none
35
36
37 public :: additional_fields_absolute, additional_fields_relative, grandchild_paths
38 public :: additional_diagnostic_paths
39
40 !! A list of locations in which additional scalar/vector/tensor fields
41 !! are to be found. These are absolute paths in the schema.
42 character(len=OPTION_PATH_LEN), dimension(8) :: additional_fields_absolute=&
43 (/ &
44 "/ocean_biology/pznd ", &
45 "/ocean_biology/six_component ", &
46 "/ocean_forcing/iceshelf_meltrate/Holland08 ", &
47 "/ocean_forcing/bulk_formulae/output_fluxes_diagnostics ", &
48 "/porous_media ", &
49 "/material_phase[0]/vector_field::Velocity/prognostic/spatial_discretisation/continuous_galerkin/les_model/dynamic_les ", &
50 "/material_phase[0]/vector_field::Velocity/prognostic/spatial_discretisation/continuous_galerkin/les_model/second_order", &
51 "/material_phase[0]/sediment/ " &
52 /)
53
54 !! A list of relative paths under /material_phase[i]
55 !! that are searched for additional fields to be added.
56 character(len=OPTION_PATH_LEN), dimension(13) :: additional_fields_relative=&
57 (/ &
58 "/subgridscale_parameterisations/Mellor_Yamada ", &
59 "/subgridscale_parameterisations/prescribed_diffusivity ", &
60 "/subgridscale_parameterisations/GLS ", &
61 "/subgridscale_parameterisations/k-epsilon ", &
62 "/subgridscale_parameterisations/k-epsilon/debugging_options/source_term_output_fields ", &
63 "/subgridscale_parameterisations/k-epsilon/debugging_options/prescribed_source_terms ", &
64 "/vector_field::Velocity/prognostic/spatial_discretisation/continuous_galerkin/les_model/second_order", &
65 "/vector_field::Velocity/prognostic/spatial_discretisation/continuous_galerkin/les_model/fourth_order", &
66 "/vector_field::Velocity/prognostic/spatial_discretisation/continuous_galerkin/les_model/wale ", &
67 "/vector_field::Velocity/prognostic/spatial_discretisation/continuous_galerkin/les_model/dynamic_les ", &
68 "/vector_field::Velocity/prognostic/equation::ShallowWater ", &
69 "/vector_field::Velocity/prognostic/equation::ShallowWater/bottom_drag ", &
70 "/vector_field::BedShearStress/diagnostic/calculation_method/velocity_gradient " &
71 /)
72
73 !! Relative paths under a field that are searched for grandchildren
74 !! (moved here because of extremely obscure intel ICE -Stephan)
75 character(len=OPTION_PATH_LEN), dimension(1):: &
76 grandchild_paths = (/&
77 & "/spatial_discretisation/inner_element" &
78 /)
79
80 !! List of other fields that Populate_State handles under the hood, but are
81 !! needed for diagnostic dependencies.
82 character(len=OPTION_PATH_LEN), dimension(1):: additional_diagnostic_paths = &
83 (/ &
84 & "/geometry/ocean_boundaries" &
85 /)
86
87
88end module additional_field_locations
089
=== modified file 'preprocessor/Makefile.dependencies'
--- preprocessor/Makefile.dependencies 2012-11-19 20:46:44 +0000
+++ preprocessor/Makefile.dependencies 2014-01-24 12:43:19 +0000
@@ -1,4 +1,11 @@
1# Dependencies generated by create_makefile.py. DO NOT EDIT1# Dependencies generated by create_makefile.py. DO NOT EDIT
2../include/additional_field_locations.mod: Additional_Field_Locations.o
3 @true
4
5Additional_Field_Locations.o ../include/additional_field_locations.mod: \
6 Additional_Field_Locations.F90 ../include/fdebug.h \
7 ../include/global_parameters.mod
8
2../include/boundary_conditions_from_options.mod: \9../include/boundary_conditions_from_options.mod: \
3 Boundary_Conditions_From_Options.o10 Boundary_Conditions_From_Options.o
4 @true11 @true
@@ -50,6 +57,7 @@
50 @true57 @true
5158
52Populate_State.o ../include/populate_state_module.mod: Populate_State.F90 \59Populate_State.o ../include/populate_state_module.mod: Populate_State.F90 \
60 ../include/additional_field_locations.mod \
53 ../include/boundary_conditions_from_options.mod ../include/climatology.mod \61 ../include/boundary_conditions_from_options.mod ../include/climatology.mod \
54 ../include/coordinates.mod ../include/data_structures.mod \62 ../include/coordinates.mod ../include/data_structures.mod \
55 ../include/diagnostic_variables.mod ../include/elements.mod \63 ../include/diagnostic_variables.mod ../include/elements.mod \
5664
=== modified file 'preprocessor/Makefile.in'
--- preprocessor/Makefile.in 2011-10-21 10:05:25 +0000
+++ preprocessor/Makefile.in 2014-01-24 12:43:19 +0000
@@ -54,8 +54,8 @@
54TESTLIBS = $(shell echo @LIBS@ | sed 's@./lib/lib\([a-z]*\)\.a@-l\1@g')54TESTLIBS = $(shell echo @LIBS@ | sed 's@./lib/lib\([a-z]*\)\.a@-l\1@g')
5555
56OBJS = Populate_State.o Populate_Sub_State.o Reserve_State.o Field_Priority_Lists.o\56OBJS = Populate_State.o Populate_Sub_State.o Reserve_State.o Field_Priority_Lists.o\
57 Physics_From_Options.o VTK_Cache.o Initialise_Fields.o \57 Physics_From_Options.o VTK_Cache.o Initialise_Fields.o Additional_Field_Locations.o \
58 Boundary_Conditions_From_Options.o synthetic_bc.o Tidal_Modelling.o58 Boundary_Conditions_From_Options.o synthetic_bc.o Tidal_Modelling.o
5959
60.SUFFIXES: .f90 .F90 .cpp .c .o .a60.SUFFIXES: .f90 .F90 .cpp .c .o .a
6161
6262
=== modified file 'preprocessor/Populate_State.F90'
--- preprocessor/Populate_State.F90 2013-10-28 06:46:48 +0000
+++ preprocessor/Populate_State.F90 2014-01-24 12:43:19 +0000
@@ -58,6 +58,7 @@
58 use fields_halos58 use fields_halos
59 use read_triangle59 use read_triangle
60 use initialise_ocean_forcing_module60 use initialise_ocean_forcing_module
61 use additional_field_locations
6162
62 implicit none63 implicit none
6364
@@ -81,46 +82,6 @@
8182
82 end interface allocate_field_as_constant83 end interface allocate_field_as_constant
83 84
84 !! A list of locations in which additional scalar/vector/tensor fields
85 !! are to be found. These are absolute paths in the schema.
86 character(len=OPTION_PATH_LEN), dimension(8) :: additional_fields_absolute=&
87 (/ &
88 "/ocean_biology/pznd ", &
89 "/ocean_biology/six_component ", &
90 "/ocean_forcing/iceshelf_meltrate/Holland08 ", &
91 "/ocean_forcing/bulk_formulae/output_fluxes_diagnostics ", &
92 "/porous_media ", &
93 "/material_phase[0]/vector_field::Velocity/prognostic/spatial_discretisation/continuous_galerkin/les_model/dynamic_les ", &
94 "/material_phase[0]/vector_field::Velocity/prognostic/spatial_discretisation/continuous_galerkin/les_model/second_order", &
95 "/material_phase[0]/sediment/ " &
96 /)
97
98 !! A list of relative paths under /material_phase[i]
99 !! that are searched for additional fields to be added.
100 character(len=OPTION_PATH_LEN), dimension(13) :: additional_fields_relative=&
101 (/ &
102 "/subgridscale_parameterisations/Mellor_Yamada ", &
103 "/subgridscale_parameterisations/prescribed_diffusivity ", &
104 "/subgridscale_parameterisations/GLS ", &
105 "/subgridscale_parameterisations/k-epsilon ", &
106 "/subgridscale_parameterisations/k-epsilon/debugging_options/source_term_output_fields ", &
107 "/subgridscale_parameterisations/k-epsilon/debugging_options/prescribed_source_terms ", &
108 "/vector_field::Velocity/prognostic/spatial_discretisation/continuous_galerkin/les_model/second_order", &
109 "/vector_field::Velocity/prognostic/spatial_discretisation/continuous_galerkin/les_model/fourth_order", &
110 "/vector_field::Velocity/prognostic/spatial_discretisation/continuous_galerkin/les_model/wale ", &
111 "/vector_field::Velocity/prognostic/spatial_discretisation/continuous_galerkin/les_model/dynamic_les ", &
112 "/vector_field::Velocity/prognostic/equation::ShallowWater ", &
113 "/vector_field::Velocity/prognostic/equation::ShallowWater/bottom_drag ", &
114 "/vector_field::BedShearStress/diagnostic/calculation_method/velocity_gradient " &
115 /)
116
117 !! Relative paths under a field that are searched for grandchildren
118 !! (moved here because of extremely obscure intel ICE -Stephan)
119 character(len=OPTION_PATH_LEN), dimension(1):: &
120 grandchild_paths = (/&
121 & "/spatial_discretisation/inner_element" &
122 /)
123
124contains85contains
12586
12687
12788
=== added directory 'tests/additional_fields_diagnostics_check'
=== added file 'tests/additional_fields_diagnostics_check/Makefile'
--- tests/additional_fields_diagnostics_check/Makefile 1970-01-01 00:00:00 +0000
+++ tests/additional_fields_diagnostics_check/Makefile 2014-01-24 12:43:19 +0000
@@ -0,0 +1,24 @@
1FLMLMODEL = diagnostics
2MODEL = diagnostics
3
4default: input
5
6input:
7
8clean: clean-mesh clean-run-debug
9clean-mesh:
10clean-run:
11 rm -f $(FLMLMODEL)_?*.pvtu $(FLMLMODEL)_?*.vtu
12 rm -f $(FLMLMODEL).detectors $(FLMLMODEL).stat tmpf*
13 rm -f fluidity.err-?* fluidity.log-?*
14 rm -f matrixdump matrixdump.info
15 rm -f $(FLMLMODEL)_?*_checkpoint.flml
16 rm -f $(FLMLMODEL)_?*_checkpoint_?*.ele $(FLMLMODEL)_?*_checkpoint_?*.face $(FLMLMODEL)_?*_checkpoint_?*.halo $(FLMLMODEL)_?*_checkpoint_?*.node
17 rm -f $(FLMLMODEL)_?*_?*_checkpoint.pvtu $(FLMLMODEL)_?*_?*_checkpoint.vtu
18 rm -f $(FLMLMODEL)_?*_checkpoint.ele $(FLMLMODEL)_?*_checkpoint.face $(FLMLMODEL)_?*_checkpoint.node
19 rm -f $(FLMLMODEL)_?*_checkpoint.vtu
20clean-run-debug: clean-run
21 rm -f adapted_mesh_?*.vtu bounding_box_?*_?*.vtu final_metric_?*.vtu gmon.out gradation_metric_?*.vtu interpolation_metric_final_?*.vtu interpolation_metric_hessian_?*_?*.vtu interpolation_metric_merge_?*_?*.vtu interpolation_metric_metric_?*_?*.vtu metric_input_?*_?*.vtu
22 rm -f adapted_mesh.face adapted_mesh.ele adapted_mesh.node
23 rm -f adapted_mesh_?*.face adapted_mesh_?*.ele adapted_mesh_?*.node
24 rm -f adapted_state_?*.pvtu adapted_state_?*.vtu
025
=== added file 'tests/additional_fields_diagnostics_check/additional_fields_diagnostics_check.xml'
--- tests/additional_fields_diagnostics_check/additional_fields_diagnostics_check.xml 1970-01-01 00:00:00 +0000
+++ tests/additional_fields_diagnostics_check/additional_fields_diagnostics_check.xml 2014-01-24 12:43:19 +0000
@@ -0,0 +1,33 @@
1<?xml version="1.0" encoding="UTF-8" ?>
2<testproblem>
3 <name>additional_fields_diagnostic_check</name>
4 <owner userid="jhill1"/>
5 <tags>flml</tags>
6 <problem_definition length = "short" nprocs = "1">
7 <command_line>make clean-run-debug; fluidity -v2 -l diagnostics.flml</command_line>
8 </problem_definition>
9 <variables>
10 <variable name="solvers_converged" language="python">
11import os
12files = os.listdir("./")
13solvers_converged = not "matrixdump" in files and not "matrixdump.info" in files
14 </variable>
15 <variable name = "error_present" language = "python">
16error_present = False
17for line in file("fluidity.err-0", "r"):
18 if line.startswith("Error message: Field depends on"):
19 error_present = True
20 break
21 </variable>
22 </variables>
23 <pass_tests>
24 <test name="Solvers converged" language="python">
25 assert(solvers_converged)
26 </test>
27 <test name="Fluidity failed with the expected error" language = "python">
28assert(not error_present)
29 </test>
30 </pass_tests>
31 <warn_tests>
32 </warn_tests>
33</testproblem>
034
=== added file 'tests/additional_fields_diagnostics_check/diagnostics.flml'
--- tests/additional_fields_diagnostics_check/diagnostics.flml 1970-01-01 00:00:00 +0000
+++ tests/additional_fields_diagnostics_check/diagnostics.flml 2014-01-24 12:43:19 +0000
@@ -0,0 +1,115 @@
1<?xml version='1.0' encoding='utf-8'?>
2<fluidity_options>
3 <simulation_name>
4 <string_value lines="1">diagnostics</string_value>
5 </simulation_name>
6 <problem_type>
7 <string_value lines="1">fluids</string_value>
8 </problem_type>
9 <geometry>
10 <dimension>
11 <integer_value rank="0">2</integer_value>
12 </dimension>
13 <mesh name="CoordinateMesh">
14 <from_file file_name="square">
15 <format name="triangle"/>
16 <stat>
17 <include_in_stat/>
18 </stat>
19 </from_file>
20 </mesh>
21 <mesh name="VelocityMesh">
22 <from_mesh>
23 <mesh name="CoordinateMesh"/>
24 <stat>
25 <exclude_from_stat/>
26 </stat>
27 </from_mesh>
28 </mesh>
29 <mesh name="PressureMesh">
30 <from_mesh>
31 <mesh name="CoordinateMesh"/>
32 <stat>
33 <exclude_from_stat/>
34 </stat>
35 </from_mesh>
36 </mesh>
37 <quadrature>
38 <degree>
39 <integer_value rank="0">4</integer_value>
40 </degree>
41 </quadrature>
42 </geometry>
43 <io>
44 <dump_format>
45 <string_value>vtk</string_value>
46 </dump_format>
47 <dump_period>
48 <constant>
49 <real_value rank="0">1</real_value>
50 </constant>
51 </dump_period>
52 <output_mesh name="VelocityMesh"/>
53 <stat/>
54 </io>
55 <timestepping>
56 <current_time>
57 <real_value rank="0">0.0</real_value>
58 </current_time>
59 <timestep>
60 <real_value rank="0">1.0</real_value>
61 </timestep>
62 <finish_time>
63 <real_value rank="0">1.0</real_value>
64 </finish_time>
65 </timestepping>
66 <physical_parameters/>
67 <material_phase name="Fluid">
68 <subgridscale_parameterisations>
69 <prescribed_diffusivity>
70 <tensor_field name="PrescribedDiffusivity" rank="2">
71 <prescribed>
72 <mesh name="VelocityMesh"/>
73 <value name="WholeMesh">
74 <isotropic>
75 <constant>
76 <real_value rank="0">1</real_value>
77 </constant>
78 </isotropic>
79 </value>
80 <output/>
81 </prescribed>
82 </tensor_field>
83 </prescribed_diffusivity>
84 </subgridscale_parameterisations>
85 <vector_field name="Velocity" rank="1">
86 <prescribed>
87 <mesh name="VelocityMesh"/>
88 <value name="WholeMesh">
89 <constant>
90 <real_value shape="2" dim1="dim" rank="1">0.0 0.0</real_value>
91 </constant>
92 </value>
93 <output>
94 <exclude_from_vtu/>
95 </output>
96 <stat>
97 <exclude_from_stat/>
98 </stat>
99 <detectors>
100 <exclude_from_detectors/>
101 </detectors>
102 </prescribed>
103 </vector_field>
104 <tensor_field name="CopyOfHiddenField" rank="2">
105 <diagnostic>
106 <algorithm material_phase_support="single" source_field_type="tensor" source_field_name="PrescribedDiffusivity" name="tensor_copy"/>
107 <mesh name="VelocityMesh"/>
108 <output/>
109 <stat>
110 <include_in_stat/>
111 </stat>
112 </diagnostic>
113 </tensor_field>
114 </material_phase>
115</fluidity_options>
0116
=== added file 'tests/additional_fields_diagnostics_check/square.edge'
--- tests/additional_fields_diagnostics_check/square.edge 1970-01-01 00:00:00 +0000
+++ tests/additional_fields_diagnostics_check/square.edge 2014-01-24 12:43:19 +0000
@@ -0,0 +1,12 @@
18 1
21 1 2 1
32 2 3 1
43 7 8 2
54 8 9 2
65 1 4 4
76 4 7 4
87 3 6 3
98 6 9 3
10# Created by triangletools.WriteTriangle
11# Command: /usr/bin/ipython
12# Thu Apr 2 13:34:14 2009
013
=== added file 'tests/additional_fields_diagnostics_check/square.ele'
--- tests/additional_fields_diagnostics_check/square.ele 1970-01-01 00:00:00 +0000
+++ tests/additional_fields_diagnostics_check/square.ele 2014-01-24 12:43:19 +0000
@@ -0,0 +1,12 @@
18 3 1
21 1 4 5 0
32 1 5 2 0
43 2 5 6 0
54 2 6 3 0
65 4 7 8 0
76 4 8 5 0
87 5 8 9 0
98 5 9 6 0
10# Created by triangletools.WriteTriangle
11# Command: /usr/bin/ipython
12# Thu Apr 2 13:34:14 2009
013
=== added file 'tests/additional_fields_diagnostics_check/square.node'
--- tests/additional_fields_diagnostics_check/square.node 1970-01-01 00:00:00 +0000
+++ tests/additional_fields_diagnostics_check/square.node 2014-01-24 12:43:19 +0000
@@ -0,0 +1,13 @@
19 2 0 0
21 0.0 0.0
32 0.0 0.5
43 0.0 1.0
54 0.5 0.0
65 0.5 0.5
76 0.5 1.0
87 1.0 0.0
98 1.0 0.5
109 1.0 1.0
11# Created by triangletools.WriteTriangle
12# Command: /usr/bin/ipython
13# Thu Apr 2 13:34:14 2009