Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
85a3134
Give the ability to set the projected xi location for data projections.
chrispbradley May 17, 2019
934cfaa
Fix for no error when using wrong projection result routine.
chrispbradley May 18, 2019
ed936d4
Separating out Sobolev smoothing parameters for each direction.
chrispbradley May 21, 2019
65927c7
Fixing fit plus adding specifying fields for export.
chrispbradley Jun 1, 2019
d08ba05
Correct symmetric Hessian entries to avoid NaNs
chrispbradley Jun 2, 2019
b372f22
Adding Sobolev difference smoothing
chrispbradley Jun 4, 2019
249060b
Output number of canceled data points
chrispbradley Jun 7, 2019
fe8d3bd
Fixes to data projection analysis output.
chrispbradley Jun 8, 2019
5817d36
Allow for interpolating a field at a projected data point.
chrispbradley Jun 9, 2019
45f7095
Data field evaluate bug fix.
chrispbradley Jun 9, 2019
e6eed06
Renaming DataProjection_ResultXiGet and DataProjection_ResultXiSet to…
chrispbradley Jun 11, 2019
bd82aae
Bug fix for data point fields in finite elasticity derived variable c…
chrispbradley Jun 12, 2019
b2007c1
Return full deformation gradient tensor
chrispbradley Jun 14, 2019
6989043
Allow different starting xi for datapoints in a dataprojection
PrasadBabarendaGamage Aug 10, 2019
cabf06e
Adding EquationsSetSubtypes.REFERENCE_STATE_MOONEY_RIVLIN back to fin…
PrasadBabarendaGamage Aug 10, 2019
6a00255
Merge branch '183_reference_state_mooney_rivlin' into latest
PrasadBabarendaGamage Aug 10, 2019
d14e914
Active contraction (latest updates from Mario)
PrasadBabarendaGamage Nov 25, 2019
4f01130
Updates for projections, fitting, and finite elasticity finite differ…
PrasadBabarendaGamage Nov 26, 2019
6d00186
Merge branch 'develop' into latest
PrasadBabarendaGamage Mar 5, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions src/data_projection_access_routines.F90
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,11 @@ MODULE DataProjectionAccessRoutines
!> \see DataProjectionRoutines,OPENCMISS_DataProjectionExitTags
!>@{
INTEGER(INTG), PARAMETER :: DATA_PROJECTION_CANCELLED=0 !<Data projection has been cancelled. \see DataProjectionRoutines,OPENCMISS_DataProjectionExitTags
INTEGER(INTG), PARAMETER :: DATA_PROJECTION_EXIT_TAG_CONVERGED=1 !<Data projection exited due to it being converged \see DataProjectionRoutines,OPENCMISS_DataProjectionExitTags
INTEGER(INTG), PARAMETER :: DATA_PROJECTION_EXIT_TAG_BOUNDS=2 !<Data projection exited due to it hitting the bound and continue to travel out of the element. \see DataProjectionRoutines,OPENCMISS_DataProjectionExitTags
INTEGER(INTG), PARAMETER :: DATA_PROJECTION_EXIT_TAG_MAX_ITERATION=3 !<Data projection exited due to it attaining maximum number of iteration specified by user. \see DataProjectionRoutines,OPENCMISS_DataProjectionExitTags
INTEGER(INTG), PARAMETER :: DATA_PROJECTION_EXIT_TAG_NO_ELEMENT=4 !<Data projection exited due to no local element found, this happens when none of the candidate elements are within this computational node, and before MPI communication with other nodes. \see DataProjectionRoutines,OPENCMISS_DataProjectionExitTags
INTEGER(INTG), PARAMETER :: DATA_PROJECTION_USER_SPECIFIED=1 !<Data projection was specified by the user. \see DataProjectionRoutines,OPENCMISS_DataProjectionExitTags
INTEGER(INTG), PARAMETER :: DATA_PROJECTION_EXIT_TAG_CONVERGED=2 !<Data projection exited due to it being converged \see DataProjectionRoutines,OPENCMISS_DataProjectionExitTags
INTEGER(INTG), PARAMETER :: DATA_PROJECTION_EXIT_TAG_BOUNDS=3 !<Data projection exited due to it hitting the bound and continue to travel out of the element. \see DataProjectionRoutines,OPENCMISS_DataProjectionExitTags
INTEGER(INTG), PARAMETER :: DATA_PROJECTION_EXIT_TAG_MAX_ITERATION=4 !<Data projection exited due to it attaining maximum number of iteration specified by user. \see DataProjectionRoutines,OPENCMISS_DataProjectionExitTags
INTEGER(INTG), PARAMETER :: DATA_PROJECTION_EXIT_TAG_NO_ELEMENT=5 !<Data projection exited due to no local element found, this happens when none of the candidate elements are within this computational node, and before MPI communication with other nodes. \see DataProjectionRoutines,OPENCMISS_DataProjectionExitTags
!>@}

