Skip to content

Commit 1bdacb2

Browse files
fixed default rules
1 parent 65df6d7 commit 1bdacb2

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

data/default_rules.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@
119119
{
120120
"pointer": "/geometry/*/transformation/translation",
121121
"type": "list",
122-
"default": null,
122+
"default": [],
123123
"doc": "Translate, 2 entries for 2D problems, 3 entries for 3D problems."
124124
},
125125
{
@@ -794,31 +794,31 @@
794794
{
795795
"pointer": "/materials/*/id",
796796
"type":"int",
797-
"default": "all",
797+
"default": 0,
798798
"doc":"id"
799799
},
800800
{
801801
"pointer": "/materials/*/E",
802802
"type":"float",
803-
"default":"-9999",
803+
"default":-9999,
804804
"doc":"Young's modulus"
805805
},
806806
{
807807
"pointer": "/materials/*/nu",
808808
"type":"float",
809-
"default":"-9999",
809+
"default":-9999,
810810
"doc":"Poisson ratio"
811811
},
812812
{
813813
"pointer": "/materials/*/rho",
814814
"type":"float",
815-
"default":"-9999",
815+
"default":-9999,
816816
"doc":"Density"
817817
},
818818
{
819819
"pointer": "/materials/*/density",
820820
"type":"float",
821-
"default":"-9999",
821+
"default":-9999,
822822
"doc":"Density"
823823
},
824824
{
@@ -829,13 +829,13 @@
829829
{
830830
"pointer": "/materials/*/mu",
831831
"type":"float",
832-
"default":"-9999",
832+
"default":-9999,
833833
"doc":"//TODO"
834834
},
835835
{
836836
"pointer": "/materials/*/lambda",
837837
"type":"float",
838-
"default":"-9999",
838+
"default":-9999,
839839
"doc":"//TODO"
840840
},
841841
{

src/jse/jse.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ namespace jse
4747

4848
bool JSE::verify_json(const string &pointer, json &input, const json &rules)
4949
{
50-
// if (pointer == "/list1/*")
50+
// if (pointer == "/common")
5151
// std::cout << "gotcha" << std::endl;
5252
// Find all rules that apply for the input node
5353
// TODO: accelerate this
@@ -186,6 +186,7 @@ namespace jse
186186
};
187187
bool JSE::verify_rule(const json &input, const json &rule)
188188
{
189+
// std::cout << "Verifying " << input << std::endl;
189190
string type = rule.at("type");
190191
if (type == "list")
191192
return verify_rule_list(input, rule);
@@ -226,7 +227,7 @@ namespace jse
226227
return false;
227228
}
228229

229-
if (rule.contains("extensions"))
230+
if (!skip_file_check && rule.contains("extensions"))
230231
{
231232
std::string ext = p.extension();
232233
int count = 0;

0 commit comments

Comments
 (0)