~fluidity-core/fluidity/remove_tictoc

« back to all changes in this revision

Viewing changes to diagnostics/Mass_Matrix_Diagnostics.F90

  • Committer: Jon Hill
  • Date: 2012-02-28 21:36:27 UTC
  • mfrom: (3880.1.59 fluidity)
  • Revision ID: jon.hill@imperial.ac.uk-20120228213627-75tqkd0za9nlcjrt
MergeĀ fromĀ trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
 
30
module mass_matrix_diagnostics
 
31
   
 
32
   !!< Module containing mass matrix related diagnostic algorithms.
 
33
 
 
34
   use field_options
 
35
   use fields
 
36
   use fldebug
 
37
   use global_parameters, only : OPTION_PATH_LEN
 
38
   use spud
 
39
   use state_fields_module
 
40
   use state_module
 
41
 
 
42
   implicit none
 
43
   
 
44
   private
 
45
 
 
46
   public :: calculate_finite_element_lumped_mass_matrix, &
 
47
             calculate_control_volume_mass_matrix
 
48
  
 
49
contains
 
50
 
 
51
   subroutine calculate_finite_element_lumped_mass_matrix(state, s_field)
 
52
      
 
53
      !!< Calculate the finite element lumped mass matrix
 
54
 
 
55
      type(state_type), intent(inout) :: state
 
56
      type(scalar_field), intent(inout) :: s_field 
 
57
      
 
58
      ! local variables
 
59
      type(scalar_field), pointer :: mass => null()      
 
60
 
 
61
      ewrite(1,*) 'Entering calculate_finite_element_lumped_mass_matrix'
 
62
      
 
63
      mass => get_lumped_mass(state, s_field%mesh)
 
64
      
 
65
      call set(s_field, mass)
 
66
      
 
67
      ewrite(1,*) 'Exiting calculate_finite_element_lumped_mass_matrix'
 
68
 
 
69
   end subroutine calculate_finite_element_lumped_mass_matrix
 
70
 
 
71
   subroutine calculate_control_volume_mass_matrix(state, s_field)
 
72
      
 
73
      !!< Calculate the control volume mass matrix
 
74
 
 
75
      type(state_type), intent(inout) :: state
 
76
      type(scalar_field), intent(inout) :: s_field 
 
77
      
 
78
      ! local variables
 
79
      type(scalar_field), pointer :: mass => null()      
 
80
 
 
81
      ewrite(1,*) 'Entering calculate_control_volume_mass_matrix'
 
82
      
 
83
      mass => get_cv_mass(state, s_field%mesh)
 
84
 
 
85
      call set(s_field, mass)
 
86
      
 
87
      ewrite(1,*) 'Exiting calculate_control_volume_mass_matrix'
 
88
 
 
89
   end subroutine calculate_control_volume_mass_matrix
 
90
 
 
91
end module mass_matrix_diagnostics
 
92