Skip to content

Commit

Permalink
more outputField->Q
Browse files Browse the repository at this point in the history
  • Loading branch information
barnex committed Sep 26, 2016
1 parent 0c4c49b commit 4191238
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 3 additions & 5 deletions engine/average.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@ import (
)

// average of quantity over universe
func qAverageUniverse(q outputField) []float64 {
s, recycle := q.Slice()
if recycle {
defer cuda.Recycle(s)
}
func qAverageUniverse(q Q) []float64 {
s := ValueOf(q)
defer cuda.Recycle(s)
return sAverageUniverse(s)
}

Expand Down
7 changes: 4 additions & 3 deletions engine/crop.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,10 @@ func rangeStr(a, b int) string {
// (trailing underscore to separate from subsequent autosave number)
}

func (q *cropped) NComp() int { return q.parent.NComp() }
func (q *cropped) Name() string { return q.name }
func (q *cropped) Unit() string { return q.parent.Unit() }
func (q *cropped) NComp() int { return q.parent.NComp() }
func (q *cropped) Name() string { return q.name }
func (q *cropped) Unit() string { return q.parent.Unit() }
func (q *cropped) EvalTo(dst *data.Slice) { EvalTo(q, dst) }

func (q *cropped) Mesh() *data.Mesh {
c := q.parent.Mesh().CellSize()
Expand Down
3 changes: 2 additions & 1 deletion engine/parameter.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ func (p *regionwise) IsUniform() bool {
return true
}

func (p *regionwise) average() []float64 { return qAverageUniverse(p) }
func (p *regionwise) average() []float64 { return qAverageUniverse(p) }
func (p *regionwise) EvalTo(dst *data.Slice) { EvalTo(p, dst) }

// parameter derived from others (not directly settable). E.g.: Bsat derived from Msat
type DerivedParam struct {
Expand Down

0 comments on commit 4191238

Please sign in to comment.