OpenCMISS-Iron Internal API Documentation
Laplace_equations_routines.f90
Go to the documentation of this file.
1 
43 
46 
47  USE base_routines
48  USE basis_routines
50  USE constants
54  USE domain_mappings
59  USE field_routines
60  USE input_output
62  USE kinds
63  USE maths
64  USE matrix_vector
65  USE node_routines
67  USE strings
68  USE solver_routines
69  USE timer
70  USE types
71 
72 #include "macros.h"
73 
74  IMPLICIT NONE
75 
76  PRIVATE
77 
78  !Module parameters
79 
80  !Module types
81 
82  !Module variables
83 
84  !Interfaces
85 
87 
89 
91 
93 
95 
97 
99 
100 
101 CONTAINS
102 
103  !
104  !================================================================================================================================
105  !
106 
107 
109  SUBROUTINE laplace_boundaryconditionsanalyticcalculate(EQUATIONS_SET,BOUNDARY_CONDITIONS,ERR,ERROR,*)
111  !Argument variables
112  TYPE(equations_set_type), POINTER :: EQUATIONS_SET
113  TYPE(boundary_conditions_type), POINTER :: BOUNDARY_CONDITIONS
114  INTEGER(INTG), INTENT(OUT) :: ERR
115  TYPE(varying_string), INTENT(OUT) :: ERROR
116  !Local Variables
117  INTEGER(INTG) :: component_idx,deriv_idx,dim_idx,local_ny,node_idx,NUMBER_OF_DIMENSIONS,variable_idx,variable_type
118  REAL(DP) :: VALUE,X(3)
119  REAL(DP), POINTER :: GEOMETRIC_PARAMETERS(:)
120  TYPE(domain_type), POINTER :: DOMAIN
121  TYPE(domain_nodes_type), POINTER :: DOMAIN_NODES
122  TYPE(field_type), POINTER :: DEPENDENT_FIELD,GEOMETRIC_FIELD
123  TYPE(field_variable_type), POINTER :: FIELD_VARIABLE,GEOMETRIC_VARIABLE
124  TYPE(varying_string) :: LOCAL_ERROR
125 
126  enters("Laplace_BoundaryConditionsAnalyticCalculate",err,error,*999)
127 
128  NULLIFY(geometric_parameters)
129 
130  IF(ASSOCIATED(equations_set)) THEN
131  IF(ASSOCIATED(equations_set%ANALYTIC)) THEN
132  dependent_field=>equations_set%DEPENDENT%DEPENDENT_FIELD
133  IF(ASSOCIATED(dependent_field)) THEN
134  geometric_field=>equations_set%GEOMETRY%GEOMETRIC_FIELD
135  IF(ASSOCIATED(geometric_field)) THEN
136  CALL field_number_of_components_get(geometric_field,field_u_variable_type,number_of_dimensions,err,error,*999)
137  NULLIFY(geometric_variable)
138  CALL field_variable_get(geometric_field,field_u_variable_type,geometric_variable,err,error,*999)
139  CALL field_parameter_set_data_get(geometric_field,field_u_variable_type,field_values_set_type,geometric_parameters, &
140  & err,error,*999)
141  IF(ASSOCIATED(boundary_conditions)) THEN
142  DO variable_idx=1,dependent_field%NUMBER_OF_VARIABLES
143  variable_type=dependent_field%VARIABLES(variable_idx)%VARIABLE_TYPE
144  field_variable=>dependent_field%VARIABLE_TYPE_MAP(variable_type)%PTR
145  IF(ASSOCIATED(field_variable)) THEN
146  CALL field_parameter_set_create(dependent_field,variable_type,field_analytic_values_set_type,err,error,*999)
147  DO component_idx=1,field_variable%NUMBER_OF_COMPONENTS
148  IF(field_variable%COMPONENTS(component_idx)%INTERPOLATION_TYPE==field_node_based_interpolation) THEN
149  domain=>field_variable%COMPONENTS(component_idx)%DOMAIN
150  IF(ASSOCIATED(domain)) THEN
151  IF(ASSOCIATED(domain%TOPOLOGY)) THEN
152  domain_nodes=>domain%TOPOLOGY%NODES
153  IF(ASSOCIATED(domain_nodes)) THEN
154  !Loop over the local nodes excluding the ghosts.
155  DO node_idx=1,domain_nodes%NUMBER_OF_NODES
156  !!TODO \todo We should interpolate the geometric field here and the node position.
157  DO dim_idx=1,number_of_dimensions
158  !Default to version 1 of each node derivative
159  local_ny=geometric_variable%COMPONENTS(dim_idx)%PARAM_TO_DOF_MAP%NODE_PARAM2DOF_MAP% &
160  & nodes(node_idx)%DERIVATIVES(1)%VERSIONS(1)
161  x(dim_idx)=geometric_parameters(local_ny)
162  ENDDO !dim_idx
163  !Loop over the derivatives
164  DO deriv_idx=1,domain_nodes%NODES(node_idx)%NUMBER_OF_DERIVATIVES
165  SELECT CASE(equations_set%ANALYTIC%ANALYTIC_FUNCTION_TYPE)
167  !u=x^2+2.x.y-y^2
168  SELECT CASE(variable_type)
169  CASE(field_u_variable_type)
170  SELECT CASE(domain_nodes%NODES(node_idx)%DERIVATIVES(deriv_idx)%GLOBAL_DERIVATIVE_INDEX)
171  CASE(no_global_deriv)
172  VALUE=x(1)*x(1)-2.0_dp*x(1)*x(2)-x(2)*x(2)
173  CASE(global_deriv_s1)
174  VALUE=2.0_dp*x(1)+2.0_dp*x(2)
175  CASE(global_deriv_s2)
176  VALUE=2.0_dp*x(1)-2.0_dp*x(2)
177  CASE(global_deriv_s1_s2)
178  VALUE=2.0_dp
179  CASE DEFAULT
180  local_error="The global derivative index of "//trim(number_to_vstring( &
181  & domain_nodes%NODES(node_idx)%DERIVATIVES(deriv_idx)%GLOBAL_DERIVATIVE_INDEX,"*", &
182  & err,error))//" is invalid."
183  CALL flagerror(local_error,err,error,*999)
184  END SELECT
185  CASE(field_deludeln_variable_type)
186  SELECT CASE(domain_nodes%NODES(node_idx)%DERIVATIVES(deriv_idx)%GLOBAL_DERIVATIVE_INDEX)
187  CASE(no_global_deriv)
188  VALUE=0.0_dp !!TODO
189  CASE(global_deriv_s1)
190  CALL flagerror("Not implemented.",err,error,*999)
191  CASE(global_deriv_s2)
192  CALL flagerror("Not implemented.",err,error,*999)
193  CASE(global_deriv_s1_s2)
194  CALL flagerror("Not implemented.",err,error,*999)
195  CASE DEFAULT
196  local_error="The global derivative index of "//trim(number_to_vstring( &
197  & domain_nodes%NODES(node_idx)%DERIVATIVES(deriv_idx)%GLOBAL_DERIVATIVE_INDEX,"*", &
198  & err,error))//" is invalid."
199  CALL flagerror(local_error,err,error,*999)
200  END SELECT
201  CASE DEFAULT
202  local_error="The variable type of "//trim(number_to_vstring(variable_type,"*",err,error))// &
203  & " is invalid."
204  CALL flagerror(local_error,err,error,*999)
205  END SELECT
207  !u=cos(x).cosh(y)
208  SELECT CASE(variable_type)
209  CASE(field_u_variable_type)
210  SELECT CASE(domain_nodes%NODES(node_idx)%DERIVATIVES(deriv_idx)%GLOBAL_DERIVATIVE_INDEX)
211  CASE(no_global_deriv)
212  VALUE=cos(x(1))*cosh(x(2))
213  CASE(global_deriv_s1)
214  VALUE=-sin(x(1))*cosh(x(2))
215  CASE(global_deriv_s2)
216  VALUE=cos(x(1))*sinh(x(2))
217  CASE(global_deriv_s1_s2)
218  VALUE=-sin(x(1))*sinh(x(2))
219  CASE DEFAULT
220  local_error="The global derivative index of "//trim(number_to_vstring( &
221  & domain_nodes%NODES(node_idx)%DERIVATIVES(deriv_idx)%GLOBAL_DERIVATIVE_INDEX,"*", &
222  & err,error))//" is invalid."
223  CALL flagerror(local_error,err,error,*999)
224  END SELECT
225  CASE(field_deludeln_variable_type)
226  SELECT CASE(domain_nodes%NODES(node_idx)%DERIVATIVES(deriv_idx)%GLOBAL_DERIVATIVE_INDEX)
227  CASE(no_global_deriv)
228  VALUE=0.0_dp !!TODO
229  CASE(global_deriv_s1)
230  !CALL FlagError("Not implemented.",ERR,ERROR,*999)
231  CASE(global_deriv_s2)
232  !CALL FlagError("Not implemented.",ERR,ERROR,*999)
233  CASE(global_deriv_s1_s2)
234  !CALL FlagError("Not implemented.",ERR,ERROR,*999)
235  CASE DEFAULT
236  local_error="The global derivative index of "//trim(number_to_vstring( &
237  & domain_nodes%NODES(node_idx)%DERIVATIVES(deriv_idx)%GLOBAL_DERIVATIVE_INDEX,"*", &
238  & err,error))//" is invalid."
239  CALL flagerror(local_error,err,error,*999)
240  END SELECT
241  CASE DEFAULT
242  local_error="The variable type of "//trim(number_to_vstring(variable_type,"*",err,error))// &
243  & " is invalid."
244  CALL flagerror(local_error,err,error,*999)
245  END SELECT
247  !u=x^2+y^2-2.z^2
248  SELECT CASE(variable_type)
249  CASE(field_u_variable_type)
250  SELECT CASE(domain_nodes%NODES(node_idx)%DERIVATIVES(deriv_idx)%GLOBAL_DERIVATIVE_INDEX)
251  CASE(no_global_deriv)
252  VALUE=x(1)*x(1)+x(2)*x(2)-2.0_dp*x(3)*x(3)
253  CASE(global_deriv_s1)
254  VALUE=2.0_dp*x(1)
255  CASE(global_deriv_s2)
256  VALUE=2.0_dp*x(2)
257  CASE(global_deriv_s1_s2)
258  VALUE=0.0_dp
259  CASE(global_deriv_s3)
260  VALUE=-4.0_dp*x(3)
261  CASE(global_deriv_s1_s3)
262  VALUE=0.0_dp
263  CASE(global_deriv_s2_s3)
264  VALUE=0.0_dp
266  VALUE=0.0_dp
267  CASE DEFAULT
268  local_error="The global derivative index of "//trim(number_to_vstring( &
269  & domain_nodes%NODES(node_idx)%DERIVATIVES(deriv_idx)%GLOBAL_DERIVATIVE_INDEX,"*", &
270  & err,error))//" is invalid."
271  CALL flagerror(local_error,err,error,*999)
272  END SELECT
273  CASE(field_deludeln_variable_type)
274  SELECT CASE(domain_nodes%NODES(node_idx)%DERIVATIVES(deriv_idx)%GLOBAL_DERIVATIVE_INDEX)
275  CASE(no_global_deriv)
276  VALUE=0.0_dp !!TODO
277  CASE(global_deriv_s1)
278  CALL flagerror("Not implemented.",err,error,*999)
279  CASE(global_deriv_s2)
280  CALL flagerror("Not implemented.",err,error,*999)
281  CASE(global_deriv_s1_s2)
282  CALL flagerror("Not implemented.",err,error,*999)
283  CASE(global_deriv_s3)
284  CALL flagerror("Not implemented.",err,error,*999)
285  CASE(global_deriv_s1_s3)
286  CALL flagerror("Not implemented.",err,error,*999)
287  CASE(global_deriv_s2_s3)
288  CALL flagerror("Not implemented.",err,error,*999)
290  CALL flagerror("Not implemented.",err,error,*999)
291  CASE DEFAULT
292  local_error="The global derivative index of "//trim(number_to_vstring( &
293  & domain_nodes%NODES(node_idx)%DERIVATIVES(deriv_idx)%GLOBAL_DERIVATIVE_INDEX,"*", &
294  & err,error))//" is invalid."
295  CALL flagerror(local_error,err,error,*999)
296  END SELECT
297  CASE DEFAULT
298  local_error="The variable type of "//trim(number_to_vstring(variable_type,"*",err,error))// &
299  & " is invalid."
300  CALL flagerror(local_error,err,error,*999)
301  END SELECT
303  !u=cos(x).cosh(y).z
304  SELECT CASE(variable_type)
305  CASE(field_u_variable_type)
306  SELECT CASE(domain_nodes%NODES(node_idx)%DERIVATIVES(deriv_idx)%GLOBAL_DERIVATIVE_INDEX)
307  CASE(no_global_deriv)
308  VALUE=cos(x(1))*cosh(x(2))*x(3)
309  CASE(global_deriv_s1)
310  VALUE=-sin(x(1))*cosh(x(2))*x(3)
311  CASE(global_deriv_s2)
312  VALUE=cos(x(1))*sinh(x(2))*x(3)
313  CASE(global_deriv_s1_s2)
314  VALUE=-sin(x(1))*sinh(x(2))*x(3)
315  CASE(global_deriv_s3)
316  VALUE=cos(x(1))*cosh(x(2))
317  CASE(global_deriv_s1_s3)
318  VALUE=-sin(x(1))*cosh(x(2))
319  CASE(global_deriv_s2_s3)
320  VALUE=cos(x(1))*sinh(x(2))
322  VALUE=-sin(x(1))*sinh(x(2))
323  CASE DEFAULT
324  local_error="The global derivative index of "//trim(number_to_vstring( &
325  & domain_nodes%NODES(node_idx)%DERIVATIVES(deriv_idx)%GLOBAL_DERIVATIVE_INDEX,"*", &
326  & err,error))//" is invalid."
327  CALL flagerror(local_error,err,error,*999)
328  END SELECT
329  CASE(field_deludeln_variable_type)
330  SELECT CASE(domain_nodes%NODES(node_idx)%DERIVATIVES(deriv_idx)%GLOBAL_DERIVATIVE_INDEX)
331  CASE(no_global_deriv)
332  VALUE=0.0_dp !!TODO
333  CASE(global_deriv_s1)
334  !CALL FlagError("Not implemented.",ERR,ERROR,*999)
335  CASE(global_deriv_s2)
336  !CALL FlagError("Not implemented.",ERR,ERROR,*999)
337  CASE(global_deriv_s1_s2)
338  !CALL FlagError("Not implemented.",ERR,ERROR,*999)
339  CASE(global_deriv_s3)
340  !CALL FlagError("Not implemented.",ERR,ERROR,*999)
341  CASE(global_deriv_s1_s3)
342  !CALL FlagError("Not implemented.",ERR,ERROR,*999)
343  CASE(global_deriv_s2_s3)
344  !CALL FlagError("Not implemented.",ERR,ERROR,*999)
346  !CALL FlagError("Not implemented.",ERR,ERROR,*999)
347  CASE DEFAULT
348  local_error="The global derivative index of "//trim(number_to_vstring( &
349  & domain_nodes%NODES(node_idx)%DERIVATIVES(deriv_idx)%GLOBAL_DERIVATIVE_INDEX,"*", &
350  & err,error))//" is invalid."
351  CALL flagerror(local_error,err,error,*999)
352  END SELECT
353  CASE DEFAULT
354  local_error="The variable type of "//trim(number_to_vstring(variable_type,"*",err,error))// &
355  & " is invalid."
356  CALL flagerror(local_error,err,error,*999)
357  END SELECT
358  CASE DEFAULT
359  local_error="The analytic function type of "// &
360  & trim(number_to_vstring(equations_set%ANALYTIC%ANALYTIC_FUNCTION_TYPE,"*",err,error))// &
361  & " is invalid."
362  CALL flagerror(local_error,err,error,*999)
363  END SELECT
364  local_ny=field_variable%COMPONENTS(component_idx)%PARAM_TO_DOF_MAP% &
365  & node_param2dof_map%NODES(node_idx)%DERIVATIVES(deriv_idx)%VERSIONS(1)
366  CALL field_parameter_set_update_local_dof(dependent_field,variable_type, &
367  & field_analytic_values_set_type,local_ny,VALUE,err,error,*999)
368  IF(variable_type==field_u_variable_type) THEN
369  IF(domain_nodes%NODES(node_idx)%BOUNDARY_NODE) THEN
370  !If we are a boundary node then set the analytic value on the boundary
371  CALL boundary_conditions_set_local_dof(boundary_conditions,dependent_field,variable_type, &
372  & local_ny,boundary_condition_fixed,VALUE,err,error,*999)
373  ENDIF
374  ENDIF
375  ENDDO !deriv_idx
376  ENDDO !node_idx
377  ELSE
378  CALL flagerror("Domain topology nodes is not associated.",err,error,*999)
379  ENDIF
380  ELSE
381  CALL flagerror("Domain topology is not associated.",err,error,*999)
382  ENDIF
383  ELSE
384  CALL flagerror("Domain is not associated.",err,error,*999)
385  ENDIF
386  ELSE
387  CALL flagerror("Only node based interpolation is implemented.",err,error,*999)
388  ENDIF
389  ENDDO !component_idx
390  CALL field_parameter_set_update_start(dependent_field,variable_type,field_analytic_values_set_type, &
391  & err,error,*999)
392  CALL field_parameter_set_update_finish(dependent_field,variable_type,field_analytic_values_set_type, &
393  & err,error,*999)
394  ELSE
395  CALL flagerror("Field variable is not associated.",err,error,*999)
396  ENDIF
397 
398  ENDDO !variable_idx
399  CALL field_parameter_set_data_restore(geometric_field,field_u_variable_type,field_values_set_type, &
400  & geometric_parameters,err,error,*999)
401  ELSE
402  CALL flagerror("Boundary conditions is not associated.",err,error,*999)
403  ENDIF
404  ELSE
405  CALL flagerror("Equations set geometric field is not associated.",err,error,*999)
406  ENDIF
407  ELSE
408  CALL flagerror("Equations set dependent field is not associated.",err,error,*999)
409  ENDIF
410  ELSE
411  CALL flagerror("Equations set analytic is not associated.",err,error,*999)
412  ENDIF
413  ELSE
414  CALL flagerror("Equations set is not associated.",err,error,*999)
415  ENDIF
416 
417  exits("Laplace_BoundaryConditionsAnalyticCalculate")
418  RETURN
419 999 errorsexits("Laplace_BoundaryConditionsAnalyticCalculate",err,error)
420  RETURN 1
422 
423  !
424  !================================================================================================================================
425  !
426 
428  SUBROUTINE laplaceequation_finiteelementcalculate(equationsSet,elementNumber,err,error,*)
430  !Argument variables
431  TYPE(equations_set_type), POINTER :: equationsSet
432  INTEGER(INTG), INTENT(IN) :: elementNumber
433  INTEGER(INTG), INTENT(OUT) :: err
434  TYPE(varying_string), INTENT(OUT) :: error
435  !Local Variables
436  INTEGER(INTG) :: fieldVarType,ng,mh,mhs,mi,ms,nh,nhs,ni,ns,i,k,h
437  REAL(DP) :: conductivityMaterial(3,3),conductivity(3,3),conductivityTemp(3,3)
438  REAL(DP) :: rwg,sum,pgmsi(3),pgnsi(3),kValue(3)
439  TYPE(basis_type), POINTER :: dependentBasis,geometricBasis
440  TYPE(equations_type), POINTER :: equations
441  TYPE(equations_mapping_type), POINTER :: equationsMapping
442  TYPE(equations_mapping_linear_type), POINTER :: linearMapping
443  TYPE(equations_matrices_type), POINTER :: equationsMatrices
444  TYPE(equations_matrices_linear_type), POINTER :: linearMatrices
445  TYPE(equations_matrices_rhs_type), POINTER :: rhsVector
446  TYPE(equations_matrix_type), POINTER :: equationsMatrix
447  TYPE(field_type), POINTER :: dependentField,geometricField
448  TYPE(field_variable_type), POINTER :: fieldVariable
449  TYPE(quadrature_scheme_type), POINTER :: quadratureScheme
450  TYPE(field_interpolated_point_type), POINTER :: fibreInterpolatedPoint
451  TYPE(field_interpolated_point_metrics_type), POINTER :: geometricInterpPointMetrics
452  TYPE(varying_string) :: localError
453  INTEGER(INTG) :: numberOfDimensions
454  REAL(DP) :: dNudXi(3,3),dXidNu(3,3),dXdNu(3,3),dNudX(3,3)
455 
456 #ifdef TAUPROF
457  CHARACTER(26) :: CVAR
458  INTEGER :: GAUSS_POINT_LOOP_PHASE(2) = [ 0, 0 ]
459  SAVE gauss_point_loop_phase
460 #endif
461 
462  enters("LaplaceEquation_FiniteElementCalculate",err,error,*999)
463 
464  IF(ASSOCIATED(equationsset)) THEN
465  IF(.NOT.ALLOCATED(equationsset%SPECIFICATION)) THEN
466  CALL flagerror("Equations set specification is not allocated.",err,error,*999)
467  ELSE IF(SIZE(equationsset%SPECIFICATION,1)/=3) THEN
468  CALL flagerror("Equations set specification must have three entries for a Laplace type equations set.", &
469  & err,error,*999)
470  END IF
471  equations=>equationsset%EQUATIONS
472  IF(ASSOCIATED(equations)) THEN
473  SELECT CASE(equationsset%SPECIFICATION(3))
475 !!TODO: move these and scale factor adjustment out once generalised Laplace is put in.
476  !Store all these in equations matrices/somewhere else?????
477  dependentfield=>equations%INTERPOLATION%DEPENDENT_FIELD
478  geometricfield=>equations%INTERPOLATION%GEOMETRIC_FIELD
479  equationsmatrices=>equations%EQUATIONS_MATRICES
480  linearmatrices=>equationsmatrices%LINEAR_MATRICES
481  equationsmatrix=>linearmatrices%MATRICES(1)%PTR
482  rhsvector=>equationsmatrices%RHS_VECTOR
483  equationsmapping=>equations%EQUATIONS_MAPPING
484  linearmapping=>equationsmapping%LINEAR_MAPPING
485  fieldvariable=>linearmapping%EQUATIONS_MATRIX_TO_VAR_MAPS(1)%VARIABLE
486  fieldvartype=fieldvariable%VARIABLE_TYPE
487  dependentbasis=>dependentfield%DECOMPOSITION%DOMAIN(dependentfield%DECOMPOSITION%MESH_COMPONENT_NUMBER)%PTR% &
488  & topology%ELEMENTS%ELEMENTS(elementnumber)%BASIS
489  geometricbasis=>geometricfield%DECOMPOSITION%DOMAIN(geometricfield%DECOMPOSITION%MESH_COMPONENT_NUMBER)%PTR% &
490  & topology%ELEMENTS%ELEMENTS(elementnumber)%BASIS
491  quadraturescheme=>dependentbasis%QUADRATURE%QUADRATURE_SCHEME_MAP(basis_default_quadrature_scheme)%PTR
492  CALL field_interpolation_parameters_element_get(field_values_set_type,elementnumber,equations%INTERPOLATION% &
493  & geometric_interp_parameters(field_u_variable_type)%PTR,err,error,*999)
494  !Loop over gauss points
495  DO ng=1,quadraturescheme%NUMBER_OF_GAUSS
496 #ifdef TAUPROF
497  WRITE (cvar,'(a17,i2)') 'Gauss Point Loop ',ng
498  CALL tau_phase_create_dynamic(gauss_point_loop_phase,cvar)
499  CALL tau_phase_start(gauss_point_loop_phase)
500 #endif
501  CALL field_interpolate_gauss(first_part_deriv,basis_default_quadrature_scheme,ng,equations%INTERPOLATION% &
502  & geometric_interp_point(field_u_variable_type)%PTR,err,error,*999)
503  CALL field_interpolated_point_metrics_calculate(geometricbasis%NUMBER_OF_XI,equations%INTERPOLATION% &
504  & geometric_interp_point_metrics(field_u_variable_type)%PTR,err,error,*999)
505  !Calculate RWG.
506 !!TODO: Think about symmetric problems.
507  rwg=equations%INTERPOLATION%GEOMETRIC_INTERP_POINT_METRICS(field_u_variable_type)%PTR%JACOBIAN* &
508  & quadraturescheme%GAUSS_WEIGHTS(ng)
509  !Loop over field components
510  mhs=0
511  DO mh=1,fieldvariable%NUMBER_OF_COMPONENTS
512  !Loop over element rows
513 !!TODO: CHANGE ELEMENT CALCULATE TO WORK OF ns ???
514  DO ms=1,dependentbasis%NUMBER_OF_ELEMENT_PARAMETERS
515  mhs=mhs+1
516  nhs=0
517  IF(equationsmatrix%UPDATE_MATRIX) THEN
518  !Loop over element columns
519  DO nh=1,fieldvariable%NUMBER_OF_COMPONENTS
520  DO ns=1,dependentbasis%NUMBER_OF_ELEMENT_PARAMETERS
521  nhs=nhs+1
522  DO ni=1,dependentbasis%NUMBER_OF_XI
523  pgmsi(ni)=quadraturescheme%GAUSS_BASIS_FNS(ms,partial_derivative_first_derivative_map(ni),ng)
524  pgnsi(ni)=quadraturescheme%GAUSS_BASIS_FNS(ns,partial_derivative_first_derivative_map(ni),ng)
525  ENDDO !ni
526  sum=0.0_dp
527  DO mi=1,dependentbasis%NUMBER_OF_XI
528  DO ni=1,dependentbasis%NUMBER_OF_XI
529  sum=sum+pgmsi(mi)*pgnsi(ni)*equations%INTERPOLATION% &
530  & geometric_interp_point_metrics(field_u_variable_type)%PTR%GU(mi,ni)
531  ENDDO !ni
532  ENDDO !mi
533  equationsmatrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)=equationsmatrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)+sum*rwg
534 
535  ENDDO !ns
536  ENDDO !nh
537  ENDIF
538  IF(rhsvector%UPDATE_VECTOR) rhsvector%ELEMENT_VECTOR%VECTOR(mhs)=0.0_dp
539  ENDDO !ms
540  ENDDO !mh
541 #ifdef TAUPROF
542  CALL tau_phase_stop(gauss_point_loop_phase)
543 #endif
544  ENDDO !ng
545 
546  !Scale factor adjustment
547  IF(dependentfield%SCALINGS%SCALING_TYPE/=field_no_scaling) THEN
548  CALL field_interpolationparametersscalefactorselementget(elementnumber,equations%INTERPOLATION% &
549  & dependent_interp_parameters(fieldvartype)%PTR,err,error,*999)
550  mhs=0
551  DO mh=1,fieldvariable%NUMBER_OF_COMPONENTS
552  !Loop over element rows
553  DO ms=1,dependentbasis%NUMBER_OF_ELEMENT_PARAMETERS
554  mhs=mhs+1
555  nhs=0
556  IF(equationsmatrix%UPDATE_MATRIX) THEN
557  !Loop over element columns
558  DO nh=1,fieldvariable%NUMBER_OF_COMPONENTS
559  DO ns=1,dependentbasis%NUMBER_OF_ELEMENT_PARAMETERS
560  nhs=nhs+1
561  equationsmatrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)=equationsmatrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)* &
562  & equations%INTERPOLATION%DEPENDENT_INTERP_PARAMETERS(fieldvartype)%PTR%SCALE_FACTORS(ms,mh)* &
563  & equations%INTERPOLATION%DEPENDENT_INTERP_PARAMETERS(fieldvartype)%PTR%SCALE_FACTORS(ns,nh)
564  ENDDO !ns
565  ENDDO !nh
566  ENDIF
567  IF(rhsvector%UPDATE_VECTOR) rhsvector%ELEMENT_VECTOR%VECTOR(mhs)=rhsvector%ELEMENT_VECTOR%VECTOR(mhs)* &
568  & equations%INTERPOLATION%DEPENDENT_INTERP_PARAMETERS(fieldvartype)%PTR%SCALE_FACTORS(ms,mh)
569  ENDDO !ms
570  ENDDO !mh
571  ENDIF
572 
574 !!TODO: store all these in equations matrices/somewhere else?????
575  dependentfield=>equations%INTERPOLATION%DEPENDENT_FIELD
576  geometricfield=>equations%INTERPOLATION%GEOMETRIC_FIELD
577 
578  equationsmatrices=>equations%EQUATIONS_MATRICES
579  linearmatrices=>equationsmatrices%LINEAR_MATRICES
580  equationsmatrix=>linearmatrices%MATRICES(1)%PTR
581  rhsvector=>equationsmatrices%RHS_VECTOR
582 
583  equationsmapping=>equations%EQUATIONS_MAPPING
584  linearmapping=>equationsmapping%LINEAR_MAPPING
585  fieldvariable=>linearmapping%EQUATIONS_MATRIX_TO_VAR_MAPS(1)%VARIABLE
586  fieldvartype=fieldvariable%VARIABLE_TYPE
587 
588  dependentbasis=>dependentfield%DECOMPOSITION%DOMAIN(dependentfield%DECOMPOSITION%MESH_COMPONENT_NUMBER)%PTR% &
589  & topology%ELEMENTS%ELEMENTS(elementnumber)%BASIS
590  geometricbasis=>geometricfield%DECOMPOSITION%DOMAIN(geometricfield%DECOMPOSITION%MESH_COMPONENT_NUMBER)%PTR% &
591  & topology%ELEMENTS%ELEMENTS(elementnumber)%BASIS
592 
593  quadraturescheme=>dependentbasis%QUADRATURE%QUADRATURE_SCHEME_MAP(basis_default_quadrature_scheme)%PTR
594 
595  numberofdimensions=equationsset%REGION%COORDINATE_SYSTEM%NUMBER_OF_DIMENSIONS
596 
597  CALL field_interpolation_parameters_element_get(field_values_set_type,elementnumber,equations%INTERPOLATION% &
598  & geometric_interp_parameters(field_u_variable_type)%PTR,err,error,*999)
599  CALL field_interpolation_parameters_element_get(field_values_set_type,elementnumber,equations%INTERPOLATION% &
600  & materials_interp_parameters(field_u_variable_type)%PTR,err,error,*999)
601  CALL field_interpolation_parameters_element_get(field_values_set_type,elementnumber,equations%INTERPOLATION% &
602  & fibre_interp_parameters(field_u_variable_type)%PTR,err,error,*999)
603 
604  fibreinterpolatedpoint=>equations%INTERPOLATION%FIBRE_INTERP_POINT(field_u_variable_type)%PTR
605  geometricinterppointmetrics=>equations%INTERPOLATION%GEOMETRIC_INTERP_POINT_METRICS(field_u_variable_type)%PTR
606 
607  !Loop over gauss points
608  DO ng=1,quadraturescheme%NUMBER_OF_GAUSS
609 #ifdef TAUPROF
610  WRITE (cvar,'(a17,i2)') 'Gauss Point Loop ',ng
611  CALL tau_phase_create_dynamic(gauss_point_loop_phase,cvar)
612  CALL tau_phase_start(gauss_point_loop_phase)
613 #endif
614  CALL field_interpolate_gauss(first_part_deriv,basis_default_quadrature_scheme,ng,equations%INTERPOLATION% &
615  & geometric_interp_point(field_u_variable_type)%PTR,err,error,*999)
616  CALL field_interpolate_gauss(no_part_deriv,basis_default_quadrature_scheme,ng,equations%INTERPOLATION% &
617  & materials_interp_point(field_u_variable_type)%PTR,err,error,*999)
618  CALL field_interpolate_gauss(no_part_deriv,basis_default_quadrature_scheme,ng,equations%INTERPOLATION% &
619  & fibre_interp_point(field_u_variable_type)%PTR,err,error,*999)
620 
621  CALL field_interpolated_point_metrics_calculate(geometricbasis%NUMBER_OF_XI,geometricinterppointmetrics, &
622  & err,error,*999)
623 
624  !Calculate RWG.
625 !!TODO: Think about symmetric problems.
626  rwg=geometricinterppointmetrics%JACOBIAN*quadraturescheme%GAUSS_WEIGHTS(ng)
627 
628  !conductivity in material coordinates
629  conductivitymaterial=0.0_dp
630  IF(numberofdimensions==2) THEN
631  conductivitymaterial(1,1)=equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_u_variable_type)%PTR%VALUES(1,1)
632  conductivitymaterial(2,2)=equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_u_variable_type)%PTR%VALUES(2,1)
633  conductivitymaterial(1,2)=equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_u_variable_type)%PTR%VALUES(3,1)
634  conductivitymaterial(2,1)=conductivitymaterial(1,2)
635  ELSE
636  conductivitymaterial(1,1)=equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_u_variable_type)%PTR%VALUES(1,1)
637  conductivitymaterial(2,2)=equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_u_variable_type)%PTR%VALUES(2,1)
638  conductivitymaterial(3,3)=equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_u_variable_type)%PTR%VALUES(3,1)
639  conductivitymaterial(1,2)=equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_u_variable_type)%PTR%VALUES(4,1)
640  conductivitymaterial(2,1)=conductivitymaterial(1,2)
641  conductivitymaterial(2,3)=equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_u_variable_type)%PTR%VALUES(5,1)
642  conductivitymaterial(3,2)=conductivitymaterial(2,3)
643  conductivitymaterial(1,3)=equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_u_variable_type)%PTR%VALUES(6,1)
644  conductivitymaterial(3,1)=conductivitymaterial(1,3)
645  ENDIF
646 
647  !rotate the conductivity from material coordinates into xi-space to get the effective conductivity
648  dnudx=0.0_rp
649  dxdnu=0.0_rp
650  dnudxi=0.0_rp
651  dxidnu=0.0_rp
652  CALL coordinates_materialsystemcalculate(geometricinterppointmetrics,fibreinterpolatedpoint, &
653  & dnudx(1:numberofdimensions,1:numberofdimensions),dxdnu(1:numberofdimensions,1:numberofdimensions), &
654  & dnudxi(1:numberofdimensions,1:numberofdimensions),dxidnu(1:numberofdimensions,1:numberofdimensions), &
655  & err,error,*999)
656 
657  conductivitytemp=0.0_rp
658  conductivity=0.0_rp
659  CALL matrix_product(dnudxi(1:numberofdimensions,1:numberofdimensions), &
660  & conductivitymaterial(1:numberofdimensions,1:numberofdimensions), &
661  & conductivitytemp(1:numberofdimensions,1:numberofdimensions),err,error,*999)
662  CALL matrix_product(conductivitytemp(1:numberofdimensions,1:numberofdimensions), &
663  & dxidnu(1:numberofdimensions,1:numberofdimensions), &
664  & conductivity(1:numberofdimensions,1:numberofdimensions),err,error,*999)
665 
666  !Loop over field components
667  mhs=0
668  DO mh=1,fieldvariable%NUMBER_OF_COMPONENTS
669  !Loop over element rows
670  DO ms=1,dependentbasis%NUMBER_OF_ELEMENT_PARAMETERS
671  mhs=mhs+1
672  !Loop over field components
673  nhs=0
674  IF(equationsmatrix%UPDATE_MATRIX) THEN
675  DO nh=1,fieldvariable%NUMBER_OF_COMPONENTS
676  !Loop over element columns
677  DO ns=1,dependentbasis%NUMBER_OF_ELEMENT_PARAMETERS
678  nhs=nhs+1
679 
680  DO ni=1,dependentbasis%NUMBER_OF_XI
681  pgmsi(ni)=quadraturescheme%GAUSS_BASIS_FNS(ms,partial_derivative_first_derivative_map(ni),ng)
682  pgnsi(ni)=quadraturescheme%GAUSS_BASIS_FNS(ns,partial_derivative_first_derivative_map(ni),ng)
683  ENDDO !ni
684 
685  sum=0.0_dp
686  DO i=1,dependentbasis%NUMBER_OF_XI
687  DO k=1,dependentbasis%NUMBER_OF_XI
688  DO h=1,dependentbasis%NUMBER_OF_XI
689  sum=sum+conductivity(i,k)*pgnsi(k)*pgmsi(h)*geometricinterppointmetrics%GU(i,h)
690  ENDDO !h
691  ENDDO !k
692  ENDDO !i
693 
694  equationsmatrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)=equationsmatrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)+sum*rwg
695 
696  ENDDO !ns
697  ENDDO !nh
698  ENDIF
699 
700  IF(rhsvector%UPDATE_VECTOR) rhsvector%ELEMENT_VECTOR%VECTOR(mhs)=0.0_dp
701 
702  ENDDO !ms
703  ENDDO !mh
704 #ifdef TAUPROF
705  CALL tau_phase_stop(gauss_point_loop_phase)
706 #endif
707  ENDDO !ng
708 
709  !Scale factor adjustment
710  IF(dependentfield%SCALINGS%SCALING_TYPE/=field_no_scaling) THEN
711  CALL field_interpolationparametersscalefactorselementget(elementnumber,equations%INTERPOLATION% &
712  & dependent_interp_parameters(fieldvartype)%PTR,err,error,*999)
713  mhs=0
714  DO mh=1,fieldvariable%NUMBER_OF_COMPONENTS
715  !Loop over element rows
716  DO ms=1,dependentbasis%NUMBER_OF_ELEMENT_PARAMETERS
717  mhs=mhs+1
718  nhs=0
719  IF(equationsmatrix%UPDATE_MATRIX) THEN
720  !Loop over element columns
721  DO nh=1,fieldvariable%NUMBER_OF_COMPONENTS
722  DO ns=1,dependentbasis%NUMBER_OF_ELEMENT_PARAMETERS
723  nhs=nhs+1
724  equationsmatrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)=equationsmatrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)* &
725  & equations%INTERPOLATION%DEPENDENT_INTERP_PARAMETERS(fieldvartype)%PTR%SCALE_FACTORS(ms,mh)* &
726  & equations%INTERPOLATION%DEPENDENT_INTERP_PARAMETERS(fieldvartype)%PTR%SCALE_FACTORS(ns,nh)
727  ENDDO !ns
728  ENDDO !nh
729  ENDIF
730  IF(rhsvector%UPDATE_VECTOR) rhsvector%ELEMENT_VECTOR%VECTOR(mhs)=rhsvector%ELEMENT_VECTOR%VECTOR(mhs)* &
731  & equations%INTERPOLATION%DEPENDENT_INTERP_PARAMETERS(fieldvartype)%PTR%SCALE_FACTORS(ms,mh)
732  ENDDO !ms
733  ENDDO !mh
734  ENDIF
735 
737 !!TODO: move these and scale factor adjustment out once generalised Laplace is put in.
738  !Store all these in equations matrices/somewhere else?????
739  dependentfield=>equations%INTERPOLATION%DEPENDENT_FIELD
740  geometricfield=>equations%INTERPOLATION%GEOMETRIC_FIELD
741  equationsmatrices=>equations%EQUATIONS_MATRICES
742  linearmatrices=>equationsmatrices%LINEAR_MATRICES
743  equationsmatrix=>linearmatrices%MATRICES(1)%PTR
744  rhsvector=>equationsmatrices%RHS_VECTOR
745  equationsmapping=>equations%EQUATIONS_MAPPING
746  linearmapping=>equationsmapping%LINEAR_MAPPING
747  fieldvariable=>linearmapping%EQUATIONS_MATRIX_TO_VAR_MAPS(1)%VARIABLE
748  fieldvartype=fieldvariable%VARIABLE_TYPE
749  dependentbasis=>dependentfield%DECOMPOSITION%DOMAIN(dependentfield%DECOMPOSITION%MESH_COMPONENT_NUMBER)%PTR% &
750  & topology%ELEMENTS%ELEMENTS(elementnumber)%BASIS
751  geometricbasis=>geometricfield%DECOMPOSITION%DOMAIN(geometricfield%DECOMPOSITION%MESH_COMPONENT_NUMBER)%PTR% &
752  & topology%ELEMENTS%ELEMENTS(elementnumber)%BASIS
753  quadraturescheme=>dependentbasis%QUADRATURE%QUADRATURE_SCHEME_MAP(basis_default_quadrature_scheme)%PTR
754  CALL field_interpolation_parameters_element_get(field_values_set_type,elementnumber,equations%INTERPOLATION% &
755  & geometric_interp_parameters(field_u_variable_type)%PTR,err,error,*999)
756  CALL field_interpolation_parameters_element_get(field_values_set_type,elementnumber,equations%INTERPOLATION% &
757  & independent_interp_parameters(field_u_variable_type)%PTR,err,error,*999)
758  !Loop over gauss points
759  DO ng=1,quadraturescheme%NUMBER_OF_GAUSS
760  CALL field_interpolate_gauss(first_part_deriv,basis_default_quadrature_scheme,ng,equations%INTERPOLATION% &
761  & geometric_interp_point(field_u_variable_type)%PTR,err,error,*999)
762  CALL field_interpolated_point_metrics_calculate(geometricbasis%NUMBER_OF_XI,equations%INTERPOLATION% &
763  & geometric_interp_point_metrics(field_u_variable_type)%PTR,err,error,*999)
764  CALL field_interpolate_gauss(no_part_deriv,basis_default_quadrature_scheme,ng,equations%INTERPOLATION% &
765  & independent_interp_point(field_u_variable_type)%PTR,err,error,*999)
766  !Calculate RWG.
767 !!TODO: Think about symmetric problems.
768  rwg=equations%INTERPOLATION%GEOMETRIC_INTERP_POINT_METRICS(field_u_variable_type)%PTR%JACOBIAN* &
769  & quadraturescheme%GAUSS_WEIGHTS(ng)
770 
771  kvalue(1)=equations%INTERPOLATION%INDEPENDENT_INTERP_POINT(field_u_variable_type)%PTR%VALUES(1,no_part_deriv)
772  kvalue(2)=equations%INTERPOLATION%INDEPENDENT_INTERP_POINT(field_u_variable_type)%PTR%VALUES(2,no_part_deriv)
773  IF(fieldvariable%NUMBER_OF_COMPONENTS==3) THEN
774  kvalue(3)=equations%INTERPOLATION%INDEPENDENT_INTERP_POINT(field_u_variable_type)%PTR%VALUES(3,no_part_deriv)
775  END IF
776 
777 
778  !Loop over field components
779  mhs=0
780  DO mh=1,fieldvariable%NUMBER_OF_COMPONENTS
781  !Loop over element rows
782 !!TODO: CHANGE ELEMENT CALCULATE TO WORK OF ns ???
783  DO ms=1,dependentbasis%NUMBER_OF_ELEMENT_PARAMETERS
784  mhs=mhs+1
785  nhs=0
786  IF(equationsmatrix%UPDATE_MATRIX) THEN
787  !Loop over element columns
788  DO nh=1,fieldvariable%NUMBER_OF_COMPONENTS
789  DO ns=1,dependentbasis%NUMBER_OF_ELEMENT_PARAMETERS
790  nhs=nhs+1
791  DO ni=1,dependentbasis%NUMBER_OF_XI
792  pgmsi(ni)=quadraturescheme%GAUSS_BASIS_FNS(ms,partial_derivative_first_derivative_map(ni),ng)
793  pgnsi(ni)=quadraturescheme%GAUSS_BASIS_FNS(ns,partial_derivative_first_derivative_map(ni),ng)
794  ENDDO !ni
795 
796  IF(nh==mh) THEN
797  sum=0.0_dp
798  DO mi=1,dependentbasis%NUMBER_OF_XI
799  DO ni=1,dependentbasis%NUMBER_OF_XI
800  sum=sum+pgmsi(mi)*pgnsi(ni)*equations%INTERPOLATION% &
801  & geometric_interp_point_metrics(field_u_variable_type)%PTR%GU(mi,ni)*kvalue(mh)
802  ENDDO !ni
803  ENDDO !mi
804  equationsmatrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)=equationsmatrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)+sum*rwg
805  ENDIF
806 
807  ENDDO !ns
808  ENDDO !nh
809  ENDIF
810  IF(rhsvector%UPDATE_VECTOR) rhsvector%ELEMENT_VECTOR%VECTOR(mhs)=0.0_dp
811  ENDDO !ms
812  ENDDO !mh
813  ENDDO !ng
814 
815  !Scale factor adjustment
816  IF(dependentfield%SCALINGS%SCALING_TYPE/=field_no_scaling) THEN
817  CALL field_interpolationparametersscalefactorselementget(elementnumber,equations%INTERPOLATION% &
818  & dependent_interp_parameters(fieldvartype)%PTR,err,error,*999)
819  mhs=0
820  DO mh=1,fieldvariable%NUMBER_OF_COMPONENTS
821  !Loop over element rows
822  DO ms=1,dependentbasis%NUMBER_OF_ELEMENT_PARAMETERS
823  mhs=mhs+1
824  nhs=0
825  IF(equationsmatrix%UPDATE_MATRIX) THEN
826  !Loop over element columns
827  DO nh=1,fieldvariable%NUMBER_OF_COMPONENTS
828  DO ns=1,dependentbasis%NUMBER_OF_ELEMENT_PARAMETERS
829  nhs=nhs+1
830  equationsmatrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)=equationsmatrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)* &
831  & equations%INTERPOLATION%DEPENDENT_INTERP_PARAMETERS(fieldvartype)%PTR%SCALE_FACTORS(ms,mh)* &
832  & equations%INTERPOLATION%DEPENDENT_INTERP_PARAMETERS(fieldvartype)%PTR%SCALE_FACTORS(ns,nh)
833  ENDDO !ns
834  ENDDO !nh
835  ENDIF
836  IF(rhsvector%UPDATE_VECTOR) rhsvector%ELEMENT_VECTOR%VECTOR(mhs)=rhsvector%ELEMENT_VECTOR%VECTOR(mhs)* &
837  & equations%INTERPOLATION%DEPENDENT_INTERP_PARAMETERS(fieldvartype)%PTR%SCALE_FACTORS(ms,mh)
838  ENDDO !ms
839  ENDDO !mh
840  ENDIF
841 
842  CASE DEFAULT
843  localerror="Equations set subtype "//trim(number_to_vstring(equationsset%SPECIFICATION(3),"*",err,error))// &
844  & " is not valid for a Laplace equation type of a classical field equations set class."
845  CALL flagerror(localerror,err,error,*999)
846  END SELECT
847 
848  ELSE
849  CALL flagerror("Equations set equations is not associated.",err,error,*999)
850  ENDIF
851  ELSE
852  CALL flagerror("Equations set is not associated.",err,error,*999)
853  ENDIF
854 
855  exits("LaplaceEquation_FiniteElementCalculate")
856  RETURN
857 999 errorsexits("LaplaceEquation_FiniteElementCalculate",err,error)
858  RETURN 1
860 
861  !
862  !================================================================================================================================
863  !
864 
866  SUBROUTINE laplace_equationssetmovingmeshsetup(EQUATIONS_SET,EQUATIONS_SET_SETUP,ERR,ERROR,*)
868  !Argument variables
869  TYPE(equations_set_type), POINTER :: EQUATIONS_SET
870  TYPE(equations_set_setup_type), INTENT(INOUT) :: EQUATIONS_SET_SETUP
871  INTEGER(INTG), INTENT(OUT) :: ERR
872  TYPE(varying_string), INTENT(OUT) :: ERROR
873  !Local Variables
874  INTEGER(INTG) :: GEOMETRIC_MESH_COMPONENT,GEOMETRIC_SCALING_TYPE,GEOMETRIC_COMPONENT_NUMBER,MATERIAL_FIELD_NUMBER_OF_COMPONENTS
875  INTEGER(INTG) :: DEPENDENT_FIELD_NUMBER_OF_COMPONENTS,NUMBER_OF_DIMENSIONS,I,MATERIAL_FIELD_NUMBER_OF_VARIABLES
876  INTEGER(INTG) :: INDEPENDENT_FIELD_NUMBER_OF_COMPONENTS,INDEPENDENT_FIELD_NUMBER_OF_VARIABLES
877  TYPE(decomposition_type), POINTER :: GEOMETRIC_DECOMPOSITION
878  TYPE(field_type), POINTER :: ANALYTIC_FIELD,DEPENDENT_FIELD,GEOMETRIC_FIELD
879  TYPE(equations_type), POINTER :: EQUATIONS
880  TYPE(equations_mapping_type), POINTER :: EQUATIONS_MAPPING
881  TYPE(equations_matrices_type), POINTER :: EQUATIONS_MATRICES
882  TYPE(equations_set_materials_type), POINTER :: EQUATIONS_MATERIALS
883  TYPE(varying_string) :: LOCAL_ERROR
884 
885  enters("LAPLACE_EQUATION_EQUATION_SET_MOVING_MESH_SETUP",err,error,*999)
886 
887  NULLIFY(equations)
888  NULLIFY(equations_mapping)
889  NULLIFY(equations_matrices)
890  NULLIFY(geometric_decomposition)
891 
892  IF(ASSOCIATED(equations_set)) THEN
893  IF(.NOT.ALLOCATED(equations_set%SPECIFICATION)) THEN
894  CALL flagerror("Equations set specification is not allocated.",err,error,*999)
895  ELSE IF(SIZE(equations_set%SPECIFICATION,1)/=3) THEN
896  CALL flagerror("Equations set specification must have three entries for a Laplace type equations set.", &
897  & err,error,*999)
898  END IF
899  IF(equations_set%SPECIFICATION(3)==equations_set_moving_mesh_laplace_subtype) THEN
900  SELECT CASE(equations_set_setup%SETUP_TYPE)
902  SELECT CASE(equations_set_setup%ACTION_TYPE)
906  !Do nothing
907  CASE DEFAULT
908  local_error="The action type of "//trim(number_to_vstring(equations_set_setup%ACTION_TYPE,"*",err,error))// &
909  & " for a setup type of "//trim(number_to_vstring(equations_set_setup%SETUP_TYPE,"*",err,error))// &
910  & " is invalid for a moving mesh Laplace equation."
911  CALL flagerror(local_error,err,error,*999)
912  END SELECT
914  !Do nothing
916  SELECT CASE(equations_set_setup%ACTION_TYPE)
918  IF(equations_set%DEPENDENT%DEPENDENT_FIELD_AUTO_CREATED) THEN
919  !Create the auto created dependent field
920  CALL field_create_start(equations_set_setup%FIELD_USER_NUMBER,equations_set%REGION,equations_set%DEPENDENT% &
921  & dependent_field,err,error,*999)
922  CALL field_label_set(equations_set%DEPENDENT%DEPENDENT_FIELD,"Dependent Field",err,error,*999)
923  CALL field_type_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_general_type,err,error,*999)
924  CALL field_dependent_type_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_dependent_type,err,error,*999)
925  CALL field_mesh_decomposition_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_decomposition,err,error,*999)
926  CALL field_mesh_decomposition_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,geometric_decomposition, &
927  & err,error,*999)
928  CALL field_geometric_field_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,equations_set%GEOMETRY% &
929  & geometric_field,err,error,*999)
930 
931 
932  CALL field_number_of_variables_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,2,err,error,*999)
933  CALL field_variable_types_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,[field_u_variable_type, &
934  & field_deludeln_variable_type],err,error,*999)
935  CALL field_variable_label_set(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type,"Phi",err,error,*999)
936  CALL field_variable_label_set(equations_set%DEPENDENT%DEPENDENT_FIELD,field_deludeln_variable_type,"del Phi/del n", &
937  & err,error,*999)
938 
939  CALL field_dimension_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type, &
940  & field_vector_dimension_type,err,error,*999)
941  CALL field_dimension_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_deludeln_variable_type, &
942  & field_vector_dimension_type,err,error,*999)
943  CALL field_data_type_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type, &
944  & field_dp_type,err,error,*999)
945  CALL field_data_type_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_deludeln_variable_type, &
946  & field_dp_type,err,error,*999)
947  CALL field_number_of_components_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
948  & number_of_dimensions,err,error,*999)
949 
950  !calculate number of components with one component for each dimension and one for pressure
951  dependent_field_number_of_components=number_of_dimensions
952  CALL field_number_of_components_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type, &
953  & dependent_field_number_of_components,err,error,*999)
954  CALL field_number_of_components_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_deludeln_variable_type, &
955  & dependent_field_number_of_components,err,error,*999)
956 
957  DO i=1,dependent_field_number_of_components
958  !Default to the geometric interpolation setup
959  CALL field_component_mesh_component_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type,i, &
960  & geometric_mesh_component,err,error,*999)
961  CALL field_component_mesh_component_set(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type,i, &
962  & geometric_mesh_component,err,error,*999)
963  CALL field_component_mesh_component_set(equations_set%DEPENDENT%DEPENDENT_FIELD,field_deludeln_variable_type,i, &
964  & geometric_mesh_component,err,error,*999)
965  END DO
966 
967 
968  SELECT CASE(equations_set%SOLUTION_METHOD)
969 
971  DO i=1,dependent_field_number_of_components
972  CALL field_component_interpolation_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD, &
973  & field_u_variable_type,i,field_node_based_interpolation,err,error,*999)
974  CALL field_component_interpolation_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD, &
975  & field_deludeln_variable_type,i,field_node_based_interpolation,err,error,*999)
976  END DO
977  CALL field_scaling_type_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_scaling_type, &
978  & err,error,*999)
979  CALL field_scaling_type_set(equations_set%DEPENDENT%DEPENDENT_FIELD,geometric_scaling_type, &
980  & err,error,*999)
981  !Other solutions not defined yet
983  CALL flagerror("Not implemented.",err,error,*999)
985  CALL flagerror("Not implemented.",err,error,*999)
987  CALL flagerror("Not implemented.",err,error,*999)
989  CALL flagerror("Not implemented.",err,error,*999)
991  CALL flagerror("Not implemented.",err,error,*999)
992  CASE DEFAULT
993  local_error="The solution method of "//trim(number_to_vstring(equations_set%SOLUTION_METHOD,"*",err,error))// &
994  & " is invalid."
995  CALL flagerror(local_error,err,error,*999)
996  END SELECT
997  ELSE
998  !Check the user specified field
999  CALL field_type_check(equations_set_setup%FIELD,field_general_type,err,error,*999)
1000  CALL field_dependent_type_check(equations_set_setup%FIELD,field_dependent_type,err,error,*999)
1001  CALL field_number_of_variables_check(equations_set_setup%FIELD,2,err,error,*999)
1002  CALL field_variable_types_check(equations_set_setup%FIELD,[field_u_variable_type,field_deludeln_variable_type], &
1003  & err,error,*999)
1004  CALL field_dimension_check(equations_set_setup%FIELD,field_u_variable_type,field_vector_dimension_type, &
1005  & err,error,*999)
1006  CALL field_dimension_check(equations_set_setup%FIELD,field_deludeln_variable_type,field_vector_dimension_type, &
1007  & err,error,*999)
1008  CALL field_data_type_check(equations_set_setup%FIELD,field_u_variable_type,field_dp_type,err,error,*999)
1009  CALL field_data_type_check(equations_set_setup%FIELD,field_deludeln_variable_type,field_dp_type,err,error,*999)
1010 
1011  CALL field_number_of_components_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
1012  & number_of_dimensions,err,error,*999)
1013 
1014  dependent_field_number_of_components=number_of_dimensions
1015  CALL field_number_of_components_check(equations_set_setup%FIELD,field_u_variable_type, &
1016  & dependent_field_number_of_components,err,error,*999)
1017  CALL field_number_of_components_check(equations_set_setup%FIELD,field_deludeln_variable_type, &
1018  & dependent_field_number_of_components,err,error,*999)
1019  SELECT CASE(equations_set%SOLUTION_METHOD)
1021  CALL field_component_interpolation_check(equations_set_setup%FIELD,field_u_variable_type,1, &
1022  & field_node_based_interpolation,err,error,*999)
1023  CALL field_component_interpolation_check(equations_set_setup%FIELD,field_deludeln_variable_type,1, &
1024  & field_node_based_interpolation,err,error,*999)
1026  CALL flagerror("Not implemented.",err,error,*999)
1028  CALL flagerror("Not implemented.",err,error,*999)
1030  CALL flagerror("Not implemented.",err,error,*999)
1032  CALL flagerror("Not implemented.",err,error,*999)
1034  CALL flagerror("Not implemented.",err,error,*999)
1035  CASE DEFAULT
1036  local_error="The solution method of "//trim(number_to_vstring(equations_set%SOLUTION_METHOD,"*",err,error))// &
1037  & " is invalid."
1038  CALL flagerror(local_error,err,error,*999)
1039  END SELECT
1040  ENDIF
1042  IF(equations_set%DEPENDENT%DEPENDENT_FIELD_AUTO_CREATED) THEN
1043  CALL field_create_finish(equations_set%DEPENDENT%DEPENDENT_FIELD,err,error,*999)
1044  ENDIF
1045  CASE DEFAULT
1046  local_error="The action type of "//trim(number_to_vstring(equations_set_setup%ACTION_TYPE,"*",err,error))// &
1047  & " for a setup type of "//trim(number_to_vstring(equations_set_setup%SETUP_TYPE,"*",err,error))// &
1048  & " is invalid for a moving mesh Laplace equation"
1049  CALL flagerror(local_error,err,error,*999)
1050  END SELECT
1051 
1053  SELECT CASE(equations_set_setup%ACTION_TYPE)
1054  !Set start action
1056  IF(equations_set%INDEPENDENT%INDEPENDENT_FIELD_AUTO_CREATED) THEN
1057  !Create the auto created independent field
1058  !start field creation with name 'INDEPENDENT_FIELD'
1059  CALL field_create_start(equations_set_setup%FIELD_USER_NUMBER,equations_set%REGION, &
1060  & equations_set%INDEPENDENT%INDEPENDENT_FIELD,err,error,*999)
1061  !start creation of a new field
1062  CALL field_type_set_and_lock(equations_set%INDEPENDENT%INDEPENDENT_FIELD,field_general_type,err,error,*999)
1063  !define new created field to be independent
1064  CALL field_dependent_type_set_and_lock(equations_set%INDEPENDENT%INDEPENDENT_FIELD, &
1065  & field_independent_type,err,error,*999)
1066  !look for decomposition rule already defined
1067  CALL field_mesh_decomposition_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_decomposition, &
1068  & err,error,*999)
1069  !apply decomposition rule found on new created field
1070  CALL field_mesh_decomposition_set_and_lock(equations_set%INDEPENDENT%INDEPENDENT_FIELD, &
1071  & geometric_decomposition,err,error,*999)
1072  !point new field to geometric field
1073  CALL field_geometric_field_set_and_lock(equations_set%INDEPENDENT%INDEPENDENT_FIELD,equations_set% &
1074  & geometry%GEOMETRIC_FIELD,err,error,*999)
1075  !set number of variables to 1 (1 for U)
1076  independent_field_number_of_variables=1
1077  CALL field_number_of_variables_set_and_lock(equations_set%INDEPENDENT%INDEPENDENT_FIELD, &
1078  & independent_field_number_of_variables,err,error,*999)
1079  CALL field_variable_types_set_and_lock(equations_set%INDEPENDENT%INDEPENDENT_FIELD, &
1080  & [field_u_variable_type],err,error,*999)
1081  CALL field_dimension_set_and_lock(equations_set%INDEPENDENT%INDEPENDENT_FIELD,field_u_variable_type, &
1082  & field_vector_dimension_type,err,error,*999)
1083  CALL field_data_type_set_and_lock(equations_set%INDEPENDENT%INDEPENDENT_FIELD,field_u_variable_type, &
1084  & field_dp_type,err,error,*999)
1085  CALL field_number_of_components_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
1086  & number_of_dimensions,err,error,*999)
1087  !calculate number of components with one component for each dimension
1088  independent_field_number_of_components=number_of_dimensions
1089  CALL field_number_of_components_set_and_lock(equations_set%INDEPENDENT%INDEPENDENT_FIELD, &
1090  & field_u_variable_type,independent_field_number_of_components,err,error,*999)
1091  CALL field_component_mesh_component_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
1092  & 1,geometric_mesh_component,err,error,*999)
1093  !Default to the geometric interpolation setup
1094  DO i=1,independent_field_number_of_components
1095  CALL field_component_mesh_component_set(equations_set%INDEPENDENT%INDEPENDENT_FIELD, &
1096  & field_u_variable_type,i,geometric_mesh_component,err,error,*999)
1097  END DO
1098  ELSE
1099  !Check the user specified field
1100  CALL field_type_check(equations_set_setup%FIELD,field_general_type,err,error,*999)
1101  CALL field_dependent_type_check(equations_set_setup%FIELD,field_independent_type,err,error,*999)
1102  CALL field_number_of_variables_check(equations_set_setup%FIELD,1,err,error,*999)
1103  CALL field_variable_types_check(equations_set_setup%FIELD,[field_u_variable_type],err,error,*999)
1104  CALL field_dimension_check(equations_set_setup%FIELD,field_u_variable_type,field_vector_dimension_type, &
1105  & err,error,*999)
1106  CALL field_data_type_check(equations_set_setup%FIELD,field_u_variable_type,field_dp_type,err,error,*999)
1107  CALL field_number_of_components_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
1108  & number_of_dimensions,err,error,*999)
1109  !calculate number of components with one component for each dimension and one for pressure
1110  independent_field_number_of_components=number_of_dimensions
1111  CALL field_number_of_components_check(equations_set_setup%FIELD,field_u_variable_type, &
1112  & independent_field_number_of_components,err,error,*999)
1113  ENDIF
1114  !Specify finish action
1116  IF(equations_set%INDEPENDENT%INDEPENDENT_FIELD_AUTO_CREATED) THEN
1117  CALL field_create_finish(equations_set%INDEPENDENT%INDEPENDENT_FIELD,err,error,*999)
1118  ENDIF
1119  CALL field_parameter_set_create(equations_set%INDEPENDENT%INDEPENDENT_FIELD,field_u_variable_type, &
1120  & field_boundary_set_type,err,error,*999)
1121  CASE DEFAULT
1122  local_error="The action type of "//trim(number_to_vstring(equations_set_setup%ACTION_TYPE,"*",err,error))// &
1123  & " for a setup type of "//trim(number_to_vstring(equations_set_setup%SETUP_TYPE,"*",err,error))// &
1124  & " is invalid for a standard Laplace"
1125  CALL flagerror(local_error,err,error,*999)
1126  END SELECT
1127 
1129  SELECT CASE(equations_set_setup%ACTION_TYPE)
1131  !Do nothing
1132  material_field_number_of_variables=1!X
1133  material_field_number_of_components=1!Y
1134 
1135  equations_materials=>equations_set%MATERIALS
1136  IF(ASSOCIATED(equations_materials)) THEN
1137  IF(equations_materials%MATERIALS_FIELD_AUTO_CREATED) THEN
1138  !Create the auto created materials field
1139  !start field creation with name 'MATERIAL_FIELD'
1140  CALL field_create_start(equations_set_setup%FIELD_USER_NUMBER,equations_set%REGION,equations_set% &
1141  & materials%MATERIALS_FIELD,err,error,*999)
1142  CALL field_type_set_and_lock(equations_materials%MATERIALS_FIELD,field_material_type,err,error,*999)
1143  CALL field_dependent_type_set_and_lock(equations_materials%MATERIALS_FIELD,field_independent_type, &
1144  & err,error,*999)
1145  CALL field_mesh_decomposition_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_decomposition, &
1146  & err,error,*999)
1147  !apply decomposition rule found on new created field
1148  CALL field_mesh_decomposition_set_and_lock(equations_set%MATERIALS%MATERIALS_FIELD, &
1149  & geometric_decomposition,err,error,*999)
1150  !point new field to geometric field
1151  CALL field_geometric_field_set_and_lock(equations_materials%MATERIALS_FIELD,equations_set%GEOMETRY% &
1152  & geometric_field,err,error,*999)
1153  CALL field_number_of_variables_set(equations_materials%MATERIALS_FIELD, &
1154  & material_field_number_of_variables,err,error,*999)
1155  CALL field_variable_types_set_and_lock(equations_materials%MATERIALS_FIELD,[field_u_variable_type], &
1156  & err,error,*999)
1157  CALL field_dimension_set_and_lock(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
1158  & field_vector_dimension_type,err,error,*999)
1159  CALL field_data_type_set_and_lock(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
1160  & field_dp_type,err,error,*999)
1161  CALL field_number_of_components_set_and_lock(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
1162  & material_field_number_of_components,err,error,*999)
1163  CALL field_component_mesh_component_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
1164  & 1,geometric_component_number,err,error,*999)
1165  CALL field_component_mesh_component_set(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
1166  & 1,geometric_component_number,err,error,*999)
1167  CALL field_component_interpolation_set(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
1168  & 1,field_constant_interpolation,err,error,*999)
1169  !Default the field scaling to that of the geometric field
1170  CALL field_scaling_type_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_scaling_type,err,error,*999)
1171  CALL field_scaling_type_set(equations_materials%MATERIALS_FIELD,geometric_scaling_type,err,error,*999)
1172  ELSE
1173  !Check the user specified field
1174  CALL field_type_check(equations_set_setup%FIELD,field_material_type,err,error,*999)
1175  CALL field_dependent_type_check(equations_set_setup%FIELD,field_independent_type,err,error,*999)
1176  CALL field_number_of_variables_check(equations_set_setup%FIELD,1,err,error,*999)
1177  CALL field_variable_types_check(equations_set_setup%FIELD,[field_u_variable_type],err,error,*999)
1178  CALL field_dimension_check(equations_set_setup%FIELD,field_u_variable_type,field_vector_dimension_type, &
1179  & err,error,*999)
1180  CALL field_data_type_check(equations_set_setup%FIELD,field_u_variable_type,field_dp_type,err,error,*999)
1181  CALL field_number_of_components_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
1182  & number_of_dimensions,err,error,*999)
1183  CALL field_number_of_components_check(equations_set_setup%FIELD,field_u_variable_type,1,err,error,*999)
1184  ENDIF
1185  ELSE
1186  CALL flagerror("Equations set materials is not associated.",err,error,*999)
1187  END IF
1189  equations_materials=>equations_set%MATERIALS
1190  IF(ASSOCIATED(equations_materials)) THEN
1191  IF(equations_materials%MATERIALS_FIELD_AUTO_CREATED) THEN
1192  !Finish creating the materials field
1193  CALL field_create_finish(equations_materials%MATERIALS_FIELD,err,error,*999)
1194  !Set the default values for the materials field
1195  CALL field_component_values_initialise(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
1196  & field_values_set_type,1,1.0_dp,err,error,*999)
1197  ENDIF
1198  ELSE
1199  CALL flagerror("Equations set materials is not associated.",err,error,*999)
1200  ENDIF
1201  CASE DEFAULT
1202  local_error="The action type of "//trim(number_to_vstring(equations_set_setup%ACTION_TYPE,"*",err,error))// &
1203  & " for a setup type of "//trim(number_to_vstring(equations_set_setup%SETUP_TYPE,"*",err,error))// &
1204  & " is invalid for a moving mesh Laplace equation."
1205  CALL flagerror(local_error,err,error,*999)
1206  END SELECT
1208  SELECT CASE(equations_set_setup%ACTION_TYPE)
1210  !Do nothing
1212  !Do nothing
1213  CASE DEFAULT
1214  local_error="The action type of "//trim(number_to_vstring(equations_set_setup%ACTION_TYPE,"*",err,error))// &
1215  & " for a setup type of "//trim(number_to_vstring(equations_set_setup%SETUP_TYPE,"*",err,error))// &
1216  & " is invalid for a moving mesh Laplace equation."
1217  CALL flagerror(local_error,err,error,*999)
1218  END SELECT
1220  SELECT CASE(equations_set_setup%ACTION_TYPE)
1222  IF(equations_set%DEPENDENT%DEPENDENT_FINISHED) THEN
1223  dependent_field=>equations_set%DEPENDENT%DEPENDENT_FIELD
1224  IF(ASSOCIATED(dependent_field)) THEN
1225  geometric_field=>equations_set%GEOMETRY%GEOMETRIC_FIELD
1226  IF(ASSOCIATED(geometric_field)) THEN
1227  CALL field_number_of_components_get(geometric_field,field_u_variable_type,number_of_dimensions,err,error,*999)
1228  SELECT CASE(equations_set_setup%ANALYTIC_FUNCTION_TYPE)
1230  !Check that we are in 2D
1231  IF(number_of_dimensions/=2) THEN
1232  local_error="The number of geometric dimensions of "// &
1233  & trim(number_to_vstring(number_of_dimensions,"*",err,error))// &
1234  & " is invalid. The analytic function type of "// &
1235  & trim(number_to_vstring(equations_set_setup%ANALYTIC_FUNCTION_TYPE,"*",err,error))// &
1236  & " requires that there be 2 geometric dimensions."
1237  CALL flagerror(local_error,err,error,*999)
1238  ENDIF
1239  !Create analytic field if required
1240  !Set analtyic function type
1241  equations_set%ANALYTIC%ANALYTIC_FUNCTION_TYPE=equations_set_laplace_equation_two_dim_1
1243  !Check that we are in 2D
1244  IF(number_of_dimensions/=2) THEN
1245  local_error="The number of geometric dimensions of "// &
1246  & trim(number_to_vstring(number_of_dimensions,"*",err,error))// &
1247  & " is invalid. The analytic function type of "// &
1248  & trim(number_to_vstring(equations_set_setup%ANALYTIC_FUNCTION_TYPE,"*",err,error))// &
1249  & " requires that there be 2 geometric dimensions."
1250  CALL flagerror(local_error,err,error,*999)
1251  ENDIF
1252  !Create analytic field if required
1253  !Set analtyic function type
1254  equations_set%ANALYTIC%ANALYTIC_FUNCTION_TYPE=equations_set_laplace_equation_two_dim_2
1256  !Check that we are in 3D
1257  IF(number_of_dimensions/=3) THEN
1258  local_error="The number of geometric dimensions of "// &
1259  & trim(number_to_vstring(number_of_dimensions,"*",err,error))// &
1260  & " is invalid. The analytic function type of "// &
1261  & trim(number_to_vstring(equations_set_setup%ANALYTIC_FUNCTION_TYPE,"*",err,error))// &
1262  & " requires that there be 3 geometric dimensions."
1263  CALL flagerror(local_error,err,error,*999)
1264  ENDIF
1265  !Create analytic field if required
1266  !Set analtyic function type
1267  equations_set%ANALYTIC%ANALYTIC_FUNCTION_TYPE=equations_set_laplace_equation_three_dim_1
1269  !Check that we are in 3D
1270  IF(number_of_dimensions/=3) THEN
1271  local_error="The number of geometric dimensions of "// &
1272  & trim(number_to_vstring(number_of_dimensions,"*",err,error))// &
1273  & " is invalid. The analytic function type of "// &
1274  & trim(number_to_vstring(equations_set_setup%ANALYTIC_FUNCTION_TYPE,"*",err,error))// &
1275  & " requires that there be 3 geometric dimensions."
1276  CALL flagerror(local_error,err,error,*999)
1277  ENDIF
1278  !Create analytic field if required
1279  !Set analtyic function type
1280  equations_set%ANALYTIC%ANALYTIC_FUNCTION_TYPE=equations_set_laplace_equation_three_dim_2
1281  CASE DEFAULT
1282  local_error="The specified analytic function type of "// &
1283  & trim(number_to_vstring(equations_set_setup%ANALYTIC_FUNCTION_TYPE,"*",err,error))// &
1284  & " is invalid for a moving mesh Laplace equation."
1285  CALL flagerror(local_error,err,error,*999)
1286  END SELECT
1287  ELSE
1288  CALL flagerror("Equations set geometric field is not associated.",err,error,*999)
1289  ENDIF
1290  ELSE
1291  CALL flagerror("Equations set dependent field is not associated.",err,error,*999)
1292  ENDIF
1293  ELSE
1294  CALL flagerror("Equations set dependent field has not been finished.",err,error,*999)
1295  ENDIF
1297  IF(ASSOCIATED(equations_set%ANALYTIC)) THEN
1298  analytic_field=>equations_set%ANALYTIC%ANALYTIC_FIELD
1299  IF(ASSOCIATED(analytic_field)) THEN
1300  IF(equations_set%ANALYTIC%ANALYTIC_FIELD_AUTO_CREATED) THEN
1301  CALL field_create_finish(equations_set%DEPENDENT%DEPENDENT_FIELD,err,error,*999)
1302  ENDIF
1303  ENDIF
1304  ELSE
1305  CALL flagerror("Equations set analytic is not associated.",err,error,*999)
1306  ENDIF
1307  CASE DEFAULT
1308  local_error="The action type of "//trim(number_to_vstring(equations_set_setup%ACTION_TYPE,"*",err,error))// &
1309  & " for a setup type of "//trim(number_to_vstring(equations_set_setup%SETUP_TYPE,"*",err,error))// &
1310  & " is invalid for a moving mesh Laplace equation."
1311  CALL flagerror(local_error,err,error,*999)
1312  END SELECT
1314  SELECT CASE(equations_set_setup%ACTION_TYPE)
1316  IF(equations_set%DEPENDENT%DEPENDENT_FINISHED) THEN
1317  CALL equations_create_start(equations_set,equations,err,error,*999)
1318  CALL equations_linearity_type_set(equations,equations_linear,err,error,*999)
1319  CALL equations_time_dependence_type_set(equations,equations_static,err,error,*999)
1320  ELSE
1321  CALL flagerror("Equations set dependent field has not been finished.",err,error,*999)
1322  ENDIF
1324  SELECT CASE(equations_set%SOLUTION_METHOD)
1326  !Finish the equations creation
1327  CALL equations_set_equations_get(equations_set,equations,err,error,*999)
1328  CALL equations_create_finish(equations,err,error,*999)
1329  !Create the equations mapping.
1330  CALL equations_mapping_create_start(equations,equations_mapping,err,error,*999)
1331  CALL equationsmapping_linearmatricesnumberset(equations_mapping,1,err,error,*999)
1332  CALL equationsmapping_linearmatricesvariabletypesset(equations_mapping,[field_u_variable_type], &
1333  & err,error,*999)
1334  CALL equations_mapping_rhs_variable_type_set(equations_mapping,field_deludeln_variable_type,err,error,*999)
1335  CALL equations_mapping_create_finish(equations_mapping,err,error,*999)
1336  !Create the equations matrices
1337  CALL equations_matrices_create_start(equations,equations_matrices,err,error,*999)
1338  SELECT CASE(equations%SPARSITY_TYPE)
1341  & err,error,*999)
1344  & err,error,*999)
1346  & err,error,*999)
1347  CASE DEFAULT
1348  local_error="The equations matrices sparsity type of "// &
1349  & trim(number_to_vstring(equations%SPARSITY_TYPE,"*",err,error))//" is invalid."
1350  CALL flagerror(local_error,err,error,*999)
1351  END SELECT
1352  CALL equations_matrices_create_finish(equations_matrices,err,error,*999)
1354  CALL flagerror("Not implemented.",err,error,*999)
1356  CALL flagerror("Not implemented.",err,error,*999)
1358  CALL flagerror("Not implemented.",err,error,*999)
1360  CALL flagerror("Not implemented.",err,error,*999)
1362  CALL flagerror("Not implemented.",err,error,*999)
1363  CASE DEFAULT
1364  local_error="The solution method of "//trim(number_to_vstring(equations_set%SOLUTION_METHOD,"*",err,error))// &
1365  & " is invalid."
1366  CALL flagerror(local_error,err,error,*999)
1367  END SELECT
1368  CASE DEFAULT
1369  local_error="The action type of "//trim(number_to_vstring(equations_set_setup%ACTION_TYPE,"*",err,error))// &
1370  & " for a setup type of "//trim(number_to_vstring(equations_set_setup%SETUP_TYPE,"*",err,error))// &
1371  & " is invalid for a moving mesh Laplace equation."
1372  CALL flagerror(local_error,err,error,*999)
1373  END SELECT
1374  CASE DEFAULT
1375  local_error="The setup type of "//trim(number_to_vstring(equations_set_setup%SETUP_TYPE,"*",err,error))// &
1376  & " is invalid for a moving mesh Laplace equation."
1377  CALL flagerror(local_error,err,error,*999)
1378  END SELECT
1379  ELSE
1380  local_error="The equations set subtype of "//trim(number_to_vstring(equations_set%SPECIFICATION(3),"*",err,error))// &
1381  & " does not equal a moving mesh Laplace equation subtype."
1382  CALL flagerror(local_error,err,error,*999)
1383  ENDIF
1384  ELSE
1385  CALL flagerror("Equations set is not associated.",err,error,*999)
1386  ENDIF
1387 
1388  exits("Laplace_EquationsSetMovingMeshSetup")
1389  RETURN
1390 999 errorsexits("Laplace_EquationsSetMovingMeshSetup",err,error)
1391  RETURN 1
1393 
1394  !
1395  !================================================================================================================================
1396  !
1397 
1399  SUBROUTINE laplace_equation_equations_set_setup(EQUATIONS_SET,EQUATIONS_SET_SETUP,ERR,ERROR,*)
1401  !Argument variables
1402  TYPE(equations_set_type), POINTER :: EQUATIONS_SET
1403  TYPE(equations_set_setup_type), INTENT(INOUT) :: EQUATIONS_SET_SETUP
1404  INTEGER(INTG), INTENT(OUT) :: ERR
1405  TYPE(varying_string), INTENT(OUT) :: ERROR
1406  !Local Variables
1407  TYPE(varying_string) :: LOCAL_ERROR
1408 
1409  enters("LAPLACE_EQUATION_EQUATIONS_SET_SETUP",err,error,*999)
1410 
1411  IF(ASSOCIATED(equations_set)) THEN
1412  IF(.NOT.ALLOCATED(equations_set%SPECIFICATION)) THEN
1413  CALL flagerror("Equations set specification is not allocated.",err,error,*999)
1414  ELSE IF(SIZE(equations_set%SPECIFICATION,1)/=3) THEN
1415  CALL flagerror("Equations set specification must have three entries for a Laplace type equations set.", &
1416  & err,error,*999)
1417  END IF
1418  SELECT CASE(equations_set%SPECIFICATION(3))
1420  CALL laplace_equationssetstandardsetup(equations_set,equations_set_setup,err,error,*999)
1422  CALL laplace_equationssetmovingmeshsetup(equations_set,equations_set_setup,err,error,*999)
1424  CALL laplace_equationssetgeneralisedsetup(equations_set,equations_set_setup,err,error,*999)
1425  CASE DEFAULT
1426  local_error="Equations set subtype "//trim(number_to_vstring(equations_set%SPECIFICATION(3),"*",err,error))// &
1427  & " is not valid for a Laplace equation type of a classical field equation set class."
1428  CALL flagerror(local_error,err,error,*999)
1429  END SELECT
1430  ELSE
1431  CALL flagerror("Equations set is not associated.",err,error,*999)
1432  ENDIF
1433 
1434  exits("LAPLACE_EQUATION_EQUATIONS_SET_SETUP")
1435  RETURN
1436 999 errorsexits("LAPLACE_EQUATION_EQUATIONS_SET_SETUP",err,error)
1437  RETURN 1
1439 
1440  !
1441  !================================================================================================================================
1442  !
1443 
1445  SUBROUTINE laplace_equationssetsolutionmethodset(EQUATIONS_SET,SOLUTION_METHOD,ERR,ERROR,*)
1447  !Argument variables
1448  TYPE(equations_set_type), POINTER :: EQUATIONS_SET
1449  INTEGER(INTG), INTENT(IN) :: SOLUTION_METHOD
1450  INTEGER(INTG), INTENT(OUT) :: ERR
1451  TYPE(varying_string), INTENT(OUT) :: ERROR
1452  !Local Variables
1453  TYPE(varying_string) :: LOCAL_ERROR
1454 
1455  enters("Laplace_EquationsSetSolutionMethodSet",err,error,*999)
1456 
1457  IF(ASSOCIATED(equations_set)) THEN
1458  IF(.NOT.ALLOCATED(equations_set%SPECIFICATION)) THEN
1459  CALL flagerror("Equations set specification is not allocated.",err,error,*999)
1460  ELSE IF(SIZE(equations_set%SPECIFICATION,1)/=3) THEN
1461  CALL flagerror("Equations set specification must have three entries for a Laplace type equations set.", &
1462  & err,error,*999)
1463  END IF
1464  SELECT CASE(equations_set%SPECIFICATION(3))
1466  SELECT CASE(solution_method)
1468  equations_set%SOLUTION_METHOD=equations_set_fem_solution_method
1470  CALL flagerror("Not implemented.",err,error,*999)
1472  CALL flagerror("Not implemented.",err,error,*999)
1474  CALL flagerror("Not implemented.",err,error,*999)
1476  CALL flagerror("Not implemented.",err,error,*999)
1478  CALL flagerror("Not implemented.",err,error,*999)
1479  CASE DEFAULT
1480  local_error="The specified solution method of "//trim(number_to_vstring(solution_method,"*",err,error))//" is invalid."
1481  CALL flagerror(local_error,err,error,*999)
1482  END SELECT
1484  SELECT CASE(solution_method)
1486  equations_set%SOLUTION_METHOD=equations_set_fem_solution_method
1488  CALL flagerror("Not implemented.",err,error,*999)
1490  CALL flagerror("Not implemented.",err,error,*999)
1492  CALL flagerror("Not implemented.",err,error,*999)
1494  CALL flagerror("Not implemented.",err,error,*999)
1496  CALL flagerror("Not implemented.",err,error,*999)
1497  CASE DEFAULT
1498  local_error="The specified solution method of "//trim(number_to_vstring(solution_method,"*",err,error))//" is invalid."
1499  CALL flagerror(local_error,err,error,*999)
1500  END SELECT
1502  SELECT CASE(solution_method)
1504  equations_set%SOLUTION_METHOD=equations_set_fem_solution_method
1506  CALL flagerror("Not implemented.",err,error,*999)
1508  CALL flagerror("Not implemented.",err,error,*999)
1510  CALL flagerror("Not implemented.",err,error,*999)
1512  CALL flagerror("Not implemented.",err,error,*999)
1514  CALL flagerror("Not implemented.",err,error,*999)
1515  CASE DEFAULT
1516  local_error="The specified solution method of "//trim(number_to_vstring(solution_method,"*",err,error))//" is invalid."
1517  CALL flagerror(local_error,err,error,*999)
1518  END SELECT
1519  CASE DEFAULT
1520  local_error="Equations set subtype of "//trim(number_to_vstring(equations_set%SPECIFICATION(3),"*",err,error))// &
1521  & " is not valid for a Laplace equation type of an classical field equations set class."
1522  CALL flagerror(local_error,err,error,*999)
1523  END SELECT
1524  ELSE
1525  CALL flagerror("Equations set is not associated.",err,error,*999)
1526  ENDIF
1527 
1528  exits("Laplace_EquationsSetSolutionMethodSet")
1529  RETURN
1530 999 errors("Laplace_EquationsSetSolutionMethodSet",err,error)
1531  exits("Laplace_EquationsSetSolutionMethodSet")
1532  RETURN 1
1534 
1535  !
1536  !================================================================================================================================
1537  !
1538 
1540  SUBROUTINE laplace_equationssetspecificationset(equationsSet,specification,err,error,*)
1542  !Argument variables
1543  TYPE(equations_set_type), POINTER :: equationsSet
1544  INTEGER(INTG), INTENT(IN) :: specification(:)
1545  INTEGER(INTG), INTENT(OUT) :: err
1546  TYPE(varying_string), INTENT(OUT) :: error
1547  !Local Variables
1548  TYPE(varying_string) :: localError
1549  INTEGER(INTG) :: subtype
1550 
1551  enters("Laplace_EquationsSetSpecificationSet",err,error,*999)
1552 
1553  IF(ASSOCIATED(equationsset)) THEN
1554  IF(SIZE(specification,1)/=3) THEN
1555  CALL flagerror("Equations set specification must have three entries for a Laplace type equations set.", &
1556  & err,error,*999)
1557  END IF
1558  subtype=specification(3)
1559  SELECT CASE(subtype)
1563  !ok
1564  CASE DEFAULT
1565  localerror="The third equations set specification of "//trim(numbertovstring(subtype,"*",err,error))// &
1566  & " is not valid for a Laplace type of a classical field equations set."
1567  CALL flagerror(localerror,err,error,*999)
1568  END SELECT
1569  !Set full specification
1570  IF(ALLOCATED(equationsset%specification)) THEN
1571  CALL flagerror("Equations set specification is already allocated.",err,error,*999)
1572  ELSE
1573  ALLOCATE(equationsset%specification(3),stat=err)
1574  IF(err/=0) CALL flagerror("Could not allocate equations set specification.",err,error,*999)
1575  END IF
1576  equationsset%specification(1:3)=[equations_set_classical_field_class,equations_set_laplace_equation_type,subtype]
1577  ELSE
1578  CALL flagerror("Equations set is not associated.",err,error,*999)
1579  END IF
1580 
1581  CALL exits("Laplace_EquationsSetSpecificationSet")
1582  RETURN
1583 999 CALL errors("Laplace_EquationsSetSpecificationSet",err,error)
1584  CALL exits("Laplace_EquationsSetSpecificationSet")
1585  RETURN 1
1586 
1588 
1589  !
1590  !================================================================================================================================
1591  !
1592 
1594  SUBROUTINE laplace_equationssetstandardsetup(EQUATIONS_SET,EQUATIONS_SET_SETUP,ERR,ERROR,*)
1596  !Argument variables
1597  TYPE(equations_set_type), POINTER :: EQUATIONS_SET
1598  TYPE(equations_set_setup_type), INTENT(INOUT) :: EQUATIONS_SET_SETUP
1599  INTEGER(INTG), INTENT(OUT) :: ERR
1600  TYPE(varying_string), INTENT(OUT) :: ERROR
1601  !Local Variables
1602  INTEGER(INTG) :: GEOMETRIC_MESH_COMPONENT,GEOMETRIC_SCALING_TYPE,NUMBER_OF_DIMENSIONS
1603  TYPE(decomposition_type), POINTER :: GEOMETRIC_DECOMPOSITION
1604  TYPE(field_type), POINTER :: ANALYTIC_FIELD,DEPENDENT_FIELD,GEOMETRIC_FIELD
1605  TYPE(equations_type), POINTER :: EQUATIONS
1606  TYPE(equations_mapping_type), POINTER :: EQUATIONS_MAPPING
1607  TYPE(equations_matrices_type), POINTER :: EQUATIONS_MATRICES
1608  TYPE(varying_string) :: LOCAL_ERROR
1609 
1610  enters("LAPLACE_EQUATION_EQUATION_SET_STANDARD_SETUP",err,error,*999)
1611 
1612  NULLIFY(equations)
1613  NULLIFY(equations_mapping)
1614  NULLIFY(equations_matrices)
1615  NULLIFY(geometric_decomposition)
1616 
1617  IF(ASSOCIATED(equations_set)) THEN
1618  IF(.NOT.ALLOCATED(equations_set%SPECIFICATION)) THEN
1619  CALL flagerror("Equations set specification is not allocated.",err,error,*999)
1620  ELSE IF(SIZE(equations_set%SPECIFICATION,1)/=3) THEN
1621  CALL flagerror("Equations set specification must have three entries for a Laplace type equations set.", &
1622  & err,error,*999)
1623  END IF
1624  IF(equations_set%SPECIFICATION(3)==equations_set_standard_laplace_subtype) THEN
1625  SELECT CASE(equations_set_setup%SETUP_TYPE)
1627  SELECT CASE(equations_set_setup%ACTION_TYPE)
1631  !Do nothing
1632  CASE DEFAULT
1633  local_error="The action type of "//trim(number_to_vstring(equations_set_setup%ACTION_TYPE,"*",err,error))// &
1634  & " for a setup type of "//trim(number_to_vstring(equations_set_setup%SETUP_TYPE,"*",err,error))// &
1635  & " is invalid for a standard Laplace equation."
1636  CALL flagerror(local_error,err,error,*999)
1637  END SELECT
1639  !Do nothing
1641  SELECT CASE(equations_set_setup%ACTION_TYPE)
1643  IF(equations_set%DEPENDENT%DEPENDENT_FIELD_AUTO_CREATED) THEN
1644  !Create the auto created dependent field
1645  CALL field_create_start(equations_set_setup%FIELD_USER_NUMBER,equations_set%REGION,equations_set%DEPENDENT% &
1646  & dependent_field,err,error,*999)
1647  CALL field_label_set(equations_set%DEPENDENT%DEPENDENT_FIELD,"Dependent Field",err,error,*999)
1648  CALL field_type_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_general_type,err,error,*999)
1649  CALL field_dependent_type_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_dependent_type,err,error,*999)
1650  CALL field_mesh_decomposition_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_decomposition,err,error,*999)
1651  CALL field_mesh_decomposition_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,geometric_decomposition, &
1652  & err,error,*999)
1653  CALL field_geometric_field_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,equations_set%GEOMETRY% &
1654  & geometric_field,err,error,*999)
1655  CALL field_number_of_variables_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,2,err,error,*999)
1656  CALL field_variable_types_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,[field_u_variable_type, &
1657  & field_deludeln_variable_type],err,error,*999)
1658  CALL field_variable_label_set(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type,"Phi",err,error,*999)
1659  CALL field_variable_label_set(equations_set%DEPENDENT%DEPENDENT_FIELD,field_deludeln_variable_type,"del Phi/del n", &
1660  & err,error,*999)
1661  CALL field_dimension_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type, &
1662  & field_scalar_dimension_type,err,error,*999)
1663  CALL field_dimension_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_deludeln_variable_type, &
1664  & field_scalar_dimension_type,err,error,*999)
1665  CALL field_data_type_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type, &
1666  & field_dp_type,err,error,*999)
1667  CALL field_data_type_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_deludeln_variable_type, &
1668  & field_dp_type,err,error,*999)
1669  CALL field_number_of_components_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type,1, &
1670  & err,error,*999)
1671  CALL field_number_of_components_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_deludeln_variable_type,1, &
1672  & err,error,*999)
1673  CALL field_component_label_set(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type,1,"Phi",err,error,*999)
1674  CALL field_component_label_set(equations_set%DEPENDENT%DEPENDENT_FIELD,field_deludeln_variable_type,1, &
1675  & "del Phi/del n",err,error,*999)
1676  !Default to the geometric interpolation setup
1677  CALL field_component_mesh_component_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type,1, &
1678  & geometric_mesh_component,err,error,*999)
1679  CALL field_component_mesh_component_set(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type,1, &
1680  & geometric_mesh_component,err,error,*999)
1681  CALL field_component_mesh_component_set(equations_set%DEPENDENT%DEPENDENT_FIELD,field_deludeln_variable_type,1, &
1682  & geometric_mesh_component,err,error,*999)
1683  SELECT CASE(equations_set%SOLUTION_METHOD)
1685  CALL field_component_interpolation_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD, &
1686  & field_u_variable_type,1,field_node_based_interpolation,err,error,*999)
1687  CALL field_component_interpolation_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD, &
1688  & field_deludeln_variable_type,1,field_node_based_interpolation,err,error,*999)
1689  !Default the scaling to the geometric field scaling
1690  CALL field_scaling_type_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_scaling_type,err,error,*999)
1691  CALL field_scaling_type_set(equations_set%DEPENDENT%DEPENDENT_FIELD,geometric_scaling_type,err,error,*999)
1693  CALL flagerror("Not implemented.",err,error,*999)
1695  CALL flagerror("Not implemented.",err,error,*999)
1697  CALL flagerror("Not implemented.",err,error,*999)
1699  CALL flagerror("Not implemented.",err,error,*999)
1701  CALL flagerror("Not implemented.",err,error,*999)
1702  CASE DEFAULT
1703  local_error="The solution method of "//trim(number_to_vstring(equations_set%SOLUTION_METHOD,"*",err,error))// &
1704  & " is invalid."
1705  CALL flagerror(local_error,err,error,*999)
1706  END SELECT
1707  ELSE
1708  !Check the user specified field
1709  CALL field_type_check(equations_set_setup%FIELD,field_general_type,err,error,*999)
1710  CALL field_dependent_type_check(equations_set_setup%FIELD,field_dependent_type,err,error,*999)
1711  CALL field_number_of_variables_check(equations_set_setup%FIELD,2,err,error,*999)
1712  CALL field_variable_types_check(equations_set_setup%FIELD,[field_u_variable_type,field_deludeln_variable_type], &
1713  & err,error,*999)
1714  CALL field_dimension_check(equations_set_setup%FIELD,field_u_variable_type,field_scalar_dimension_type,err,error,*999)
1715  CALL field_dimension_check(equations_set_setup%FIELD,field_deludeln_variable_type,field_scalar_dimension_type, &
1716  & err,error,*999)
1717  CALL field_data_type_check(equations_set_setup%FIELD,field_u_variable_type,field_dp_type,err,error,*999)
1718  CALL field_data_type_check(equations_set_setup%FIELD,field_deludeln_variable_type,field_dp_type,err,error,*999)
1719  CALL field_number_of_components_check(equations_set_setup%FIELD,field_u_variable_type,1,err,error,*999)
1720  CALL field_number_of_components_check(equations_set_setup%FIELD,field_deludeln_variable_type,1,err,error,*999)
1721  SELECT CASE(equations_set%SOLUTION_METHOD)
1723  CALL field_component_interpolation_check(equations_set_setup%FIELD,field_u_variable_type,1, &
1724  & field_node_based_interpolation,err,error,*999)
1725  CALL field_component_interpolation_check(equations_set_setup%FIELD,field_deludeln_variable_type,1, &
1726  & field_node_based_interpolation,err,error,*999)
1728  CALL flagerror("Not implemented.",err,error,*999)
1730  CALL flagerror("Not implemented.",err,error,*999)
1732  CALL flagerror("Not implemented.",err,error,*999)
1734  CALL flagerror("Not implemented.",err,error,*999)
1736  CALL flagerror("Not implemented.",err,error,*999)
1737  CASE DEFAULT
1738  local_error="The solution method of "//trim(number_to_vstring(equations_set%SOLUTION_METHOD,"*",err,error))// &
1739  & " is invalid."
1740  CALL flagerror(local_error,err,error,*999)
1741  END SELECT
1742  ENDIF
1744  IF(equations_set%DEPENDENT%DEPENDENT_FIELD_AUTO_CREATED) THEN
1745  CALL field_create_finish(equations_set%DEPENDENT%DEPENDENT_FIELD,err,error,*999)
1746  ENDIF
1747  CASE DEFAULT
1748  local_error="The action type of "//trim(number_to_vstring(equations_set_setup%ACTION_TYPE,"*",err,error))// &
1749  & " for a setup type of "//trim(number_to_vstring(equations_set_setup%SETUP_TYPE,"*",err,error))// &
1750  & " is invalid for a standard Laplace equation"
1751  CALL flagerror(local_error,err,error,*999)
1752  END SELECT
1754  SELECT CASE(equations_set_setup%ACTION_TYPE)
1756  !Do nothing
1758  !Do nothing
1759  CASE DEFAULT
1760  local_error="The action type of "//trim(number_to_vstring(equations_set_setup%ACTION_TYPE,"*",err,error))// &
1761  & " for a setup type of "//trim(number_to_vstring(equations_set_setup%SETUP_TYPE,"*",err,error))// &
1762  & " is invalid for a standard Laplace equation."
1763  CALL flagerror(local_error,err,error,*999)
1764  END SELECT
1766  SELECT CASE(equations_set_setup%ACTION_TYPE)
1768  !Do nothing
1770  !Do nothing
1771  CASE DEFAULT
1772  local_error="The action type of "//trim(number_to_vstring(equations_set_setup%ACTION_TYPE,"*",err,error))// &
1773  & " for a setup type of "//trim(number_to_vstring(equations_set_setup%SETUP_TYPE,"*",err,error))// &
1774  & " is invalid for a standard Laplace equation."
1775  CALL flagerror(local_error,err,error,*999)
1776  END SELECT
1778  SELECT CASE(equations_set_setup%ACTION_TYPE)
1780  IF(equations_set%DEPENDENT%DEPENDENT_FINISHED) THEN
1781  dependent_field=>equations_set%DEPENDENT%DEPENDENT_FIELD
1782  IF(ASSOCIATED(dependent_field)) THEN
1783  geometric_field=>equations_set%GEOMETRY%GEOMETRIC_FIELD
1784  IF(ASSOCIATED(geometric_field)) THEN
1785  CALL field_number_of_components_get(geometric_field,field_u_variable_type,number_of_dimensions,err,error,*999)
1786  SELECT CASE(equations_set_setup%ANALYTIC_FUNCTION_TYPE)
1788  !Check that we are in 2D
1789  IF(number_of_dimensions/=2) THEN
1790  local_error="The number of geometric dimensions of "// &
1791  & trim(number_to_vstring(number_of_dimensions,"*",err,error))// &
1792  & " is invalid. The analytic function type of "// &
1793  & trim(number_to_vstring(equations_set_setup%ANALYTIC_FUNCTION_TYPE,"*",err,error))// &
1794  & " requires that there be 2 geometric dimensions."
1795  CALL flagerror(local_error,err,error,*999)
1796  ENDIF
1797  !Create analytic field if required
1798  !Set analtyic function type
1799  equations_set%ANALYTIC%ANALYTIC_FUNCTION_TYPE=equations_set_laplace_equation_two_dim_1
1801  !Check that we are in 2D
1802  IF(number_of_dimensions/=2) THEN
1803  local_error="The number of geometric dimensions of "// &
1804  & trim(number_to_vstring(number_of_dimensions,"*",err,error))// &
1805  & " is invalid. The analytic function type of "// &
1806  & trim(number_to_vstring(equations_set_setup%ANALYTIC_FUNCTION_TYPE,"*",err,error))// &
1807  & " requires that there be 2 geometric dimensions."
1808  CALL flagerror(local_error,err,error,*999)
1809  ENDIF
1810  !Create analytic field if required
1811  !Set analytic function type
1812  equations_set%ANALYTIC%ANALYTIC_FUNCTION_TYPE=equations_set_laplace_equation_two_dim_2
1814  !Check that we are in 3D
1815  IF(number_of_dimensions/=3) THEN
1816  local_error="The number of geometric dimensions of "// &
1817  & trim(number_to_vstring(number_of_dimensions,"*",err,error))// &
1818  & " is invalid. The analytic function type of "// &
1819  & trim(number_to_vstring(equations_set_setup%ANALYTIC_FUNCTION_TYPE,"*",err,error))// &
1820  & " requires that there be 3 geometric dimensions."
1821  CALL flagerror(local_error,err,error,*999)
1822  ENDIF
1823  !Create analytic field if required
1824  !Set analytic function type
1825  equations_set%ANALYTIC%ANALYTIC_FUNCTION_TYPE=equations_set_laplace_equation_three_dim_1
1827  !Check that we are in 3D
1828  IF(number_of_dimensions/=3) THEN
1829  local_error="The number of geometric dimensions of "// &
1830  & trim(number_to_vstring(number_of_dimensions,"*",err,error))// &
1831  & " is invalid. The analytic function type of "// &
1832  & trim(number_to_vstring(equations_set_setup%ANALYTIC_FUNCTION_TYPE,"*",err,error))// &
1833  & " requires that there be 3 geometric dimensions."
1834  CALL flagerror(local_error,err,error,*999)
1835  ENDIF
1836  !Create analytic field if required
1837  !Set analytic function type
1838  equations_set%ANALYTIC%ANALYTIC_FUNCTION_TYPE=equations_set_laplace_equation_three_dim_2
1839  CASE DEFAULT
1840  local_error="The specified analytic function type of "// &
1841  & trim(number_to_vstring(equations_set_setup%ANALYTIC_FUNCTION_TYPE,"*",err,error))// &
1842  & " is invalid for a standard Laplace equation."
1843  CALL flagerror(local_error,err,error,*999)
1844  END SELECT
1845  ELSE
1846  CALL flagerror("Equations set geometric field is not associated.",err,error,*999)
1847  ENDIF
1848  ELSE
1849  CALL flagerror("Equations set dependent field is not associated.",err,error,*999)
1850  ENDIF
1851  ELSE
1852  CALL flagerror("Equations set dependent field has not been finished.",err,error,*999)
1853  ENDIF
1855  IF(ASSOCIATED(equations_set%ANALYTIC)) THEN
1856  analytic_field=>equations_set%ANALYTIC%ANALYTIC_FIELD
1857  IF(ASSOCIATED(analytic_field)) THEN
1858  IF(equations_set%ANALYTIC%ANALYTIC_FIELD_AUTO_CREATED) THEN
1859  CALL field_create_finish(equations_set%DEPENDENT%DEPENDENT_FIELD,err,error,*999)
1860  ENDIF
1861  ENDIF
1862  ELSE
1863  CALL flagerror("Equations set analytic is not associated.",err,error,*999)
1864  ENDIF
1865  CASE DEFAULT
1866  local_error="The action type of "//trim(number_to_vstring(equations_set_setup%ACTION_TYPE,"*",err,error))// &
1867  & " for a setup type of "//trim(number_to_vstring(equations_set_setup%SETUP_TYPE,"*",err,error))// &
1868  & " is invalid for a standard Laplace equation."
1869  CALL flagerror(local_error,err,error,*999)
1870  END SELECT
1872  SELECT CASE(equations_set_setup%ACTION_TYPE)
1874  IF(equations_set%DEPENDENT%DEPENDENT_FINISHED) THEN
1875  CALL equations_create_start(equations_set,equations,err,error,*999)
1876  CALL equations_linearity_type_set(equations,equations_linear,err,error,*999)
1877  CALL equations_time_dependence_type_set(equations,equations_static,err,error,*999)
1878  ELSE
1879  CALL flagerror("Equations set dependent field has not been finished.",err,error,*999)
1880  ENDIF
1882  SELECT CASE(equations_set%SOLUTION_METHOD)
1884  !Finish the equations creation
1885  CALL equations_set_equations_get(equations_set,equations,err,error,*999)
1886  CALL equations_create_finish(equations,err,error,*999)
1887  !Create the equations mapping.
1888  CALL equations_mapping_create_start(equations,equations_mapping,err,error,*999)
1889  CALL equationsmapping_linearmatricesnumberset(equations_mapping,1,err,error,*999)
1890  CALL equationsmapping_linearmatricesvariabletypesset(equations_mapping,[field_u_variable_type], &
1891  & err,error,*999)
1892  CALL equations_mapping_rhs_variable_type_set(equations_mapping,field_deludeln_variable_type,err,error,*999)
1893  CALL equations_mapping_create_finish(equations_mapping,err,error,*999)
1894  !Create the equations matrices
1895  CALL equations_matrices_create_start(equations,equations_matrices,err,error,*999)
1896  SELECT CASE(equations%SPARSITY_TYPE)
1899  & err,error,*999)
1902  & err,error,*999)
1904  & err,error,*999)
1905  CASE DEFAULT
1906  local_error="The equations matrices sparsity type of "// &
1907  & trim(number_to_vstring(equations%SPARSITY_TYPE,"*",err,error))//" is invalid."
1908  CALL flagerror(local_error,err,error,*999)
1909  END SELECT
1910  CALL equations_matrices_create_finish(equations_matrices,err,error,*999)
1912  CALL flagerror("Not implemented.",err,error,*999)
1914  CALL flagerror("Not implemented.",err,error,*999)
1916  CALL flagerror("Not implemented.",err,error,*999)
1918  CALL flagerror("Not implemented.",err,error,*999)
1920  CALL flagerror("Not implemented.",err,error,*999)
1921  CASE DEFAULT
1922  local_error="The solution method of "//trim(number_to_vstring(equations_set%SOLUTION_METHOD,"*",err,error))// &
1923  & " is invalid."
1924  CALL flagerror(local_error,err,error,*999)
1925  END SELECT
1926  CASE DEFAULT
1927  local_error="The action type of "//trim(number_to_vstring(equations_set_setup%ACTION_TYPE,"*",err,error))// &
1928  & " for a setup type of "//trim(number_to_vstring(equations_set_setup%SETUP_TYPE,"*",err,error))// &
1929  & " is invalid for a standard Laplace equation."
1930  CALL flagerror(local_error,err,error,*999)
1931  END SELECT
1932  CASE DEFAULT
1933  local_error="The setup type of "//trim(number_to_vstring(equations_set_setup%SETUP_TYPE,"*",err,error))// &
1934  & " is invalid for a standard Laplace equation."
1935  CALL flagerror(local_error,err,error,*999)
1936  END SELECT
1937  ELSE
1938  local_error="The equations set subtype of "//trim(number_to_vstring(equations_set%SPECIFICATION(3),"*",err,error))// &
1939  & " does not equal a standard Laplace equation subtype."
1940  CALL flagerror(local_error,err,error,*999)
1941  ENDIF
1942  ELSE
1943  CALL flagerror("Equations set is not associated.",err,error,*999)
1944  ENDIF
1945 
1946  exits("Laplace_EquationsSetStandardSetup")
1947  RETURN
1948 999 errorsexits("Laplace_EquationsSetStandardSetup",err,error)
1949  RETURN 1
1950 
1951  END SUBROUTINE laplace_equationssetstandardsetup
1952 
1953  !
1954  !================================================================================================================================
1955  !
1956 
1958  SUBROUTINE laplace_equationssetgeneralisedsetup(EQUATIONS_SET,EQUATIONS_SET_SETUP,ERR,ERROR,*)
1960  !Argument variables
1961  TYPE(equations_set_type), POINTER :: EQUATIONS_SET
1962  TYPE(equations_set_setup_type), INTENT(INOUT) :: EQUATIONS_SET_SETUP
1963  INTEGER(INTG), INTENT(OUT) :: ERR
1964  TYPE(varying_string), INTENT(OUT) :: ERROR
1965  !Local Variables
1966  INTEGER(INTG) :: GEOMETRIC_MESH_COMPONENT,GEOMETRIC_SCALING_TYPE,NUMBER_OF_DIMENSIONS,NUMBER_OF_MATERIALS_COMPONENTS
1967  INTEGER(INTG) :: component_idx
1968  TYPE(decomposition_type), POINTER :: GEOMETRIC_DECOMPOSITION
1969  TYPE(field_type), POINTER :: ANALYTIC_FIELD,DEPENDENT_FIELD,GEOMETRIC_FIELD
1970  TYPE(equations_type), POINTER :: EQUATIONS
1971  TYPE(equations_mapping_type), POINTER :: EQUATIONS_MAPPING
1972  TYPE(equations_matrices_type), POINTER :: EQUATIONS_MATRICES
1973  TYPE(varying_string) :: LOCAL_ERROR
1974 
1975  enters("Laplace_EquationsSetGeneralisedSetup",err,error,*999)
1976 
1977  NULLIFY(equations)
1978  NULLIFY(equations_mapping)
1979  NULLIFY(equations_matrices)
1980  NULLIFY(geometric_decomposition)
1981 
1982  IF(ASSOCIATED(equations_set)) THEN
1983  IF(.NOT.ALLOCATED(equations_set%SPECIFICATION)) THEN
1984  CALL flagerror("Equations set specification is not allocated.",err,error,*999)
1985  ELSE IF(SIZE(equations_set%SPECIFICATION,1)/=3) THEN
1986  CALL flagerror("Equations set specification must have three entries for a Laplace type equations set.", &
1987  & err,error,*999)
1988  END IF
1989  IF(equations_set%SPECIFICATION(3)==equations_set_generalised_laplace_subtype) THEN
1990  SELECT CASE(equations_set_setup%SETUP_TYPE)
1991  !INITIAL
1993  SELECT CASE(equations_set_setup%ACTION_TYPE)
1997  !Do nothing
1998  CASE DEFAULT
1999  local_error="The action type of "//trim(number_to_vstring(equations_set_setup%ACTION_TYPE,"*",err,error))// &
2000  & " for a setup type of "//trim(number_to_vstring(equations_set_setup%SETUP_TYPE,"*",err,error))// &
2001  & " is invalid for a generalised Laplace equation."
2002  CALL flagerror(local_error,err,error,*999)
2003  END SELECT
2004  !GEOMETRY
2006  !Do nothing
2007  !DEPENDENT
2009  SELECT CASE(equations_set_setup%ACTION_TYPE)
2010  !start action
2012  IF(equations_set%DEPENDENT%DEPENDENT_FIELD_AUTO_CREATED) THEN
2013  !Create the auto created dependent field
2014  CALL field_create_start(equations_set_setup%FIELD_USER_NUMBER,equations_set%REGION,equations_set%DEPENDENT% &
2015  & dependent_field,err,error,*999)
2016  CALL field_label_set(equations_set%DEPENDENT%DEPENDENT_FIELD,"Dependent Field",err,error,*999)
2017  CALL field_type_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_general_type,err,error,*999)
2018  CALL field_dependent_type_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_dependent_type,err,error,*999)
2019  CALL field_mesh_decomposition_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_decomposition,err,error,*999)
2020  CALL field_mesh_decomposition_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,geometric_decomposition, &
2021  & err,error,*999)
2022  CALL field_geometric_field_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,equations_set%GEOMETRY% &
2023  & geometric_field,err,error,*999)
2024  CALL field_number_of_variables_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,2,err,error,*999)
2025  CALL field_variable_types_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,[field_u_variable_type, &
2026  & field_deludeln_variable_type],err,error,*999)
2027 
2028  CALL field_variable_label_set(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type,"Phi",err,error,*999)
2029  CALL field_variable_label_set(equations_set%DEPENDENT%DEPENDENT_FIELD,field_deludeln_variable_type,"del Phi/del n", &
2030  & err,error,*999)
2031 
2032  CALL field_dimension_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type, &
2033  & field_scalar_dimension_type,err,error,*999)
2034  CALL field_dimension_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_deludeln_variable_type, &
2035  & field_scalar_dimension_type,err,error,*999)
2036 
2037  CALL field_data_type_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type, &
2038  & field_dp_type,err,error,*999)
2039  CALL field_data_type_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_deludeln_variable_type, &
2040  & field_dp_type,err,error,*999)
2041 
2042  CALL field_number_of_components_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type,1, &
2043  & err,error,*999)
2044  CALL field_number_of_components_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_deludeln_variable_type,1, &
2045  & err,error,*999)
2046 
2047  CALL field_component_label_set(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type,1,"Phi",err,error,*999)
2048  CALL field_component_label_set(equations_set%DEPENDENT%DEPENDENT_FIELD,field_deludeln_variable_type,1, &
2049  & "del Phi/del n",err,error,*999)
2050  !Default to the geometric interpolation setup
2051  CALL field_component_mesh_component_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type,1, &
2052  & geometric_mesh_component,err,error,*999)
2053 
2054  CALL field_component_mesh_component_set(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type,1, &
2055  & geometric_mesh_component,err,error,*999)
2056  CALL field_component_mesh_component_set(equations_set%DEPENDENT%DEPENDENT_FIELD,field_deludeln_variable_type,1, &
2057  & geometric_mesh_component,err,error,*999)
2058  SELECT CASE(equations_set%SOLUTION_METHOD)
2060  CALL field_component_interpolation_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD, &
2061  & field_u_variable_type,1,field_node_based_interpolation,err,error,*999)
2062  CALL field_component_interpolation_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD, &
2063  & field_deludeln_variable_type,1,field_node_based_interpolation,err,error,*999)
2064  !Default the scaling to the geometric field scaling
2065  CALL field_scaling_type_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_scaling_type,err,error,*999)
2066  CALL field_scaling_type_set(equations_set%DEPENDENT%DEPENDENT_FIELD,geometric_scaling_type,err,error,*999)
2068  CALL flagerror("Not implemented.",err,error,*999)
2070  CALL flagerror("Not implemented.",err,error,*999)
2072  CALL flagerror("Not implemented.",err,error,*999)
2074  CALL flagerror("Not implemented.",err,error,*999)
2076  CALL flagerror("Not implemented.",err,error,*999)
2077  CASE DEFAULT
2078  local_error="The solution method of "//trim(number_to_vstring(equations_set%SOLUTION_METHOD,"*",err,error))// &
2079  & " is invalid."
2080  CALL flagerror(local_error,err,error,*999)
2081  END SELECT
2082  ELSE
2083  !Check the user specified field
2084  CALL field_type_check(equations_set_setup%FIELD,field_general_type,err,error,*999)
2085  CALL field_dependent_type_check(equations_set_setup%FIELD,field_dependent_type,err,error,*999)
2086  CALL field_number_of_variables_check(equations_set_setup%FIELD,2,err,error,*999)
2087  CALL field_variable_types_check(equations_set_setup%FIELD,[field_u_variable_type,field_deludeln_variable_type], &
2088  & err,error,*999)
2089  CALL field_dimension_check(equations_set_setup%FIELD,field_u_variable_type,field_scalar_dimension_type,err,error,*999)
2090  CALL field_dimension_check(equations_set_setup%FIELD,field_deludeln_variable_type,field_scalar_dimension_type, &
2091  & err,error,*999)
2092  CALL field_data_type_check(equations_set_setup%FIELD,field_u_variable_type,field_dp_type,err,error,*999)
2093  CALL field_data_type_check(equations_set_setup%FIELD,field_deludeln_variable_type,field_dp_type,err,error,*999)
2094  CALL field_number_of_components_check(equations_set_setup%FIELD,field_u_variable_type,1,err,error,*999)
2095  CALL field_number_of_components_check(equations_set_setup%FIELD,field_deludeln_variable_type,1,err,error,*999)
2096  SELECT CASE(equations_set%SOLUTION_METHOD)
2098  CALL field_component_interpolation_check(equations_set_setup%FIELD,field_u_variable_type,1, &
2099  & field_node_based_interpolation,err,error,*999)
2100  CALL field_component_interpolation_check(equations_set_setup%FIELD,field_deludeln_variable_type,1, &
2101  & field_node_based_interpolation,err,error,*999)
2103  CALL flagerror("Not implemented.",err,error,*999)
2105  CALL flagerror("Not implemented.",err,error,*999)
2107  CALL flagerror("Not implemented.",err,error,*999)
2109  CALL flagerror("Not implemented.",err,error,*999)
2111  CALL flagerror("Not implemented.",err,error,*999)
2112  CASE DEFAULT
2113  local_error="The solution method of "//trim(number_to_vstring(equations_set%SOLUTION_METHOD,"*",err,error))// &
2114  & " is invalid."
2115  CALL flagerror(local_error,err,error,*999)
2116  END SELECT
2117  ENDIF
2118  !finish action
2120  IF(equations_set%DEPENDENT%DEPENDENT_FIELD_AUTO_CREATED) THEN
2121  CALL field_create_finish(equations_set%DEPENDENT%DEPENDENT_FIELD,err,error,*999)
2122  ENDIF
2123  CASE DEFAULT
2124  local_error="The action type of "//trim(number_to_vstring(equations_set_setup%ACTION_TYPE,"*",err,error))// &
2125  & " for a setup type of "//trim(number_to_vstring(equations_set_setup%SETUP_TYPE,"*",err,error))// &
2126  & " is invalid for a generalised Laplace equation"
2127  CALL flagerror(local_error,err,error,*999)
2128  END SELECT
2129  !MATERIAL
2131  SELECT CASE(equations_set_setup%ACTION_TYPE)
2132  !start action
2134  IF(equations_set%MATERIALS%MATERIALS_FIELD_AUTO_CREATED) THEN
2135  !Create the auto created materials field
2136  CALL field_create_start(equations_set_setup%FIELD_USER_NUMBER,equations_set%REGION,equations_set%MATERIALS% &
2137  & materials_field,err,error,*999)
2138  CALL field_label_set(equations_set%MATERIALS%MATERIALS_FIELD,"Materials Field",err,error,*999)
2139  CALL field_type_set_and_lock(equations_set%MATERIALS%MATERIALS_FIELD,field_material_type,err,error,*999)
2140  CALL field_mesh_decomposition_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_decomposition,err,error,*999)
2141  CALL field_mesh_decomposition_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,geometric_decomposition, &
2142  & err,error,*999)
2143  CALL field_geometric_field_set_and_lock(equations_set%MATERIALS%MATERIALS_FIELD,equations_set%GEOMETRY% &
2144  & geometric_field,err,error,*999)
2145  CALL field_number_of_variables_set_and_lock(equations_set%MATERIALS%MATERIALS_FIELD,1,err,error,*999)
2146  CALL field_variable_types_set_and_lock(equations_set%MATERIALS%MATERIALS_FIELD,[field_u_variable_type], &
2147  & err,error,*999)
2148  CALL field_variable_label_set(equations_set%MATERIALS%MATERIALS_FIELD,field_u_variable_type,"conductivity",err, &
2149  & error,*999)
2150  CALL field_number_of_components_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
2151  & number_of_dimensions,err,error,*999)
2152  IF(number_of_dimensions==1) THEN
2153  number_of_materials_components=1
2154  ELSEIF(number_of_dimensions==2) THEN
2155  number_of_materials_components=3
2156  ELSEIF(number_of_dimensions==3) THEN
2157  number_of_materials_components=6
2158  ENDIF
2159  !Set the number of materials components
2160  CALL field_number_of_components_set_and_lock(equations_set%MATERIALS%MATERIALS_FIELD,field_u_variable_type, &
2161  & number_of_materials_components,err,error,*999)
2162  CALL field_data_type_set_and_lock(equations_set%MATERIALS%MATERIALS_FIELD,field_u_variable_type, &
2163  & field_dp_type,err,error,*999)
2164  !Default the materials components to the first geometric component
2165  CALL field_component_mesh_component_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type,1, &
2166  & geometric_mesh_component,err,error,*999)
2167  DO component_idx=1,number_of_materials_components
2168  CALL field_component_mesh_component_set(equations_set%MATERIALS%MATERIALS_FIELD,field_u_variable_type,1, &
2169  & geometric_mesh_component,err,error,*999)
2170  ENDDO !components_idx
2171 
2172  SELECT CASE(equations_set%SOLUTION_METHOD)
2174  DO component_idx=1,number_of_materials_components
2175  CALL field_component_interpolation_set_and_lock(equations_set%MATERIALS%MATERIALS_FIELD, &
2176  & field_u_variable_type,1,field_node_based_interpolation,err,error,*999)
2177  ENDDO !component_idx
2178  !Default the scaling to the geometric field scaling
2179  CALL field_scaling_type_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_scaling_type,err,error,*999)
2180  CALL field_scaling_type_set(equations_set%MATERIALS%MATERIALS_FIELD,geometric_scaling_type,err,error,*999)
2182  CALL flagerror("Not implemented.",err,error,*999)
2184  CALL flagerror("Not implemented.",err,error,*999)
2186  CALL flagerror("Not implemented.",err,error,*999)
2188  CALL flagerror("Not implemented.",err,error,*999)
2190  CALL flagerror("Not implemented.",err,error,*999)
2191  CASE DEFAULT
2192  local_error="The solution method of "//trim(number_to_vstring(equations_set%SOLUTION_METHOD,"*",err,error))// &
2193  & " is invalid."
2194  CALL flagerror(local_error,err,error,*999)
2195  END SELECT
2196  ELSE
2197  !Check the user specified field
2198  CALL field_type_check(equations_set_setup%FIELD,field_material_type,err,error,*999)
2199  CALL field_number_of_variables_check(equations_set_setup%FIELD,1,err,error,*999)
2200  CALL field_variable_types_check(equations_set_setup%FIELD,[field_u_variable_type],err,error,*999)
2201  CALL field_data_type_check(equations_set_setup%FIELD,field_u_variable_type,field_dp_type,err,error,*999)
2202  CALL field_number_of_components_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
2203  & number_of_dimensions,err,error,*999)
2204  IF(number_of_dimensions==1) THEN
2205  CALL field_number_of_components_check(equations_set_setup%FIELD,field_u_variable_type,1,err, &
2206  & error,*999)
2207  ELSEIF(number_of_dimensions==2) THEN
2208  CALL field_number_of_components_check(equations_set_setup%FIELD,field_u_variable_type,3,err, &
2209  & error,*999)
2210  ELSEIF(number_of_dimensions==3) THEN
2211  CALL field_number_of_components_check(equations_set_setup%FIELD,field_u_variable_type,6,err, &
2212  & error,*999)
2213  ENDIF
2214  SELECT CASE(equations_set%SOLUTION_METHOD)
2216  !do nothing
2218  CALL flagerror("Not implemented.",err,error,*999)
2220  CALL flagerror("Not implemented.",err,error,*999)
2222  CALL flagerror("Not implemented.",err,error,*999)
2224  CALL flagerror("Not implemented.",err,error,*999)
2226  CALL flagerror("Not implemented.",err,error,*999)
2227  CASE DEFAULT
2228  local_error="The solution method of "//trim(number_to_vstring(equations_set%SOLUTION_METHOD,"*",err,error))// &
2229  & " is invalid."
2230  CALL flagerror(local_error,err,error,*999)
2231  END SELECT
2232  ENDIF
2233  !finish action
2235  IF(equations_set%MATERIALS%MATERIALS_FIELD_AUTO_CREATED) THEN
2236  CALL field_create_finish(equations_set%MATERIALS%MATERIALS_FIELD,err,error,*999)
2237  ENDIF
2238  CASE DEFAULT
2239  local_error="The action type of "//trim(number_to_vstring(equations_set_setup%ACTION_TYPE,"*",err,error))// &
2240  & " for a setup type of "//trim(number_to_vstring(equations_set_setup%SETUP_TYPE,"*",err,error))// &
2241  & " is invalid for a generalised Laplace equation."
2242  CALL flagerror(local_error,err,error,*999)
2243  END SELECT
2244  !SOURCE
2246  SELECT CASE(equations_set_setup%ACTION_TYPE)
2248  !Do nothing
2250  !Do nothing
2251  CASE DEFAULT
2252  local_error="The action type of "//trim(number_to_vstring(equations_set_setup%ACTION_TYPE,"*",err,error))// &
2253  & " for a setup type of "//trim(number_to_vstring(equations_set_setup%SETUP_TYPE,"*",err,error))// &
2254  & " is invalid for a generalised Laplace equation."
2255  CALL flagerror(local_error,err,error,*999)
2256  END SELECT
2257  !ANALYTIC
2259  SELECT CASE(equations_set_setup%ACTION_TYPE)
2260  !start action
2262  IF(equations_set%DEPENDENT%DEPENDENT_FINISHED) THEN
2263  dependent_field=>equations_set%DEPENDENT%DEPENDENT_FIELD
2264  IF(ASSOCIATED(dependent_field)) THEN
2265  geometric_field=>equations_set%GEOMETRY%GEOMETRIC_FIELD
2266  IF(ASSOCIATED(geometric_field)) THEN
2267  CALL field_number_of_components_get(geometric_field,field_u_variable_type,number_of_dimensions,err,error,*999)
2268  SELECT CASE(equations_set_setup%ANALYTIC_FUNCTION_TYPE)
2270  !Check that we are in 2D
2271  IF(number_of_dimensions/=2) THEN
2272  local_error="The number of geometric dimensions of "// &
2273  & trim(number_to_vstring(number_of_dimensions,"*",err,error))// &
2274  & " is invalid. The analytic function type of "// &
2275  & trim(number_to_vstring(equations_set_setup%ANALYTIC_FUNCTION_TYPE,"*",err,error))// &
2276  & " requires that there be 2 geometric dimensions."
2277  CALL flagerror(local_error,err,error,*999)
2278  ENDIF
2279  !Create analytic field if required
2280  !Set analtyic function type
2281  equations_set%ANALYTIC%ANALYTIC_FUNCTION_TYPE=equations_set_laplace_equation_two_dim_1
2283  !Check that we are in 2D
2284  IF(number_of_dimensions/=2) THEN
2285  local_error="The number of geometric dimensions of "// &
2286  & trim(number_to_vstring(number_of_dimensions,"*",err,error))// &
2287  & " is invalid. The analytic function type of "// &
2288  & trim(number_to_vstring(equations_set_setup%ANALYTIC_FUNCTION_TYPE,"*",err,error))// &
2289  & " requires that there be 2 geometric dimensions."
2290  CALL flagerror(local_error,err,error,*999)
2291  ENDIF
2292  !Create analytic field if required
2293  !Set analytic function type
2294  equations_set%ANALYTIC%ANALYTIC_FUNCTION_TYPE=equations_set_laplace_equation_two_dim_2
2296  !Check that we are in 3D
2297  IF(number_of_dimensions/=3) THEN
2298  local_error="The number of geometric dimensions of "// &
2299  & trim(number_to_vstring(number_of_dimensions,"*",err,error))// &
2300  & " is invalid. The analytic function type of "// &
2301  & trim(number_to_vstring(equations_set_setup%ANALYTIC_FUNCTION_TYPE,"*",err,error))// &
2302  & " requires that there be 3 geometric dimensions."
2303  CALL flagerror(local_error,err,error,*999)
2304  ENDIF
2305  !Create analytic field if required
2306  !Set analytic function type
2307  equations_set%ANALYTIC%ANALYTIC_FUNCTION_TYPE=equations_set_laplace_equation_three_dim_1
2309  !Check that we are in 3D
2310  IF(number_of_dimensions/=3) THEN
2311  local_error="The number of geometric dimensions of "// &
2312  & trim(number_to_vstring(number_of_dimensions,"*",err,error))// &
2313  & " is invalid. The analytic function type of "// &
2314  & trim(number_to_vstring(equations_set_setup%ANALYTIC_FUNCTION_TYPE,"*",err,error))// &
2315  & " requires that there be 3 geometric dimensions."
2316  CALL flagerror(local_error,err,error,*999)
2317  ENDIF
2318  !Create analytic field if required
2319  !Set analytic function type
2320  equations_set%ANALYTIC%ANALYTIC_FUNCTION_TYPE=equations_set_laplace_equation_three_dim_2
2321  CASE DEFAULT
2322  local_error="The specified analytic function type of "// &
2323  & trim(number_to_vstring(equations_set_setup%ANALYTIC_FUNCTION_TYPE,"*",err,error))// &
2324  & " is invalid for a generalised Laplace equation."
2325  CALL flagerror(local_error,err,error,*999)
2326  END SELECT
2327  ELSE
2328  CALL flagerror("Equations set geometric field is not associated.",err,error,*999)
2329  ENDIF
2330  ELSE
2331  CALL flagerror("Equations set dependent field is not associated.",err,error,*999)
2332  ENDIF
2333  ELSE
2334  CALL flagerror("Equations set dependent field has not been finished.",err,error,*999)
2335  ENDIF
2336  !finish action
2338  IF(ASSOCIATED(equations_set%ANALYTIC)) THEN
2339  analytic_field=>equations_set%ANALYTIC%ANALYTIC_FIELD
2340  IF(ASSOCIATED(analytic_field)) THEN
2341  IF(equations_set%ANALYTIC%ANALYTIC_FIELD_AUTO_CREATED) THEN
2342  CALL field_create_finish(equations_set%DEPENDENT%DEPENDENT_FIELD,err,error,*999)
2343  ENDIF
2344  ENDIF
2345  ELSE
2346  CALL flagerror("Equations set analytic is not associated.",err,error,*999)
2347  ENDIF
2348  CASE DEFAULT
2349  local_error="The action type of "//trim(number_to_vstring(equations_set_setup%ACTION_TYPE,"*",err,error))// &
2350  & " for a setup type of "//trim(number_to_vstring(equations_set_setup%SETUP_TYPE,"*",err,error))// &
2351  & " is invalid for a generalised Laplace equation."
2352  CALL flagerror(local_error,err,error,*999)
2353  END SELECT
2354  !EQUATIONS
2356  SELECT CASE(equations_set_setup%ACTION_TYPE)
2357  !start action
2359  IF(equations_set%DEPENDENT%DEPENDENT_FINISHED) THEN
2360  CALL equations_create_start(equations_set,equations,err,error,*999)
2361  CALL equations_linearity_type_set(equations,equations_linear,err,error,*999)
2362  CALL equations_time_dependence_type_set(equations,equations_static,err,error,*999)
2363  ELSE
2364  CALL flagerror("Equations set dependent field has not been finished.",err,error,*999)
2365  ENDIF
2366  !finish action
2368  SELECT CASE(equations_set%SOLUTION_METHOD)
2370  !Finish the equations creation
2371  CALL equations_set_equations_get(equations_set,equations,err,error,*999)
2372  CALL equations_create_finish(equations,err,error,*999)
2373  !Create the equations mapping.
2374  CALL equations_mapping_create_start(equations,equations_mapping,err,error,*999)
2375  CALL equationsmapping_linearmatricesnumberset(equations_mapping,1,err,error,*999)
2376  CALL equationsmapping_linearmatricesvariabletypesset(equations_mapping,[field_u_variable_type], &
2377  & err,error,*999)
2378  CALL equations_mapping_rhs_variable_type_set(equations_mapping,field_deludeln_variable_type,err,error,*999)
2379  CALL equations_mapping_create_finish(equations_mapping,err,error,*999)
2380  !Create the equations matrices
2381  CALL equations_matrices_create_start(equations,equations_matrices,err,error,*999)
2382  SELECT CASE(equations%SPARSITY_TYPE)
2385  & err,error,*999)
2388  & err,error,*999)
2390  & err,error,*999)
2391  CASE DEFAULT
2392  local_error="The equations matrices sparsity type of "// &
2393  & trim(number_to_vstring(equations%SPARSITY_TYPE,"*",err,error))//" is invalid."
2394  CALL flagerror(local_error,err,error,*999)
2395  END SELECT
2396  CALL equations_matrices_create_finish(equations_matrices,err,error,*999)
2398  CALL flagerror("Not implemented.",err,error,*999)
2400  CALL flagerror("Not implemented.",err,error,*999)
2402  CALL flagerror("Not implemented.",err,error,*999)
2404  CALL flagerror("Not implemented.",err,error,*999)
2406  CALL flagerror("Not implemented.",err,error,*999)
2407  CASE DEFAULT
2408  local_error="The solution method of "//trim(number_to_vstring(equations_set%SOLUTION_METHOD,"*",err,error))// &
2409  & " is invalid."
2410  CALL flagerror(local_error,err,error,*999)
2411  END SELECT
2412  CASE DEFAULT
2413  local_error="The action type of "//trim(number_to_vstring(equations_set_setup%ACTION_TYPE,"*",err,error))// &
2414  & " for a setup type of "//trim(number_to_vstring(equations_set_setup%SETUP_TYPE,"*",err,error))// &
2415  & " is invalid for a generalised Laplace equation."
2416  CALL flagerror(local_error,err,error,*999)
2417  END SELECT
2418  CASE DEFAULT
2419  local_error="The setup type of "//trim(number_to_vstring(equations_set_setup%SETUP_TYPE,"*",err,error))// &
2420  & " is invalid for a generalised Laplace equation."
2421  CALL flagerror(local_error,err,error,*999)
2422  END SELECT
2423  ELSE
2424  local_error="The equations set subtype of "//trim(number_to_vstring(equations_set%SPECIFICATION(3),"*",err,error))// &
2425  & " does not equal a generalised Laplace equation subtype."
2426  CALL flagerror(local_error,err,error,*999)
2427  ENDIF
2428  ELSE
2429  CALL flagerror("Equations set is not associated.",err,error,*999)
2430  ENDIF
2431 
2432  exits("Laplace_EquationsSetGeneralisedSetup")
2433  RETURN
2434 999 errors("Laplace_EquationsSetGeneralisedSetup",err,error)
2435  exits("Laplace_EquationsSetGeneralisedSetup")
2436  RETURN 1
2437 
2439 
2440  !
2441  !================================================================================================================================
2442  !
2443 
2445  SUBROUTINE laplace_equation_problem_setup(PROBLEM,PROBLEM_SETUP,ERR,ERROR,*)
2447  !Argument variables
2448  TYPE(problem_type), POINTER :: PROBLEM
2449  TYPE(problem_setup_type), INTENT(INOUT) :: PROBLEM_SETUP
2450  INTEGER(INTG), INTENT(OUT) :: ERR
2451  TYPE(varying_string), INTENT(OUT) :: ERROR
2452  !Local Variables
2453  TYPE(varying_string) :: LOCAL_ERROR
2454 
2455  enters("LAPLACE_EQUATION_PROBLEM_SETUP",err,error,*999)
2456 
2457  IF(ASSOCIATED(problem)) THEN
2458  IF(.NOT.ALLOCATED(problem%SPECIFICATION)) THEN
2459  CALL flagerror("Problem specification is not allocated.",err,error,*999)
2460  ELSE IF(SIZE(problem%SPECIFICATION,1)<3) THEN
2461  CALL flagerror("Problem specification must have three entries for a Laplace problem.",err,error,*999)
2462  END IF
2463  SELECT CASE(problem%SPECIFICATION(3))
2465  CALL laplace_equation_problem_standard_setup(problem,problem_setup,err,error,*999)
2467  CALL laplace_equation_problem_generalised_setup(problem,problem_setup,err,error,*999)
2468  CASE DEFAULT
2469  local_error="Problem subtype "//trim(number_to_vstring(problem%SPECIFICATION(3),"*",err,error))// &
2470  & " is not valid for a Laplace equation type of a classical field problem class."
2471  CALL flagerror(local_error,err,error,*999)
2472  END SELECT
2473  ELSE
2474  CALL flagerror("Problem is not associated.",err,error,*999)
2475  ENDIF
2476 
2477  exits("LAPLACE_EQUATION_PROBLEM_SETUP")
2478  RETURN
2479 999 errorsexits("LAPLACE_EQUATION_PROBLEM_SETUP",err,error)
2480  RETURN 1
2481  END SUBROUTINE laplace_equation_problem_setup
2482 
2483  !
2484  !================================================================================================================================
2485  !
2486 
2488  SUBROUTINE laplace_problemspecificationset(problem,problemSpecification,err,error,*)
2490  !Argument variables
2491  TYPE(problem_type), POINTER :: problem
2492  INTEGER(INTG), INTENT(IN) :: problemSpecification(:)
2493  INTEGER(INTG), INTENT(OUT) :: err
2494  TYPE(varying_string), INTENT(OUT) :: error
2495  !Local Variables
2496  TYPE(varying_string) :: localError
2497  INTEGER(INTG) :: problemSubtype
2498 
2499  enters("Laplace_ProblemSpecificationSet",err,error,*999)
2500 
2501  IF(ASSOCIATED(problem)) THEN
2502  IF(SIZE(problemspecification,1)==3) THEN
2503  problemsubtype=problemspecification(3)
2504  SELECT CASE(problemsubtype)
2507  !ok
2508  CASE DEFAULT
2509  localerror="The third problem specification of "//trim(numbertovstring(problemsubtype,"*",err,error))// &
2510  & " is not valid for a Laplace type of a classical field problem."
2511  CALL flagerror(localerror,err,error,*999)
2512  END SELECT
2513  IF(ALLOCATED(problem%specification)) THEN
2514  CALL flagerror("Problem specification is already allocated.",err,error,*999)
2515  ELSE
2516  ALLOCATE(problem%specification(3),stat=err)
2517  IF(err/=0) CALL flagerror("Could not allocate problem specification.",err,error,*999)
2518  END IF
2519  problem%specification(1:3)=[problem_classical_field_class,problem_laplace_equation_type,problemsubtype]
2520  ELSE
2521  CALL flagerror("Laplace problem specification must have three entries.",err,error,*999)
2522  END IF
2523  ELSE
2524  CALL flagerror("Problem is not associated.",err,error,*999)
2525  END IF
2526 
2527  exits("Laplace_ProblemSpecificationSet")
2528  RETURN
2529 999 errors("Laplace_ProblemSpecificationSet",err,error)
2530  exits("Laplace_ProblemSpecificationSet")
2531  RETURN 1
2532 
2533  END SUBROUTINE laplace_problemspecificationset
2534 
2535  !
2536  !================================================================================================================================
2537  !
2538 
2540  SUBROUTINE laplace_equation_problem_standard_setup(PROBLEM,PROBLEM_SETUP,ERR,ERROR,*)
2542  !Argument variables
2543  TYPE(problem_type), POINTER :: PROBLEM
2544  TYPE(problem_setup_type), INTENT(INOUT) :: PROBLEM_SETUP
2545  INTEGER(INTG), INTENT(OUT) :: ERR
2546  TYPE(varying_string), INTENT(OUT) :: ERROR
2547  !Local Variables
2548  TYPE(control_loop_type), POINTER :: CONTROL_LOOP,CONTROL_LOOP_ROOT
2549  TYPE(solver_type), POINTER :: SOLVER
2550  TYPE(solver_equations_type), POINTER :: SOLVER_EQUATIONS
2551  TYPE(solvers_type), POINTER :: SOLVERS
2552  TYPE(varying_string) :: LOCAL_ERROR
2553 
2554  enters("LAPLACE_EQUATION_PROBLEM_STANDARD_SETUP",err,error,*999)
2555 
2556  NULLIFY(control_loop)
2557  NULLIFY(solver)
2558  NULLIFY(solver_equations)
2559  NULLIFY(solvers)
2560  IF(ASSOCIATED(problem)) THEN
2561  IF(.NOT.ALLOCATED(problem%SPECIFICATION)) THEN
2562  CALL flagerror("Problem specification is not allocated.",err,error,*999)
2563  ELSE IF(SIZE(problem%SPECIFICATION,1)<3) THEN
2564  CALL flagerror("Problem specification must have three entries for a Laplace problem.",err,error,*999)
2565  END IF
2566  IF(problem%SPECIFICATION(3)==problem_standard_laplace_subtype) THEN
2567  SELECT CASE(problem_setup%SETUP_TYPE)
2569  SELECT CASE(problem_setup%ACTION_TYPE)
2571  !Do nothing????
2573  !Do nothing???
2574  CASE DEFAULT
2575  local_error="The action type of "//trim(number_to_vstring(problem_setup%ACTION_TYPE,"*",err,error))// &
2576  & " for a setup type of "//trim(number_to_vstring(problem_setup%SETUP_TYPE,"*",err,error))// &
2577  & " is invalid for a standard Laplace equation."
2578  CALL flagerror(local_error,err,error,*999)
2579  END SELECT
2581  SELECT CASE(problem_setup%ACTION_TYPE)
2583  !Set up a simple control loop
2584  CALL control_loop_create_start(problem,control_loop,err,error,*999)
2586  !Finish the control loops
2587  control_loop_root=>problem%CONTROL_LOOP
2588  CALL control_loop_get(control_loop_root,control_loop_node,control_loop,err,error,*999)
2589  CALL control_loop_create_finish(control_loop,err,error,*999)
2590  CASE DEFAULT
2591  local_error="The action type of "//trim(number_to_vstring(problem_setup%ACTION_TYPE,"*",err,error))// &
2592  & " for a setup type of "//trim(number_to_vstring(problem_setup%SETUP_TYPE,"*",err,error))// &
2593  & " is invalid for a standard Laplace equation."
2594  CALL flagerror(local_error,err,error,*999)
2595  END SELECT
2597  !Get the control loop
2598  control_loop_root=>problem%CONTROL_LOOP
2599  CALL control_loop_get(control_loop_root,control_loop_node,control_loop,err,error,*999)
2600  SELECT CASE(problem_setup%ACTION_TYPE)
2602  !Start the solvers creation
2603  CALL solvers_create_start(control_loop,solvers,err,error,*999)
2604  CALL solvers_number_set(solvers,1,err,error,*999)
2605  !Set the solver to be a linear solver
2606  CALL solvers_solver_get(solvers,1,solver,err,error,*999)
2607  CALL solver_type_set(solver,solver_linear_type,err,error,*999)
2608  !Set solver defaults
2609  CALL solver_library_type_set(solver,solver_petsc_library,err,error,*999)
2611  !Get the solvers
2612  CALL control_loop_solvers_get(control_loop,solvers,err,error,*999)
2613  !Finish the solvers creation
2614  CALL solvers_create_finish(solvers,err,error,*999)
2615  CASE DEFAULT
2616  local_error="The action type of "//trim(number_to_vstring(problem_setup%ACTION_TYPE,"*",err,error))// &
2617  & " for a setup type of "//trim(number_to_vstring(problem_setup%SETUP_TYPE,"*",err,error))// &
2618  & " is invalid for a standard Laplace equation."
2619  CALL flagerror(local_error,err,error,*999)
2620  END SELECT
2622  SELECT CASE(problem_setup%ACTION_TYPE)
2624  !Get the control loop
2625  control_loop_root=>problem%CONTROL_LOOP
2626  CALL control_loop_get(control_loop_root,control_loop_node,control_loop,err,error,*999)
2627  !Get the solver
2628  CALL control_loop_solvers_get(control_loop,solvers,err,error,*999)
2629  CALL solvers_solver_get(solvers,1,solver,err,error,*999)
2630  !Create the solver equations
2631  CALL solver_equations_create_start(solver,solver_equations,err,error,*999)
2632  CALL solver_equations_linearity_type_set(solver_equations,solver_equations_linear,err,error,*999)
2633  CALL solver_equations_time_dependence_type_set(solver_equations,solver_equations_static,err,error,*999)
2634  CALL solver_equations_sparsity_type_set(solver_equations,solver_sparse_matrices,err,error,*999)
2636  !Get the control loop
2637  control_loop_root=>problem%CONTROL_LOOP
2638  CALL control_loop_get(control_loop_root,control_loop_node,control_loop,err,error,*999)
2639  !Get the solver equations
2640  CALL control_loop_solvers_get(control_loop,solvers,err,error,*999)
2641  CALL solvers_solver_get(solvers,1,solver,err,error,*999)
2642  CALL solver_solver_equations_get(solver,solver_equations,err,error,*999)
2643  !Finish the solver equations creation
2644  CALL solver_equations_create_finish(solver_equations,err,error,*999)
2645  CASE DEFAULT
2646  local_error="The action type of "//trim(number_to_vstring(problem_setup%ACTION_TYPE,"*",err,error))// &
2647  & " for a setup type of "//trim(number_to_vstring(problem_setup%SETUP_TYPE,"*",err,error))// &
2648  & " is invalid for a standard Laplace equation."
2649  CALL flagerror(local_error,err,error,*999)
2650  END SELECT
2651  CASE DEFAULT
2652  local_error="The setup type of "//trim(number_to_vstring(problem_setup%SETUP_TYPE,"*",err,error))// &
2653  & " is invalid for a standard Laplace equation."
2654  CALL flagerror(local_error,err,error,*999)
2655  END SELECT
2656  ELSE
2657  local_error="The problem subtype of "//trim(number_to_vstring(problem%SPECIFICATION(3),"*",err,error))// &
2658  & " does not equal a standard Laplace equation subtype."
2659  CALL flagerror(local_error,err,error,*999)
2660  ENDIF
2661  ELSE
2662  CALL flagerror("Problem is not associated.",err,error,*999)
2663  ENDIF
2664 
2665  exits("LAPLACE_EQUATION_PROBLEM_STANDARD_SETUP")
2666  RETURN
2667 999 errorsexits("LAPLACE_EQUATION_PROBLEM_STANDARD_SETUP",err,error)
2668  RETURN 1
2670 
2671  !
2672  !================================================================================================================================
2673  !
2674 
2676  SUBROUTINE laplace_equation_problem_generalised_setup(PROBLEM,PROBLEM_SETUP,ERR,ERROR,*)
2678  !Argument variables
2679  TYPE(problem_type), POINTER :: PROBLEM
2680  TYPE(problem_setup_type), INTENT(INOUT) :: PROBLEM_SETUP
2681  INTEGER(INTG), INTENT(OUT) :: ERR
2682  TYPE(varying_string), INTENT(OUT) :: ERROR
2683  !Local Variables
2684  TYPE(control_loop_type), POINTER :: CONTROL_LOOP,CONTROL_LOOP_ROOT
2685  TYPE(solver_type), POINTER :: SOLVER
2686  TYPE(solver_equations_type), POINTER :: SOLVER_EQUATIONS
2687  TYPE(solvers_type), POINTER :: SOLVERS
2688  TYPE(varying_string) :: LOCAL_ERROR
2689 
2690  enters("LAPLACE_EQUATION_PROBLEM_GENERALISED_SETUP",err,error,*999)
2691 
2692  NULLIFY(control_loop)
2693  NULLIFY(solver)
2694  NULLIFY(solver_equations)
2695  NULLIFY(solvers)
2696 
2697  IF(ASSOCIATED(problem)) THEN
2698  IF(.NOT.ALLOCATED(problem%SPECIFICATION)) THEN
2699  CALL flagerror("Problem specification is not allocated.",err,error,*999)
2700  ELSE IF(SIZE(problem%SPECIFICATION,1)<3) THEN
2701  CALL flagerror("Problem specification must have three entries for a Laplace problem.",err,error,*999)
2702  END IF
2703  IF(problem%SPECIFICATION(3)==problem_generalised_laplace_subtype) THEN
2704  SELECT CASE(problem_setup%SETUP_TYPE)
2706  SELECT CASE(problem_setup%ACTION_TYPE)
2708  !Do nothing????
2710  !Do nothing???
2711  CASE DEFAULT
2712  local_error="The action type of "//trim(number_to_vstring(problem_setup%ACTION_TYPE,"*",err,error))// &
2713  & " for a setup type of "//trim(number_to_vstring(problem_setup%SETUP_TYPE,"*",err,error))// &
2714  & " is invalid for a generalised Laplace equation."
2715  CALL flagerror(local_error,err,error,*999)
2716  END SELECT
2718  SELECT CASE(problem_setup%ACTION_TYPE)
2720  !Set up a simple control loop
2721  CALL control_loop_create_start(problem,control_loop,err,error,*999)
2723  !Finish the control loops
2724  control_loop_root=>problem%CONTROL_LOOP
2725  CALL control_loop_get(control_loop_root,control_loop_node,control_loop,err,error,*999)
2726  CALL control_loop_create_finish(control_loop,err,error,*999)
2727  CASE DEFAULT
2728  local_error="The action type of "//trim(number_to_vstring(problem_setup%ACTION_TYPE,"*",err,error))// &
2729  & " for a setup type of "//trim(number_to_vstring(problem_setup%SETUP_TYPE,"*",err,error))// &
2730  & " is invalid for a generalised Laplace equation."
2731  CALL flagerror(local_error,err,error,*999)
2732  END SELECT
2734  !Get the control loop
2735  control_loop_root=>problem%CONTROL_LOOP
2736  CALL control_loop_get(control_loop_root,control_loop_node,control_loop,err,error,*999)
2737  SELECT CASE(problem_setup%ACTION_TYPE)
2739  !Start the solvers creation
2740  CALL solvers_create_start(control_loop,solvers,err,error,*999)
2741  CALL solvers_number_set(solvers,1,err,error,*999)
2742  !Set the solver to be a linear solver
2743  CALL solvers_solver_get(solvers,1,solver,err,error,*999)
2744  CALL solver_type_set(solver,solver_linear_type,err,error,*999)
2745  !Set solver defaults
2746  CALL solver_library_type_set(solver,solver_petsc_library,err,error,*999)
2748  !Get the solvers
2749  CALL control_loop_solvers_get(control_loop,solvers,err,error,*999)
2750  !Finish the solvers creation
2751  CALL solvers_create_finish(solvers,err,error,*999)
2752  CASE DEFAULT
2753  local_error="The action type of "//trim(number_to_vstring(problem_setup%ACTION_TYPE,"*",err,error))// &
2754  & " for a setup type of "//trim(number_to_vstring(problem_setup%SETUP_TYPE,"*",err,error))// &
2755  & " is invalid for a generalised Laplace equation."
2756  CALL flagerror(local_error,err,error,*999)
2757  END SELECT
2759  SELECT CASE(problem_setup%ACTION_TYPE)
2761  !Get the control loop
2762  control_loop_root=>problem%CONTROL_LOOP
2763  CALL control_loop_get(control_loop_root,control_loop_node,control_loop,err,error,*999)
2764  !Get the solver
2765  CALL control_loop_solvers_get(control_loop,solvers,err,error,*999)
2766  CALL solvers_solver_get(solvers,1,solver,err,error,*999)
2767  !Create the solver equations
2768  CALL solver_equations_create_start(solver,solver_equations,err,error,*999)
2769  CALL solver_equations_linearity_type_set(solver_equations,solver_equations_linear,err,error,*999)
2770  CALL solver_equations_time_dependence_type_set(solver_equations,solver_equations_static,err,error,*999)
2771  CALL solver_equations_sparsity_type_set(solver_equations,solver_sparse_matrices,err,error,*999)
2773  !Get the control loop
2774  control_loop_root=>problem%CONTROL_LOOP
2775  CALL control_loop_get(control_loop_root,control_loop_node,control_loop,err,error,*999)
2776  !Get the solver equations
2777  CALL control_loop_solvers_get(control_loop,solvers,err,error,*999)
2778  CALL solvers_solver_get(solvers,1,solver,err,error,*999)
2779  CALL solver_solver_equations_get(solver,solver_equations,err,error,*999)
2780  !Finish the solver equations creation
2781  CALL solver_equations_create_finish(solver_equations,err,error,*999)
2782  CASE DEFAULT
2783  local_error="The action type of "//trim(number_to_vstring(problem_setup%ACTION_TYPE,"*",err,error))// &
2784  & " for a setup type of "//trim(number_to_vstring(problem_setup%SETUP_TYPE,"*",err,error))// &
2785  & " is invalid for a generalised Laplace equation."
2786  CALL flagerror(local_error,err,error,*999)
2787  END SELECT
2788  CASE DEFAULT
2789  local_error="The setup type of "//trim(number_to_vstring(problem_setup%SETUP_TYPE,"*",err,error))// &
2790  & " is invalid for a generalised Laplace equation."
2791  CALL flagerror(local_error,err,error,*999)
2792  END SELECT
2793  ELSE
2794  local_error="The problem subtype of "//trim(number_to_vstring(problem%SPECIFICATION(3),"*",err,error))// &
2795  & " does not equal a generalised Laplace equation subtype."
2796  CALL flagerror(local_error,err,error,*999)
2797  ENDIF
2798  ELSE
2799  CALL flagerror("Problem is not associated.",err,error,*999)
2800  ENDIF
2801 
2802  exits("LAPLACE_EQUATION_PROBLEM_GENERALISED_SETUP")
2803  RETURN
2804 999 errorsexits("LAPLACE_EQUATION_PROBLEM_GENERALISED_SETUP",err,error)
2805  RETURN 1
2807 
2808  !
2809  !================================================================================================================================
2810  !
2811 
2812 END MODULE laplace_equations_routines
subroutine laplace_equationssetgeneralisedsetup(EQUATIONS_SET, EQUATIONS_SET_SETUP, ERR, ERROR,)
Sets up the generalised Laplace equation.
integer(intg), parameter equations_set_setup_dependent_type
Dependent variables.
integer(intg), parameter equations_set_fem_solution_method
Finite Element Method solution method.
This module contains all basis function routines.
integer(intg), parameter equations_set_setup_materials_type
Materials setup.
Contains information on the boundary conditions for the solver equations.
Definition: types.f90:1780
subroutine, public enters(NAME, ERR, ERROR,)
Records the entry into the named procedure and initialises the error code.
subroutine, public solvers_create_finish(SOLVERS, ERR, ERROR,)
Finish the creation of solvers.
integer(intg), parameter equations_set_laplace_equation_two_dim_1
u=x**2+2*x*y-y**2
This module contains all coordinate transformation and support routines.
Contains information on the equations mapping i.e., how field variable DOFS are mapped to the rows an...
Definition: types.f90:1681
Contains information about the equations in an equations set.
Definition: types.f90:1735
integer(intg), parameter equations_set_gfem_solution_method
Grid-based Finite Element Method solution method.
integer(intg), parameter global_deriv_s1_s2_s3
Cross derivative in the s1, s2 and s3 direction i.e., d^3u/ds1ds2ds3.
Definition: constants.f90:220
integer(intg), parameter problem_laplace_equation_type
integer(intg), parameter problem_setup_control_type
Solver setup for a problem.
This module handles all problem wide constants.
integer(intg), parameter, public control_loop_node
The identifier for a each "leaf" node in a control loop.
integer(intg), parameter no_global_deriv
No global derivative i.e., u.
Definition: constants.f90:213
integer(intg), parameter equations_set_generalised_laplace_subtype
Converts a number to its equivalent varying string representation.
Definition: strings.f90:161
subroutine, public equations_create_start(EQUATIONS_SET, EQUATIONS, ERR, ERROR,)
Start the creation of equations for the equation set.
Contains information on the mesh decomposition.
Definition: types.f90:1063
subroutine, public equations_matrices_create_start(EQUATIONS, EQUATIONS_MATRICES, ERR, ERROR,)
Starts the creation of the equations matrices and rhs for the the equations.
Contains information on the type of solver to be used.
Definition: types.f90:2777
integer(intg), parameter, public solver_petsc_library
PETSc solver library.
subroutine, public solvers_number_set(SOLVERS, NUMBER_OF_SOLVERS, ERR, ERROR,)
Sets/changes the number of solvers.
integer(intg), parameter no_part_deriv
No partial derivative i.e., u.
Definition: constants.f90:177
This module handles all Laplace equations routines.
This module handles all equations matrix and rhs routines.
subroutine, public solver_type_set(SOLVER, SOLVE_TYPE, ERR, ERROR,)
Sets/changes the type for a solver.
integer(intg), parameter equations_static
The equations are static and have no time dependence.
Contains information on an equations set.
Definition: types.f90:1941
This module handles all equations routines.
integer(intg), parameter equations_set_setup_source_type
Source setup.
This module contains all string manipulation and transformation routines.
Definition: strings.f90:45
subroutine, public laplace_equationssetspecificationset(equationsSet, specification, err, error,)
Sets the equation specification for a Laplace type of a classical field equations set...
subroutine, public solvers_create_start(CONTROL_LOOP, SOLVERS, ERR, ERROR,)
Start the creation of a solvers for the control loop.
Contains information on the solvers to be used in a control loop.
Definition: types.f90:2805
integer(intg), parameter first_part_deriv
First partial derivative i.e., du/ds.
Definition: constants.f90:178
integer(intg), parameter equations_set_laplace_equation_two_dim_2
u=cos(x)cosh(y)
This module contains routines for timing the program.
Definition: timer_f.f90:45
integer(intg), parameter solver_equations_static
Solver equations are static.
subroutine, public equations_time_dependence_type_set(EQUATIONS, TIME_DEPENDENCE_TYPE, ERR, ERROR,)
Sets/changes the time dependence type for equations.
subroutine, public solver_equations_sparsity_type_set(SOLVER_EQUATIONS, SPARSITY_TYPE, ERR, ERROR,)
Sets/changes the sparsity type for solver equations.
This module contains all mathematics support routines.
Definition: maths.f90:45
integer(intg), parameter equations_set_laplace_equation_type
subroutine, public solvers_solver_get(SOLVERS, SOLVER_INDEX, SOLVER, ERR, ERROR,)
Returns a pointer to the specified solver in the list of solvers.
Contains information for a field defined on a region.
Definition: types.f90:1346
integer(intg), parameter, public equations_matrices_full_matrices
Use fully populated equation matrices.
subroutine, public equations_mapping_rhs_variable_type_set(EQUATIONS_MAPPING, RHS_VARIABLE_TYPE, ERR, ERROR,)
Sets the mapping between a dependent field variable and the equations set rhs vector.
integer(intg), parameter solver_equations_linear
Solver equations are linear.
integer(intg), parameter global_deriv_s2
First global derivative in the s2 direction i.e., du/ds2.
Definition: constants.f90:215
Contains information on a control loop.
Definition: types.f90:3185
integer(intg), parameter equations_set_standard_laplace_subtype
subroutine, public laplace_equation_problem_setup(PROBLEM, PROBLEM_SETUP, ERR, ERROR,)
Sets up the Laplace problem.
This module provides an iso_varying_string module, conformant to the API specified in ISO/IEC 1539-2:...
subroutine, public solver_equations_create_finish(SOLVER_EQUATIONS, ERR, ERROR,)
Finishes the process of creating solver equations.
integer(intg), parameter, public solver_sparse_matrices
Use sparse solver matrices.
integer(intg), parameter global_deriv_s2_s3
Global Cross derivative in the s2 and s3 direction i.e., d^2u/ds2ds3.
Definition: constants.f90:219
subroutine, public solver_equations_create_start(SOLVER, SOLVER_EQUATIONS, ERR, ERROR,)
Starts the process of creating solver equations.
integer(intg), parameter equations_set_laplace_equation_three_dim_2
u=cos(x)*cosh(y)*z
integer(intg), parameter, public basis_default_quadrature_scheme
Identifier for the default quadrature scheme.
integer(intg), parameter problem_setup_solvers_type
Solver setup for a problem.
integer(intg), parameter equations_set_setup_equations_type
Equations setup.
integer(intg), parameter equations_set_setup_independent_type
Independent variables.
This module contains all program wide constants.
Definition: constants.f90:45
subroutine, public solver_library_type_set(SOLVER, SOLVER_LIBRARY_TYPE, ERR, ERROR,)
Sets/changes the type of library type to use for the solver.
subroutine, public equationsmapping_linearmatricesnumberset(EQUATIONS_MAPPING, NUMBER_OF_LINEAR_EQUATIONS_MATRICES, ERR, ERROR,)
Sets/changes the number of linear equations matrices.
integer(intg), parameter problem_setup_initial_type
Initial setup for a problem.
Contains the interpolated point coordinate metrics. Old CMISS name GL,GU,RG.
Definition: types.f90:1112
subroutine, public equationsmapping_linearmatricesvariabletypesset(EQUATIONS_MAPPING, LINEAR_MATRIX_VARIABLE_TYPES, ERR, ERROR,)
Sets the mapping between the dependent field variable types and the linear equations matrices...
subroutine, public laplace_equationssetsolutionmethodset(EQUATIONS_SET, SOLUTION_METHOD, ERR, ERROR,)
Sets/changes the solution method for a Laplace equation type of an classical field equations set clas...
integer(intg), parameter problem_generalised_laplace_subtype
subroutine, public coordinates_materialsystemcalculate(geometricInterpPointMetrics, fibreInterpPoint, dNudX, dXdNu, dNudXi, dXidNu, err, error,)
Calculates the tensor to get from material coordinate system, nu, to local coordinate system...
subroutine, public solver_equations_linearity_type_set(SOLVER_EQUATIONS, LINEARITY_TYPE, ERR, ERROR,)
Sets/changes the linearity type for solver equations.
integer(intg), parameter equations_set_setup_start_action
Start setup action.
integer(intg), parameter problem_classical_field_class
subroutine, public exits(NAME)
Records the exit out of the named procedure.
recursive subroutine, public control_loop_solvers_get(CONTROL_LOOP, SOLVERS, ERR, ERROR,)
Returns a pointer to the solvers for a control loop.
This module contains all type definitions in order to avoid cyclic module references.
Definition: types.f90:70
Contains information on the equations matrices and vectors.
Definition: types.f90:1520
integer(intg), parameter, public equations_matrix_fem_structure
Finite element matrix structure.
This module contains all the low-level base routines e.g., all debug, control, and low-level communic...
Contains information of the linear matrices for equations matrices.
Definition: types.f90:1479
integer(intg), parameter equations_set_laplace_equation_three_dim_1
u=x**2-2*y**2+z**2
subroutine laplace_equation_problem_standard_setup(PROBLEM, PROBLEM_SETUP, ERR, ERROR,)
Sets up the standard Laplace equations problem.
subroutine, public equations_matrices_linear_storage_type_set(EQUATIONS_MATRICES, STORAGE_TYPE, ERR, ERROR,)
Sets the storage type (sparsity) of the linear equations matrices.
subroutine, public equationsmatrices_linearstructuretypeset(EQUATIONS_MATRICES, STRUCTURE_TYPE, ERR, ERROR,)
Sets the structure (sparsity) of the linear equations matrices.
subroutine, public equations_mapping_create_finish(EQUATIONS_MAPPING, ERR, ERROR,)
Finishes the process of creating an equations mapping.
Returns the specified control loop as indexed by the control loop identifier from the control loop ro...
subroutine, public equations_set_equations_get(EQUATIONS_SET, EQUATIONS, ERR, ERROR,)
Gets the equations for an equations set.
integer(intg), dimension(4) partial_derivative_first_derivative_map
PARTIAL_DERIVATIVE_FIRST_DERIVATIVE_MAP(nic) gives the partial derivative index for the first derivat...
Definition: constants.f90:254
subroutine, public equations_create_finish(EQUATIONS, ERR, ERROR,)
Finish the creation of equations.
This module handles all domain mappings routines.
integer(intg), parameter problem_setup_finish_action
Finish setup action.
This module handles all equations mapping routines.
Contains information about the solver equations for a solver.
Definition: types.f90:2452
integer(intg), parameter, public matrix_compressed_row_storage_type
Matrix compressed row storage type.
integer(intg), parameter equations_set_gfv_solution_method
Grid-based Finite Volume solution method.
integer(intg), parameter equations_set_setup_geometry_type
Geometry setup.
integer(intg), parameter global_deriv_s1_s2
Global Cross derivative in the s1 and s2 direction i.e., d^2u/ds1ds2.
Definition: constants.f90:216
Contains information for a problem.
Definition: types.f90:3221
integer(intg), parameter problem_standard_laplace_subtype
integer(intg), parameter equations_set_classical_field_class
integer(intg), parameter equations_linear
The equations are linear.
Contains the topology information for the nodes of a domain.
Definition: types.f90:713
subroutine, public equations_matrices_create_finish(EQUATIONS_MATRICES, ERR, ERROR,)
Finishes the creation of the equations matrices and RHS for the the equations.
This module handles all distributed matrix vector routines.
subroutine, public laplace_equation_equations_set_setup(EQUATIONS_SET, EQUATIONS_SET_SETUP, ERR, ERROR,)
Sets up the Laplace equation type of a classical field equations set class.
integer(intg), parameter global_deriv_s1
First global derivative in the s1 direction i.e., du/ds1.
Definition: constants.f90:214
This module handles all boundary conditions routines.
This module handles all solver routines.
subroutine, public equations_mapping_create_start(EQUATIONS, EQUATIONS_MAPPING, ERR, ERROR,)
Finishes the process of creating an equations mapping for a equations set equations.
integer(intg), parameter equations_set_moving_mesh_laplace_subtype
Contains the interpolated value (and the derivatives wrt xi) of a field at a point. Old CMISS name XG.
Definition: types.f90:1129
Contains information about an equations matrix.
Definition: types.f90:1429
Contains information for a particular quadrature scheme.
Definition: types.f90:141
subroutine, public laplace_problemspecificationset(problem, problemSpecification, err, error,)
Sets the problem specification for a Laplace equation type.
This module contains all routines dealing with (non-distributed) matrix and vectors types...
subroutine, public equations_linearity_type_set(EQUATIONS, LINEARITY_TYPE, ERR, ERROR,)
Sets/changes the linearity type for equations.
subroutine, public control_loop_create_start(PROBLEM, CONTROL_LOOP, ERR, ERROR,)
Start the process of creating a control loop for a problem.
integer(intg), parameter problem_setup_solver_equations_type
Solver equations setup for a problem.
Sets a boundary condition on the specified local DOF.
Contains information for a field variable defined on a field.
Definition: types.f90:1289
integer(intg), parameter equations_set_fd_solution_method
Finite Difference solution method.
integer(intg), parameter, public equations_matrices_sparse_matrices
Use sparse equations matrices.
integer(intg), parameter global_deriv_s3
First global derivative in the s3 direction i.e., du/ds3.
Definition: constants.f90:217
subroutine, public laplaceequation_finiteelementcalculate(equationsSet, elementNumber, err, error,)
Calculates the element stiffness matrices and RHS for a Laplace equation finite element equations set...
Contains information on the setup information for an equations set.
Definition: types.f90:1866
A pointer to the domain decomposition for this domain.
Definition: types.f90:938
integer(intg), parameter problem_setup_start_action
Start setup action.
subroutine, public laplace_boundaryconditionsanalyticcalculate(EQUATIONS_SET, BOUNDARY_CONDITIONS, ERR, ERROR,)
Calculates the analytic solution and sets the boundary conditions for an analytic problem...
subroutine, public solver_equations_time_dependence_type_set(SOLVER_EQUATIONS, TIME_DEPENDENCE_TYPE, ERR, ERROR,)
Sets/changes the time dependence type for solver equations.
This module handles all control loop routines.
Calculates and returns the matrix-product A*B in the matrix C.
Definition: maths.f90:167
integer(intg), parameter, public boundary_condition_fixed
The dof is fixed as a boundary condition.
subroutine, public errors(NAME, ERR, ERROR)
Records the exiting error of the subroutine.
This module defines all constants shared across equations set routines.
integer(intg), parameter equations_set_bem_solution_method
Boundary Element Method solution method.
subroutine, public solver_solver_equations_get(SOLVER, SOLVER_EQUATIONS, ERR, ERROR,)
Returns a pointer to the solver equations for a solver.
subroutine laplace_equation_problem_generalised_setup(PROBLEM, PROBLEM_SETUP, ERR, ERROR,)
Sets up the generalised Laplace equations problem.
subroutine laplace_equationssetstandardsetup(EQUATIONS_SET, EQUATIONS_SET_SETUP, ERR, ERROR,)
Sets up the standard Laplace equation.
Contains all information about a basis .
Definition: types.f90:184
integer(intg), parameter equations_set_fv_solution_method
Finite Volume solution method.
integer(intg), parameter, public matrix_block_storage_type
Matrix block storage type.
subroutine laplace_equationssetmovingmeshsetup(EQUATIONS_SET, EQUATIONS_SET_SETUP, ERR, ERROR,)
Sets up the moving mesh Laplace equation.
integer(intg), parameter equations_set_setup_initial_type
Initial setup.
recursive subroutine, public control_loop_create_finish(CONTROL_LOOP, ERR, ERROR,)
Finish the process of creating a control loop.
integer(intg), parameter global_deriv_s1_s3
Global Cross derivative in the s1 and s3 direction i.e., d^2u/ds1ds3.
Definition: constants.f90:218
integer(intg), parameter equations_set_setup_analytic_type
Analytic setup.
Flags an error condition.
integer(intg), parameter, public solver_linear_type
A linear solver.
Contains information of the RHS vector for equations matrices.
Definition: types.f90:1500
Contains information for mapping field variables to the linear matrices in the equations set of the m...
Definition: types.f90:1587
This module contains all kind definitions.
Definition: kinds.f90:45
integer(intg), parameter equations_set_setup_finish_action
Finish setup action.
This module handles all formating and input and output.