!Module types
Expand All @@ -74,8 +75,8 @@ MODULE DataProjectionAccessRoutines

!Interfaces

PUBLIC DATA_PROJECTION_CANCELLED,DATA_PROJECTION_EXIT_TAG_CONVERGED,DATA_PROJECTION_EXIT_TAG_BOUNDS, &
& DATA_PROJECTION_EXIT_TAG_MAX_ITERATION,DATA_PROJECTION_EXIT_TAG_NO_ELEMENT
PUBLIC DATA_PROJECTION_CANCELLED,DATA_PROJECTION_USER_SPECIFIED,DATA_PROJECTION_EXIT_TAG_CONVERGED, &
& DATA_PROJECTION_EXIT_TAG_BOUNDS,DATA_PROJECTION_EXIT_TAG_MAX_ITERATION,DATA_PROJECTION_EXIT_TAG_NO_ELEMENT

PUBLIC DataProjection_DataPointsGet

Expand Down
2,456 changes: 1,475 additions & 981 deletions src/data_projection_routines.F90

Large diffs are not rendered by default.

19 changes: 12 additions & 7 deletions src/equations_set_constants.F90
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ MODULE EquationsSetConstants
INTEGER(INTG), PARAMETER :: EQUATIONS_SET_ANISOTROPIC_POLYNOMIAL_ACTIVE_SUBTYPE=30
INTEGER(INTG), PARAMETER :: EQUATIONS_SET_HOLZAPFEL_OGDEN_ACTIVECONTRACTION_SUBTYPE=31
INTEGER(INTG), PARAMETER :: EQUATIONS_SET_GUCCIONE_ACTIVECONTRACTION_SUBTYPE=32
INTEGER(INTG), PARAMETER :: EQUATIONS_SET_GUCCIONE_ACTIVECONTRACTION_NOLENDEP_SUBTYPE=44
INTEGER(INTG), PARAMETER :: EQUATIONS_SET_GUCCIONE_ACTIVECONTRACTION_2NDPIOLA_SUBTYPE=45
INTEGER(INTG), PARAMETER :: EQUATIONS_SET_CONSTITUTIVE_AND_GROWTH_LAW_IN_CELLML_SUBTYPE=33
INTEGER(INTG), PARAMETER :: EQUATIONS_SET_GROWTH_LAW_IN_CELLML_SUBTYPE=34
INTEGER(INTG), PARAMETER :: EQUATIONS_SET_ACTIVE_STRAIN_SUBTYPE=35
Expand Down Expand Up @@ -406,14 +408,17 @@ MODULE EquationsSetConstants
!> \see EquationsSetConstants
!>@{
INTEGER(INTG), PARAMETER :: EQUATIONS_SET_DEFORMATION_GRADIENT_TENSOR=1 !<Deformation gradient tensor \see EquationsSetConstants_TensorTypes,EquationsSetConstants
INTEGER(INTG), PARAMETER :: EQUATIONS_SET_R_CAUCHY_GREEN_DEFORMATION_TENSOR=2 !<Right Cauchy-Green deformation field \see EquationsSetConstants_TensorTypes,EquationsSetConstants
INTEGER(INTG), PARAMETER :: EQUATIONS_SET_L_CAUCHY_GREEN_DEFORMATION_TENSOR=3 !<Right Cauchy-Green deformation field \see EquationsSetConstants_TensorTypes,EquationsSetConstants
INTEGER(INTG), PARAMETER :: EQUATIONS_SET_GREEN_LAGRANGE_STRAIN_TENSOR=4 !<Green-Lagrange strain tensor \see EquationsSetConstants_TensorTypes,EquationsSetConstants
INTEGER(INTG), PARAMETER :: EQUATIONS_SET_CAUCHY_STRESS_TENSOR=5 !<Cauchy stress tensor \see EquationsSetConstants_TensorTypes,EquationsSetConstants
INTEGER(INTG), PARAMETER :: EQUATIONS_SET_FIRST_PK_STRESS_TENSOR=6 !<First Piola Kirchhoff stress tensor \see EquationsSetConstants_TensorEvaluateTypes,EquationsSetConstants
INTEGER(INTG), PARAMETER :: EQUATIONS_SET_SECOND_PK_STRESS_TENSOR=7 !<Second Piola Kirchhoff stress tensor \see EquationsSetConstants_TensorEvaluateTypes,EquationsSetConstants
INTEGER(INTG), PARAMETER :: EQUATIONS_SET_DEFORMATION_GRADIENT_TENSOR_SPATIAL=2 !<Deformation gradient tensor \see EquationsSetConstants_TensorTypes,EquationsSetConstants
INTEGER(INTG), PARAMETER :: EQUATIONS_SET_DEFORMATION_GRADIENT_TENSOR_FIBRE=3 !<Deformation gradient tensor \see EquationsSetConstants_TensorTypes,EquationsSetConstants
INTEGER(INTG), PARAMETER :: EQUATIONS_SET_R_CAUCHY_GREEN_DEFORMATION_TENSOR=4 !<Right Cauchy-Green deformation field \see EquationsSetConstants_TensorTypes,EquationsSetConstants
INTEGER(INTG), PARAMETER :: EQUATIONS_SET_L_CAUCHY_GREEN_DEFORMATION_TENSOR=5 !<Right Cauchy-Green deformation field \see EquationsSetConstants_TensorTypes,EquationsSetConstants
INTEGER(INTG), PARAMETER :: EQUATIONS_SET_GREEN_LAGRANGE_STRAIN_TENSOR=6 !<Green-Lagrange strain tensor \see EquationsSetConstants_TensorTypes,EquationsSetConstants
INTEGER(INTG), PARAMETER :: EQUATIONS_SET_CAUCHY_STRESS_TENSOR=7 !<Cauchy stress tensor \see EquationsSetConstants_TensorTypes,EquationsSetConstants
INTEGER(INTG), PARAMETER :: EQUATIONS_SET_CAUCHY_STRESS_TENSOR_FIBRE=8 !<Cauchy stress tensor wrt deformed fibres \see EquationsSetConstants_TensorTypes,EquationsSetConstants
INTEGER(INTG), PARAMETER :: EQUATIONS_SET_FIRST_PK_STRESS_TENSOR=9 !<First Piola Kirchhoff stress tensor \see EquationsSetConstants_TensorEvaluateTypes,EquationsSetConstants
INTEGER(INTG), PARAMETER :: EQUATIONS_SET_SECOND_PK_STRESS_TENSOR=10 !<Second Piola Kirchhoff stress tensor \see EquationsSetConstants_TensorEvaluateTypes,EquationsSetConstants
!>@}
INTEGER(INTG), PARAMETER :: EQUATIONS_SET_NUMBER_OF_TENSOR_TYPES=7
INTEGER(INTG), PARAMETER :: EQUATIONS_SET_NUMBER_OF_TENSOR_TYPES=10

