58 INTEGER :: numsurfnp, &
67 INTEGER :: num_matches
71 INTEGER :: nfront_elem
80 TYPE(bound_elem
),
POINTER ::
next
86 TYPE(bound_elem
),
POINTER :: &
100 hi_tol = 100001.00000
117 OPEN(
unit = 40, file=
"fracSF.im",
status =
"OLD")
121 WRITE(6,
'(A,$)')
"Reading 'fracSF.im' file... "
127 READ(40,*) numsurfnp, numsurfelem
130 ALLOCATE(surfnode(numsurfnp))
133 ALLOCATE(frontsnode); first_frontsnode => frontsnode; nullify(frontsnode%next)
134 ALLOCATE(backsnode); first_backsnode => backsnode; nullify(backsnode%next)
140 READ(40,*) surfnode(l)%coord(1:3), surfnode(l)%marker
143 IF (surfnode(l)%coord(3) .LE. minz)
THEN
147 backsnode%coord(1:3) = surfnode(l)%coord(1:3)
148 backsnode%marker = surfnode(l)%marker
149 ALLOCATE(backsnode%next); backsnode => backsnode%next; nullify(backsnode%next)
152 numsurfsis = numsurfsis + 1
155 ELSE IF (surfnode(l)%coord(3) .GE. maxz)
THEN
159 frontsnode%coord(1:3) = surfnode(l)%coord(1:3)
160 frontsnode%marker = surfnode(l)%marker
161 ALLOCATE(frontsnode%next); frontsnode => frontsnode%next; nullify(frontsnode%next)
164 numsurfsisb = numsurfsisb + 1
169 elemlist => firstelem
172 ALLOCATE(front_elem); first_front_elem => front_elem; nullify(front_elem%next)
173 ALLOCATE(back_elem); first_back_elem => back_elem; nullify(back_elem%next)
176 ALLOCATE(surface(numsurfelem))
179 DO l = 1, numsurfelem
182 READ(40,*) surface(l)%conn(1:3), surface(l)%marker,
m,
n
188 IF(surfnode(
m)%coord(3) .GE. maxz)
THEN
194 IF (
m .EQ. surface(l)%conn(
n))
THEN
199 front_elem%conn(1:3) = surface(l)%conn(1:3)
200 front_elem%flag = surface(l)%marker
201 ALLOCATE(front_elem%next); front_elem => front_elem%next; nullify(front_elem%next)
204 nfront_elem = nfront_elem + 1
205 nboundryel = nboundryel + 1
213 ELSE IF (surfnode(
m)%coord(3) .LE. minz)
THEN
219 IF (
m .EQ. surface(l)%conn(
n))
THEN
224 back_elem%conn(1:3) = surface(l)%conn(1:3)
225 back_elem%flag = surface(l)%marker
226 ALLOCATE(back_elem%next); back_elem => back_elem%next; nullify(back_elem%next)
229 nback_elem = nback_elem + 1
230 nboundryel = nboundryel + 1
242 elemlist%conn(1:3) = surface(l)%conn(1:3)
245 elemlist%flag = surface(l)%marker
246 ALLOCATE(elemlist%next); elemlist => elemlist%next; nullify(elemlist%next)
261 WRITE(6,*)
"Number of back edge nodes: ", numsurfsisb
262 WRITE(6,*)
"Number of front edge nodes: ", numsurfsis
265 IF (numsurfsisb .EQ. numsurfsis)
THEN
266 WRITE(6,*)
"...node quantities confirmed."
269 WRITE(6,*)
"There was an error in calculating the number of matching edge nodes."
274 100 frontsnode => first_frontsnode
275 backsnode => first_backsnode
276 iteration = iteration + 1
279 WRITE(6,*)
"Beginning search on sister nodes..."
282 DO WHILE(
associated(backsnode%next))
285 DO WHILE(
associated(frontsnode%next))
289 IF ((backsnode%coord(1) .EQ. frontsnode%coord(1)) .OR. &
290 ((backsnode%coord(1)/frontsnode%coord(1) .GT. low_tol/100000) .AND. &
291 (backsnode%coord(1)/frontsnode%coord(1) .LT. hi_tol/100000)))
THEN
295 IF((backsnode%coord(2) .EQ. frontsnode%coord(2)) .OR. &
296 ((backsnode%coord(2)/frontsnode%coord(2) .GT. low_tol/100000) .AND. &
297 (backsnode%coord(2)/frontsnode%coord(2) .LT. hi_tol/100000)))
THEN
299 backsnode%sister => frontsnode
300 frontsnode%sister => backsnode
303 num_matches = num_matches + 1
309 frontsnode => frontsnode%next
314 backsnode => backsnode%next
315 frontsnode => first_frontsnode
318 WRITE(6,*)
"Number of verified matches: ", num_matches
319 WRITE(6,*)
"Number of intended matches: ", numsurfsis
322 WRITE(6,*)
"Writing node match information to 'nodematch.dat' file..."
326 OPEN(
unit = 500, file =
'2Dnodematch.dat',
status =
'UNKNOWN')
328 WRITE(500,
'(A8,3(6X,A1,5X),5X,A9,3(6X,A1,5X))') &
329 "BACKNODE",
"X",
"Y",
"Z",
"FRONTNODE",
"X",
"Y",
"Z"
331 frontsnode => first_frontsnode
332 backsnode => first_backsnode
334 DO WHILE(
associated(frontsnode%next) .AND.
associated(backsnode%next))
335 WRITE(500,
'(I8,3F12.8,6X,I8,3F12.8)') backsnode%ID, backsnode%coord(1:3), &
336 backsnode%sister%ID, backsnode%sister%coord(1:3)
337 frontsnode => frontsnode%next
338 backsnode => backsnode%next
345 IF (iteration .LE. max_iterations)
THEN
346 IF (numsurfsis .NE. num_matches)
THEN
347 WRITE(6,*)
"There was a failure in matching up the desired number of nodes."
348 WRITE(6,*)
"Redefining tolerances and starting iteration number ", iteration
349 low_tol = low_tol - step
350 hi_tol = hi_tol + step
352 ELSE IF (numscale_np/2 .EQ. num_matches)
THEN
353 WRITE(6,*)
"Number of matches confirmed. Proceeding to next step."
362 OPEN(
unit = 45, file = prefix(1:length(prefix))//
'/fracSF.im', &
372 WRITE(45,*) numsurfnp, numsurfelem
377 WRITE(45,*) surfnode(l)%coord(1:3), surfnode(l)%marker,0
381 elemlist => firstelem
382 front_elem => first_front_elem
383 back_elem => first_back_elem
387 DO WHILE(
associated(back_elem%next))
388 WRITE(45,*) back_elem%conn(1:3), back_elem%flag,
m,
n
389 back_elem => back_elem%next
394 DO WHILE(
associated(front_elem%next))
395 WRITE(45,*) front_elem%conn(1:3), front_elem%flag,
m,
n
396 front_elem => front_elem%next
401 DO WHILE(
associated(elemlist%next))
402 WRITE(45,*) elemlist%conn(1:3), elemlist%flag,
m,
n
403 elemlist => elemlist%next
408 surfnode(l)%coord(3) = surfnode(l)%coord(3) + ztrans
414 OPEN(
unit = 45, file = prefix(1:length(prefix))//
'/fracS.im', &
int status() const
Obtain the status of the attribute.
const std::string & unit() const
Obtain the unit of the attribute.
void scale(const Real &a, Nodal_data &x)
unsigned long id(const Leda_like_handle &x)
void next()
Go to the next element within the connectivity tables of a pane.