@@ -1913,6 +1913,8 @@ RECURSIVE SUBROUTINE build_one_hermite_cable(ln, sections, types, points, opts,
19131913 LOGICAL :: tensile_error
19141914 CHARACTER(1024) :: note_text
19151915 CHARACTER(1024) :: limit_text
1916+ ! the still-water diagnosis read its compression on elements longer than half the bending length
1917+ LOGICAL :: coarse_sw
19161918 ! The geometric cause of a line with no admissible planar equilibrium clear of the seabed:
19171919 ! too long to hang as a catenary (net-heavy), or weightless (no catenary exists at all).
19181920 LOGICAL :: weightless_line
@@ -3115,8 +3117,13 @@ RECURSIVE SUBROUTINE build_one_hermite_cable(ln, sections, types, points, opts,
31153117 ! route diagnostics below are bounded and would cut it. A line already compressed
31163118 ! without the current is named before that: the current starts from that layout.
31173119 limit_text = ''
3118- IF (opts%has_current) CALL still_water_compression(limit_text)
3119- IF (LEN_TRIM(limit_text) > 0) THEN
3120+ IF (opts%has_current) CALL still_water_compression(limit_text, coarse_sw)
3121+ IF (LEN_TRIM(limit_text) > 0 .AND. coarse_sw) THEN
3122+ CALL fail_solve(ErrStat, ErrMsg, 'finite-EI cable static solve failed in the current: '// &
3123+ TRIM(limit_text)//'. Catenary-continuation route: '// &
3124+ TRIM(short_message(primary_msg, 360))//'. Mesh-sequenced route: '// &
3125+ TRIM(short_message(sequence_msg, 360))); RETURN
3126+ ELSE IF (LEN_TRIM(limit_text) > 0) THEN
31203127 CALL fail_solve(ErrStat, ErrMsg, 'finite-EI cable has no static equilibrium in the current: '// &
31213128 TRIM(limit_text)//'. Catenary-continuation route: '// &
31223129 TRIM(short_message(primary_msg, 360))//'. Mesh-sequenced route: '// &
@@ -4234,18 +4241,25 @@ SUBROUTINE audit_refined_state(done, why)
42344241 END IF
42354242 END SUBROUTINE audit_refined_state
42364243
4237- SUBROUTINE still_water_compression(text)
4244+ SUBROUTINE still_water_compression(text, coarse )
42384245 !! On a failed solve in a current: whether the same line without the current is
42394246 !! already in axial compression (an element-mean force below -1e-3 of the peak
42404247 !! tension, held only by the bending stiffness). Returns the diagnosis, or blank.
4248+ !! coarse: the still-water state is on elements longer than half the bending length
4249+ !! (EI/|w|)^(1/3), where the element-mean axial force of a stiff line oscillates and can
4250+ !! read a compression the line does not carry; the diagnosis then says so instead of
4251+ !! naming the layout (a lazy wave on 4 m and 10 m elements beside 0.9 m ones read
4252+ !! -2.8 kN where it carries about +1 kN, and solves on a mesh that resolves its bends).
42414253 CHARACTER(*), INTENT(OUT) :: text
4254+ LOGICAL, INTENT(OUT) :: coarse
42424255 TYPE(DeckOptions) :: opts_sw
42434256 TYPE(CD_HFMF_ModuleType) :: sw_cable
42444257 INTEGER :: sw_node, esw, e_min, wios
4245- REAL(wp) :: t_min, t_max, s_min
4258+ REAL(wp) :: t_min, t_max, s_min, need
42464259 CHARACTER(1024) :: emw
42474260 CHARACTER(2048) :: sw_note
42484261 text = ''
4262+ coarse = .FALSE.
42494263 opts_sw = opts
42504264 opts_sw%has_current = .FALSE.
42514265 opts_sw%has_current_profile = .FALSE.
@@ -4265,10 +4279,21 @@ SUBROUTINE still_water_compression(text)
42654279 CALL CD_HermiteCable_Mean_Axial_Extremes(sw_cable%line%l0, sw_cable%line%EA, sw_cable%line%q, t_min, &
42664280 t_max, e_min, s_min, esw, emw)
42674281 IF (esw == CD_HCSTAT_OK .AND. t_min < -1.0e-3_wp*t_max) THEN
4268- WRITE (text, '(A,ES10.3,A,F10.2,A,ES10.3,A)', IOSTAT=wios) 'the line is already in axial '// &
4269- 'compression without the current (element mean ', t_min, ' N at unstretched arc length ', &
4270- s_min, ' m from the anchor, peak tension ', t_max, ' N), a layout that only its bending '// &
4271- 'stiffness holds; the current pushes that layout further and no equilibrium follows it'
4282+ need = bending_refine_need(sw_cable%line%l0, sw_cable%line%EI, sw_cable%line%w)
4283+ coarse = need > CD_ONE
4284+ IF (coarse) THEN
4285+ WRITE (text, '(A,ES10.3,A,F10.2,A,ES10.3,A,F6.2,A)', IOSTAT=wios) 'without the current the line '// &
4286+ 'reads an element-mean axial compression (', t_min, ' N at unstretched arc length ', s_min, &
4287+ ' m from the anchor, peak tension ', t_max, ' N) on elements up to ', need, ' times half the '// &
4288+ 'bending length (EI/|w|)^(1/3), where the element-mean axial force of a stiff line oscillates '// &
4289+ 'and can read a compression the line does not carry; refine those elements (NumSegs) to half '// &
4290+ 'the bending length or less'
4291+ ELSE
4292+ WRITE (text, '(A,ES10.3,A,F10.2,A,ES10.3,A)', IOSTAT=wios) 'the line is already in axial '// &
4293+ 'compression without the current (element mean ', t_min, ' N at unstretched arc length ', &
4294+ s_min, ' m from the anchor, peak tension ', t_max, ' N), a layout that only its bending '// &
4295+ 'stiffness holds; the current pushes that layout further and no equilibrium follows it'
4296+ END IF
42724297 END IF
42734298 END IF
42744299 CALL CD_HFMF_End(sw_cable)
@@ -7043,9 +7068,119 @@ RECURSIVE SUBROUTINE graded_restart()
70437068 END SUBROUTINE graded_restart
70447069
70457070 RECURSIVE SUBROUTINE refined_restart()
7046- !! Repeat the route on a uniformly refined mesh (power of two, capped) when the
7047- !! deck mesh is longer than half the bending length (EI/|w|)^(1/3) somewhere. The
7071+ !! Repeat the route on a refined mesh when the deck mesh is longer than half the bending
7072+ !! length (EI/|w|)^(1/3) somewhere: uniformly refined (uniform_restart), then, when that
7073+ !! fails, with each element split only as far as the rule asks of it (rule_restart). The
70487074 !! refined equilibrium is returned in the *_am outputs like an adaptive refinement.
7075+ CALL uniform_restart()
7076+ IF (ErrStat /= CD_HCSTAT_OK .AND. .NOT. inadmissible) CALL rule_restart()
7077+ END SUBROUTINE refined_restart
7078+
7079+ RECURSIVE SUBROUTINE rule_restart()
7080+ !! Repeat the route on the deck mesh with every element split into the power of two
7081+ !! (capped) that brings it to half its bending length (EI/|w|)^(1/3), the elements that
7082+ !! meet the rule kept. A uniform refinement by the largest factor keeps the deck's grading
7083+ !! and refines the short elements beside the long ones as well: on a lazy wave meshed
7084+ !! 4 m / 0.9 m / 10 m (the buoyant section refined, the sag bend and the touchdown
7085+ !! coarse) the long elements' axial force oscillated into compression beside the short
7086+ !! ones, the 8x refined mesh stalled at the start of its stiffness continuation, and the
7087+ !! deck failed in an oblique current although the same layout solves on 2 m elements.
7088+ !! Not run when the rule asks the same factor of every element (the uniform refinement
7089+ !! was that mesh) or more than REFINED_MAX_ELEMENTS elements.
7090+ INTEGER, PARAMETER :: REFINED_MAX_ELEMENTS = 4096
7091+ REAL(wp), ALLOCATABLE :: l0_g(:), ea_g(:), ei_g(:), w_g(:), diam_g(:), dry_g(:)
7092+ INTEGER, ALLOCATABLE :: fixed_g(:), parent_g(:), node_of(:), split(:)
7093+ LOGICAL, ALLOCATABLE :: fixed_map(:, :)
7094+ LOGICAL :: planar, inadm_g, walked_sub
7095+ INTEGER :: k, j, n_g, nf, es_g, slot, piece
7096+ REAL(wp) :: need
7097+ CHARACTER(1024) :: em_g
7098+ IF (PRESENT(refined_pass) .OR. fold) RETURN
7099+ ALLOCATE (split(ne))
7100+ split = 1
7101+ DO k = 1, ne
7102+ IF (.NOT. (ei(k) > CD_ZERO .AND. ABS(w(k)) > CD_ZERO)) CYCLE
7103+ need = l0(k)/(0.5_wp*(ei(k)/ABS(w(k)))**(CD_ONE/3.0_wp))
7104+ DO WHILE (REAL(split(k), wp) < need .AND. split(k) < CD_HC_REFINE_CAP)
7105+ split(k) = 2*split(k)
7106+ END DO
7107+ END DO
7108+ IF (ALL(split == 1)) RETURN
7109+ IF (ALL(split == MAXVAL(split))) RETURN
7110+ n_g = SUM(split)
7111+ IF (n_g > REFINED_MAX_ELEMENTS) RETURN
7112+ ALLOCATE (l0_g(n_g), parent_g(n_g), node_of(nnode))
7113+ j = 0
7114+ node_of(1) = 1
7115+ DO k = 1, ne
7116+ DO piece = 1, split(k)
7117+ j = j + 1
7118+ l0_g(j) = l0(k)/REAL(split(k), wp)
7119+ parent_g(j) = k
7120+ END DO
7121+ node_of(k + 1) = j + 1
7122+ END DO
7123+ ALLOCATE (ea_g(n_g), ei_g(n_g), w_g(n_g), diam_g(n_g), dry_g(n_g))
7124+ ea_g = ea(parent_g); ei_g = ei(parent_g); w_g = w(parent_g)
7125+ diam_g = diam(parent_g); dry_g = dry_b(parent_g)
7126+ ! Held DOFs: the deck nodes keep theirs; inserted nodes take the out-of-plane reduction
7127+ ! (y, m_y) when the deck holds it on every node (as graded_restart).
7128+ ALLOCATE (fixed_map(6, nnode))
7129+ fixed_map = .FALSE.
7130+ DO k = 1, SIZE(fixed_dofs)
7131+ fixed_map(MOD(fixed_dofs(k) - 1, 6) + 1, (fixed_dofs(k) - 1)/6 + 1) = .TRUE.
7132+ END DO
7133+ planar = ALL(fixed_map(2, :))
7134+ ALLOCATE (fixed_g(6*(n_g + 1)))
7135+ nf = 0
7136+ k = 1
7137+ DO j = 1, n_g + 1
7138+ IF (k <= nnode) THEN
7139+ IF (node_of(k) == j) THEN
7140+ DO slot = 1, 6
7141+ IF (fixed_map(slot, k)) THEN
7142+ nf = nf + 1; fixed_g(nf) = 6*(j - 1) + slot
7143+ END IF
7144+ END DO
7145+ k = k + 1
7146+ CYCLE
7147+ END IF
7148+ END IF
7149+ IF (planar) THEN
7150+ nf = nf + 1; fixed_g(nf) = 6*(j - 1) + 2
7151+ nf = nf + 1; fixed_g(nf) = 6*(j - 1) + 5
7152+ END IF
7153+ END DO
7154+ IF (PRESENT(bathymetry)) THEN
7155+ CALL hermite_static_primary(anchor, fairlead, l0_g, ea_g, ei_g, w_g, diam_g, dry_g, fixed_g(1:nf), &
7156+ contact_enabled, contact_z, frame_cs, endconn_k, endconn_d0, endconn_mode, &
7157+ opts, static_tol, l0_am, ea_am, ei_am, w_am, q_static, curv, fixed_am, &
7158+ applied_scale, diag, res, iters, es_g, em_g, inadm_g, tolerance_note, &
7159+ kink_refined, bathymetry=bathymetry, refined_pass=.TRUE., cur_obj=cur_obj, &
7160+ walked=walked_sub, fold_walk=fold)
7161+ ELSE
7162+ CALL hermite_static_primary(anchor, fairlead, l0_g, ea_g, ei_g, w_g, diam_g, dry_g, fixed_g(1:nf), &
7163+ contact_enabled, contact_z, frame_cs, endconn_k, endconn_d0, endconn_mode, &
7164+ opts, static_tol, l0_am, ea_am, ei_am, w_am, q_static, curv, fixed_am, &
7165+ applied_scale, diag, res, iters, es_g, em_g, inadm_g, tolerance_note, &
7166+ kink_refined, refined_pass=.TRUE., cur_obj=cur_obj, walked=walked_sub, &
7167+ fold_walk=fold)
7168+ END IF
7169+ IF (es_g == CD_HCSTAT_OK) THEN
7170+ ErrStat = CD_HCSTAT_OK
7171+ ErrMsg = ''
7172+ kink_refined = .TRUE.
7173+ inadmissible = .FALSE.
7174+ IF (PRESENT(walked)) walked = walked_sub
7175+ ELSE
7176+ ErrMsg = TRIM(ErrMsg)//'; on the mesh refined element by element to the bending length: '//TRIM(em_g)
7177+ IF (inadm_g) inadmissible = .TRUE.
7178+ END IF
7179+ END SUBROUTINE rule_restart
7180+
7181+ RECURSIVE SUBROUTINE uniform_restart()
7182+ !! The route on a uniformly refined mesh (power of two, capped) when the deck mesh is
7183+ !! longer than half the bending length somewhere (refined_restart).
70497184 REAL(wp), ALLOCATABLE :: l0_r(:), q_r(:), q_ref_r(:), ea_r(:), ei_r(:), w_r(:), diam_r(:), dry_r(:)
70507185 INTEGER, ALLOCATABLE :: fixed_r(:)
70517186 INTEGER :: scale, scale_need, k, es_r, parent
@@ -7111,7 +7246,7 @@ RECURSIVE SUBROUTINE refined_restart()
71117246 IF (INDEX(em_r, 'iteration budget') == 0) RETURN
71127247 scale = scale/2
71137248 END DO
7114- END SUBROUTINE refined_restart
7249+ END SUBROUTINE uniform_restart
71157250
71167251 SUBROUTINE polish_with_floor()
71177252 !! Polish at the tight tolerance; accept the coupled static tolerance when the
0 commit comments