!> \addtogroup EquationsSetConstants_DynamicMatrixTypes EquationsSetConstants::DynamicMatrixTypes
!> \brief Type of matrix in a dynamic equations set
Expand Down
8 changes: 8 additions & 0 deletions src/equations_set_routines.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2772,6 +2772,8 @@ SUBROUTINE EquationsSet_FiniteElementJacobianEvaluate(equationsSet,elementNumber
CALL FlagError("Not implemented.",err,error,*999)
CASE(EQUATIONS_SET_CLASSICAL_FIELD_CLASS)
CALL ClassicalField_FiniteElementJacobianEvaluate(equationsSet,elementNumber,err,error,*999)
CASE(EQUATIONS_SET_FITTING_CLASS)
CALL FlagError("Not implemented.",err,error,*999)
CASE(EQUATIONS_SET_BIOELECTRICS_CLASS)
CALL FlagError("Not implemented.",err,error,*999)
CASE(EQUATIONS_SET_MODAL_CLASS)
Expand Down Expand Up @@ -2907,6 +2909,10 @@ SUBROUTINE EquationsSet_FiniteElementJacobianEvaluateFD(equationsSet,elementNumb
! so let's just loop over component, node/el, derivative
column=0 ! element jacobian matrix column number
DO componentIdx=1,columnVariable%NUMBER_OF_COMPONENTS
! adjusts the pertubation for the hydrostatic pressure to not use the L2Norm
IF(componentIdx==4) THEN
delta=(1.0_DP)*nonlinearMatrices%jacobians(jacobianNumber)%ptr%jacobianFiniteDifferenceStepSize
ENDIF
elementsTopology=>columnVariable%COMPONENTS(componentIdx)%DOMAIN%TOPOLOGY%ELEMENTS
componentInterpolationType=columnVariable%COMPONENTS(componentIdx)%INTERPOLATION_TYPE
SELECT CASE(componentInterpolationType)
Expand Down Expand Up @@ -3012,6 +3018,8 @@ SUBROUTINE EquationsSet_FiniteElementResidualEvaluate(equationsSet,elementNumber
CALL FlagError("Not implemented.",err,error,*999)
CASE(EQUATIONS_SET_CLASSICAL_FIELD_CLASS)
CALL ClassicalField_FiniteElementResidualEvaluate(equationsSet,elementNumber,err,error,*999)
CASE(EQUATIONS_SET_FITTING_CLASS)
CALL FlagError("Not implemented.",err,error,*999)
CASE(EQUATIONS_SET_BIOELECTRICS_CLASS)
CALL FlagError("Not implemented.",err,error,*999)
CASE(EQUATIONS_SET_MODAL_CLASS)
Expand Down
75 changes: 75 additions & 0 deletions src/field_routines.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1290,6 +1290,8 @@ MODULE FIELD_ROUTINES

PUBLIC FieldVariable_ParameterSetGet

PUBLIC Fields_AddField

PUBLIC Fields_Finalise,Fields_Initialise

PUBLIC MESH_EMBEDDING_PUSH_DATA, MESH_EMBEDDING_PULL_GAUSS_POINT_DATA, FIELD_PARAMETER_SET_GET_GAUSS_POINT_COORD
Expand Down Expand Up @@ -32067,6 +32069,79 @@ END SUBROUTINE FieldVariable_ParameterSetsCopyIfExists
!================================================================================================================================
!

!>Adds a field to a fields list
SUBROUTINE Fields_AddField(fields,field,err,error,*)

!Argument variables
TYPE(FIELDS_TYPE), POINTER :: fields !<A pointer to the fields to add a field to
TYPE(FIELD_TYPE), POINTER :: field !<The field to add
INTEGER(INTG), INTENT(OUT) :: err !<The error code
TYPE(VARYING_STRING), INTENT(OUT) :: error !<The error string
!Local Variables
INTEGER(INTG) :: fieldIdx
TYPE(FIELD_PTR_TYPE), POINTER :: newFields(:)

ENTERS("Fields_AddField",err,error,*999)

IF(.NOT.ASSOCIATED(field)) CALL FlagError("Field is not associated.",err,error,*999)
IF(.NOT.ASSOCIATED(fields)) THEN
ALLOCATE(fields,STAT=err)
IF(err/=0) CALL FlagError("Could not allocate fields.",err,error,*999)
CALL FIELDS_INITIALISE_GENERIC(fields,err,error,*999)
ENDIF
NULLIFY(newFields)
ALLOCATE(newFields(fields%NUMBER_OF_FIELDS+1),STAT=err)
IF(err/=0) CALL FlagError("Could not allocate new fields.",err,error,*999)
IF(fields%NUMBER_OF_FIELDS>0) THEN
IF(ASSOCIATED(fields%region)) THEN
IF(ASSOCIATED(field%region)) THEN
IF(.NOT.ASSOCIATED(fields%region,field%region)) &
& CALL FlagError("The specified field does not have the same region as the specified fields.",err,error,*999)
ELSE IF(ASSOCIATED(field%INTERFACE)) THEN
CALL FlagError("Can not add a field from an interface to fields that are from a region.",err,error,*999)
ELSE
CALL FlagError("Field does not have an associated region or interface.",err,error,*999)
ENDIF
ELSE IF(ASSOCIATED(fields%INTERFACE)) THEN
IF(ASSOCIATED(field%interface)) THEN
IF(.NOT.ASSOCIATED(fields%interface,field%interface)) &
& CALL FlagError("The specified field does not have the same interface as the specified fields.",err,error,*999)
ELSE IF(ASSOCIATED(field%region)) THEN
CALL FlagError("Can not add a field from a region to fields that are from an interface.",err,error,*999)
ELSE
CALL FlagError("Field does not have an associated region or interface.",err,error,*999)
ENDIF
ELSE
CALL FlagError("Fields does not have a region or interface.",err,error,*999)
ENDIF
ELSE
IF(ASSOCIATED(field%region)) THEN
fields%region=>field%region
ELSE IF(ASSOCIATED(field%INTERFACE)) THEN
fields%interface=>field%interface
ELSE
CALL FlagError("Field does not have an associated region or interface.",err,error,*999)
ENDIF
ENDIF
DO fieldIdx=1,fields%NUMBER_OF_FIELDS
newFields(fieldIdx)%ptr=>fields%fields(fieldIdx)%ptr
ENDDO !fieldIdx
newFields(fields%NUMBER_OF_FIELDS+1)%ptr=>field
IF(ASSOCIATED(fields%fields)) DEALLOCATE(fields%fields)
fields%fields=>newFields
fields%NUMBER_OF_FIELDS=fields%NUMBER_OF_FIELDS+1

EXITS("Fields_AddField")
RETURN
999 ERRORSEXITS("Fields_AddField",err,error)
RETURN 1

END SUBROUTINE Fields_AddField

!
!================================================================================================================================
!

!>Finalises the fields and deallocates all memory.
SUBROUTINE FIELDS_FINALISE(FIELDS,ERR,ERROR,*)

Expand Down
Loading