11#include "scaleFElib.h"
19 use scale_prc,
only: &
20 prc_ismaster, prc_abort
62 procedure :: init_1d => meshfield_analysis_numerror_1d_init
63 generic :: init => init_1d
64 procedure :: evaluate => meshfield_analysis_numerror_1d_evaluate
67 subroutine set_data_lc_1d( this_, q, qexact, qexact_intrp, lcmesh, elem1D, intrp_epos, tsec )
75 real(RP),
intent(out) :: q(elem1D%Np,lcmesh%Ne,this_%var_num)
76 real(RP),
intent(out) :: qexact(elem1D%Np,lcmesh%Ne,this_%var_num)
77 real(RP),
intent(out) :: qexact_intrp(this_%intrp_np,lcmesh%Ne,this_%var_num)
78 real(RP),
intent(in) :: intrp_epos(this_%intrp_np,this_%ndim)
79 real(RP),
intent(in) :: tsec
89 procedure :: init_2d => meshfield_analysis_numerror_2d_init
90 generic :: init => init_2d
91 procedure :: evaluate => meshfield_analysis_numerror_2d_evaluate
94 subroutine set_data_lc_2d( this_, q, qexact, qexact_intrp, lcmesh, elem2D, intrp_epos, tsec )
102 real(RP),
intent(out) :: q(elem2D%Np,lcmesh%Ne,this_%var_num)
103 real(RP),
intent(out) :: qexact(elem2D%Np,lcmesh%Ne,this_%var_num)
104 real(RP),
intent(out) :: qexact_intrp(this_%intrp_np,lcmesh%Ne,this_%var_num)
105 real(RP),
intent(in) :: intrp_epos(this_%intrp_np,this_%ndim)
106 real(RP),
intent(in) :: tsec
116 procedure :: init_3d => meshfield_analysis_numerror_3d_init
117 generic :: init => init_3d
118 procedure :: evaluate => meshfield_analysis_numerror_3d_evaluate
121 subroutine set_data_lc_3d( this_, q, qexact, qexact_intrp, lcmesh, elem3D, intrp_epos, tsec )
129 real(RP),
intent(out) :: q(elem3D%Np,lcmesh%Ne,this_%var_num)
130 real(RP),
intent(out) :: qexact(elem3D%Np,lcmesh%Ne,this_%var_num)
131 real(RP),
intent(out) :: qexact_intrp(this_%intrp_np,lcmesh%Ne,this_%var_num)
132 real(RP),
intent(in) :: intrp_epos(this_%intrp_np,this_%ndim)
133 real(RP),
intent(in) :: tsec
159 subroutine meshfield_analysis_numerror_1d_init( this, &
160 porder_error_check, log_fname_base, log_step_interval, &
162 set_data_lc, numerror_analysis_info )
165 integer,
intent(in) :: porder_error_check
166 character(len=*),
intent(in) :: log_fname_base
167 integer,
intent(in) :: log_step_interval
174 call this%MeshFieldAnalysisNumerrorBase%Init( &
175 porder_error_check, 1, refelem1d%Np, porder_error_check**1, &
176 log_fname_base, log_step_interval, mesh, numerror_analysis_info )
178 this%IntrpMat(:,:) = refelem1d%GenIntGaussLegendreIntrpMat( &
179 this%PolyOrderErrorCheck, &
180 this%intw_intrp, this%epos_intrp(:,1) )
183 this%set_data_lc => set_data_lc
185 end subroutine meshfield_analysis_numerror_1d_init
188 subroutine meshfield_analysis_numerror_1d_evaluate( this, &
192 integer,
intent(in) :: tstep
193 real(RP),
intent(in) :: tsec
196 call this%Evaluate_base( tstep, tsec, this%mesh1D%dom_vol, evaluate_error_core, calc_covariance_core )
198 end subroutine meshfield_analysis_numerror_1d_evaluate
205 subroutine meshfield_analysis_numerror_2d_init( this, &
206 porder_error_check, log_fname_base, log_step_interval, &
208 set_data_lc, numerror_analysis_info )
211 integer,
intent(in) :: porder_error_check
212 character(len=*),
intent(in) :: log_fname_base
213 integer,
intent(in) :: log_step_interval
220 call this%MeshFieldAnalysisNumerrorBase%Init( &
221 porder_error_check, 2, refelem2d%Np, porder_error_check**2, &
222 log_fname_base, log_step_interval, mesh, numerror_analysis_info )
224 this%IntrpMat(:,:) = refelem2d%GenIntGaussLegendreIntrpMat( &
225 this%PolyOrderErrorCheck, &
226 this%intw_intrp, this%epos_intrp(:,1), this%epos_intrp(:,2) )
229 this%set_data_lc => set_data_lc
231 end subroutine meshfield_analysis_numerror_2d_init
234 subroutine meshfield_analysis_numerror_2d_evaluate( this, &
238 integer,
intent(in) :: tstep
239 real(RP),
intent(in) :: tsec
242 call this%Evaluate_base( tstep, tsec, this%mesh2D%dom_vol, evaluate_error_core, calc_covariance_core )
244 end subroutine meshfield_analysis_numerror_2d_evaluate
251 subroutine meshfield_analysis_numerror_3d_init( this, &
252 porder_error_check, log_fname_base, log_step_interval, &
254 set_data_lc, numerror_analysis_info )
257 integer,
intent(in) :: porder_error_check
258 character(len=*),
intent(in) :: log_fname_base
259 integer,
intent(in) :: log_step_interval
266 call this%MeshFieldAnalysisNumerrorBase%Init( &
267 porder_error_check, 3, refelem3d%Np, porder_error_check**3, &
268 log_fname_base, log_step_interval, mesh, numerror_analysis_info )
271 this%IntrpMat(:,:) = refelem3d%GenIntGaussLegendreIntrpMat( &
272 this%PolyOrderErrorCheck, &
273 this%intw_intrp, this%epos_intrp(:,1), this%epos_intrp(:,2), this%epos_intrp(:,3) )
276 this%set_data_lc => set_data_lc
278 end subroutine meshfield_analysis_numerror_3d_init
281 subroutine meshfield_analysis_numerror_3d_evaluate( &
285 integer,
intent(in) :: tstep
286 real(RP),
intent(in) :: tsec
290 call this%Evaluate_base( tstep, tsec, this%mesh3D%dom_vol, evaluate_error_core, calc_covariance_core )
292 end subroutine meshfield_analysis_numerror_3d_evaluate
297 subroutine evaluate_error_core( base, tsec, &
298 num_error_l1_lc, num_error_l2_lc, num_error_linf_lc, &
299 numsol_mean_lc, exactsol_mean_lc )
302 real(RP),
intent(in) :: tsec
303 real(RP),
intent(inout) :: num_error_l1_lc(base%var_num)
304 real(RP),
intent(inout) :: num_error_l2_lc(base%var_num)
305 real(RP),
intent(inout) :: num_error_linf_lc(base%var_num)
306 real(RP),
intent(inout) :: numsol_mean_lc(base%var_num)
307 real(RP),
intent(inout) :: exactsol_mean_lc(base%var_num)
309 real(RP),
allocatable :: q(:,:,:)
310 real(RP),
allocatable :: qexact(:,:,:)
311 real(RP),
allocatable :: qexact_intrp(:,:,:)
319 do lcdomid=1, base%mesh%LOCAL_MESH_NUM
320 call prepare_lc_data( base, lcdomid, tsec, &
321 q, qexact, qexact_intrp, lcmesh, elem, np, ne )
323 call base%Evaluate_error_lc( &
324 num_error_l1_lc, num_error_l2_lc, num_error_linf_lc, &
325 numsol_mean_lc, exactsol_mean_lc, &
326 q, qexact, qexact_intrp, lcmesh, elem )
328 deallocate( q, qexact, qexact_intrp )
331 end subroutine evaluate_error_core
334 subroutine calc_covariance_core( base, tsec,&
335 cov_numsol_numsol_lc, cov_numsol_exactsol_lc, cov_exactsol_exactsol_lc, &
336 numsol_mean, exactsol_mean )
339 real(RP),
intent(in) :: tsec
340 real(RP),
intent(inout) :: cov_numsol_numsol_lc(base%var_num)
341 real(RP),
intent(inout) :: cov_numsol_exactsol_lc(base%var_num)
342 real(RP),
intent(inout) :: cov_exactsol_exactsol_lc(base%var_num)
343 real(RP),
intent(in) :: numsol_mean(base%var_num)
344 real(RP),
intent(in) :: exactsol_mean(base%var_num)
346 real(RP),
allocatable :: q(:,:,:)
347 real(RP),
allocatable :: qexact(:,:,:)
348 real(RP),
allocatable :: qexact_intrp(:,:,:)
356 do lcdomid=1, base%mesh%LOCAL_MESH_NUM
357 call prepare_lc_data( base, lcdomid, tsec, &
358 q, qexact, qexact_intrp, lcmesh, elem, np, ne )
360 call base%Evaluate_covariance_lc( &
361 cov_numsol_numsol_lc, cov_numsol_exactsol_lc, cov_exactsol_exactsol_lc, &
362 q, qexact, qexact_intrp, numsol_mean, exactsol_mean, lcmesh, elem )
364 deallocate( q, qexact, qexact_intrp )
367 end subroutine calc_covariance_core
370 subroutine prepare_lc_data( base, lcdomid, tsec, &
371 q, qexact, qexact_intrp, lcmesh, elem, Np, Ne )
374 integer,
intent(in) :: lcdomid
375 real(RP),
intent(in) :: tsec
376 real(RP),
allocatable,
intent(out) :: q(:,:,:)
377 real(RP),
allocatable,
intent(out) :: qexact(:,:,:)
378 real(RP),
allocatable,
intent(out) :: qexact_intrp(:,:,:)
381 integer,
intent(out) :: Np, Ne
391 lcmesh1d => base%mesh1D%lcmesh_list(lcdomid)
392 np = lcmesh1d%refElem1D%Np; ne = lcmesh1d%Ne
393 lcmesh => lcmesh1d; elem => lcmesh1d%refElem1D
395 lcmesh2d => base%mesh2D%lcmesh_list(lcdomid)
396 np = lcmesh2d%refElem2D%Np; ne = lcmesh2d%Ne
397 lcmesh => lcmesh2d; elem => lcmesh2d%refElem2D
399 lcmesh3d => base%mesh3D%lcmesh_list(lcdomid)
400 np = lcmesh3d%refElem3D%Np; ne = lcmesh3d%Ne
401 lcmesh => lcmesh3d; elem => lcmesh3d%refElem3D
404 allocate( q(np,ne,base%var_num) )
405 allocate( qexact(np,ne,base%var_num) )
406 allocate( qexact_intrp(base%intrp_np,ne,base%var_num) )
411 call base%set_data_lc( q, qexact, qexact_intrp, &
412 lcmesh1d, lcmesh1d%refElem1D, base%epos_intrp, tsec )
414 call base%set_data_lc( q, qexact, qexact_intrp, &
415 lcmesh2d, lcmesh2d%refElem2D, base%epos_intrp, tsec )
417 call base%set_data_lc( q, qexact, qexact_intrp, &
418 lcmesh3d, lcmesh3d%refElem3D, base%epos_intrp, tsec )
421 end subroutine prepare_lc_data
module FElib / Element / Base
module FElib / Element / hexahedron
module FElib / Element / line
module FElib / Element / Quadrilateral
module FElib / Mesh / Local 1D
module FElib / Mesh / Local 2D
module FElib / Mesh / Local 3D
module FElib / Mesh / Local, Base
module FElib / Data / base
module FElib / Mesh / Base 1D
module FElib / Mesh / Base 2D
module FElib / Mesh / Base 3D
module FElib / Mesh / Base
module FElib / Data / Statistics / numerical error
module FElib / Data / Statistics / numerical error
module FElib / Data / base
Derived type representing a 1D reference element.
Derived type representing a 2D reference element.
Derived type representing a 3D reference element.
Derived type representing an arbitrary finite element.
Derived type representing a hexahedral element.
Derived type representing a line element.
Derived type representing a quadrilateral element.
Derived type representing a local mesh for 1D domain.
Derived type representing a local mesh for 2D domain.
Derived type to manage a local 3D computational domain.
Derived type to manage a local computational domain (base type)
Derived type representing a field with local mesh (base type)
Derived type to manage a computational mesh (base type for 1D domain)
Derived type to manage a computational mesh (base type for 2D domain)
Derived type to manage a computational mesh (base type for 3D domain)
Base type to manage a computational mesh.
Derived type for numerical error analysis of 1D field.
Derived type for numerical error analysis of 2D field.
Derived type for numerical error analysis of 3D field.
Base type for numerical error analysis of mesh field.
Derived type saving information for numerical error analysis.
Derived type representing a field with 1D mesh.
Derived type representing a field with 2D mesh.
Derived type representing a field with 3D mesh.
Derived type representing a field (base type)