Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
nshmp-lib
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ghsc
National Seismic Hazard Model Project
nshmp-lib
Commits
d1d1542f
Commit
d1d1542f
authored
4 years ago
by
Powers, Peter M.
Browse files
Options
Downloads
Patches
Plain Diff
gss can have grid, zone, or slab type
parent
557df470
No related branches found
No related tags found
1 merge request
!146
Lib updates
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/gov/usgs/earthquake/nshmp/model/GridSourceSet.java
+16
-4
16 additions, 4 deletions
...n/java/gov/usgs/earthquake/nshmp/model/GridSourceSet.java
with
16 additions
and
4 deletions
src/main/java/gov/usgs/earthquake/nshmp/model/GridSourceSet.java
+
16
−
4
View file @
d1d1542f
...
...
@@ -54,6 +54,7 @@ import gov.usgs.earthquake.nshmp.tree.LogicTree;
*/
public
class
GridSourceSet
extends
AbstractSourceSet
<
PointSource
>
{
final
SourceType
type
;
final
List
<
Location
>
locations
;
final
List
<
Mfd
>
mfds
;
final
LogicTree
<
List
<
Mfd
>>
mfdsTree
;
...
...
@@ -86,6 +87,7 @@ public class GridSourceSet extends AbstractSourceSet<PointSource> {
private
GridSourceSet
(
Builder
builder
)
{
super
(
builder
);
this
.
type
=
builder
.
type
;
this
.
locations
=
builder
.
locations
;
this
.
mfds
=
builder
.
mfds
;
this
.
mfdsTree
=
builder
.
mfdsTree
;
...
...
@@ -105,8 +107,11 @@ public class GridSourceSet extends AbstractSourceSet<PointSource> {
*/
// System.out.println(Δm);
// this.optimizable = (sourceType() != FIXED_STRIKE) && !Double.isNaN(Δm);
this
.
optimizable
=
(
sourceType
()
!=
FIXED_STRIKE
)
&&
this
.
magMaster
.
isPresent
();
// TODO magMaster is always present, no?
this
.
optimizable
=
(
type
!=
SourceType
.
ZONE
)
&&
(
sourceType
()
!=
FIXED_STRIKE
)
&&
this
.
magMaster
.
isPresent
();
// System.out.println(Arrays.toString(magMaster.orElseThrow()));
double
[]
depthMags
=
this
.
mfds
.
get
(
0
).
data
().
xValues
().
toArray
();
...
...
@@ -136,7 +141,7 @@ public class GridSourceSet extends AbstractSourceSet<PointSource> {
@Override
public
SourceType
type
()
{
return
GRID
;
return
type
;
}
/**
...
...
@@ -252,6 +257,7 @@ public class GridSourceSet extends AbstractSourceSet<PointSource> {
private
static
final
String
ID
=
"GridSourceSet.Builder"
;
private
SourceType
type
;
private
List
<
Location
>
locations
=
Lists
.
newArrayList
();
private
List
<
Mfd
>
mfds
=
Lists
.
newArrayList
();
private
LogicTree
<
List
<
Mfd
>>
mfdsTree
;
...
...
@@ -269,6 +275,11 @@ public class GridSourceSet extends AbstractSourceSet<PointSource> {
private
Map
<
FocalMech
,
Double
>
mechMap
;
private
boolean
singularMechs
=
true
;
Builder
type
(
SourceType
type
)
{
this
.
type
=
type
;
return
this
;
}
Builder
strike
(
double
strike
)
{
this
.
strike
=
OptionalDouble
.
of
(
checkStrike
(
strike
));
this
.
sourceType
=
FIXED_STRIKE
;
...
...
@@ -411,8 +422,9 @@ public class GridSourceSet extends AbstractSourceSet<PointSource> {
@Override
void
validateState
(
String
buildId
)
{
super
.
validateState
(
buildId
);
checkState
(
type
!=
null
,
"%s source type not set"
,
buildId
);
checkState
(
strike
!=
null
,
"%s strike not set"
,
buildId
);
checkState
(
sourceType
!=
null
,
"%s source type not set"
,
buildId
);
checkState
(
sourceType
!=
null
,
"%s
point
source type not set"
,
buildId
);
checkState
(!
locations
.
isEmpty
(),
"%s has no locations"
,
buildId
);
checkState
(!
mfds
.
isEmpty
(),
"%s has no Mfds"
,
buildId
);
checkState
(
rupScaling
!=
null
,
"%s has no rupture-scaling relation set"
,
buildId
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment