Finds the center of area.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(marker_set), | intent(inout) | :: | this |
A collection of tessellation elements |
Position of center of area
impure function marker_set_CoM(this) result(CoM) !> Finds the center of area. implicit none class(marker_set), intent(inout) :: this !! A collection of tessellation elements real(wp) :: CoM(3) !! Position of center of area ! Work variables real(wp):: CoM_(3),SA_,SA SA_=0.0_wp CoM_=0.0_wp if (this%count_.gt.0) then select type(markers=>this%p) type is (marker_obj) SA_ = sum(markers(1:this%count_)%SA) CoM_(1)=sum(markers(1:this%count_)%SA*markers(1:this%count_)%p(1)) CoM_(2)=sum(markers(1:this%count_)%SA*markers(1:this%count_)%p(2)) CoM_(3)=sum(markers(1:this%count_)%SA*markers(1:this%count_)%p(3)) end select end if call this%parallel%Sum(SA_ ,SA ) call this%parallel%Sum(CoM_(1),CoM(1)) call this%parallel%Sum(CoM_(2),CoM(2)) call this%parallel%Sum(CoM_(3),CoM(3)) CoM=CoM/SA return end function marker_set_CoM