structuraid_core 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3be903647819b8980e89e0f8e1e984c3696735a254d10cc8de3a8928d56dac88
4
- data.tar.gz: d8c3b1c9b7aa1a8adf9d0edf4c82210c49ee2813bd9c309de0ec296018438231
3
+ metadata.gz: b01de831b96f114f85f1e9b0942bb793140c50425a564bad135ce06cb2b56554
4
+ data.tar.gz: 8bf897de647fe493060877279819266f495ee72cbaa843d815d588c7b8346932
5
5
  SHA512:
6
- metadata.gz: 4ea5df93f54fb0c95583a88c8b1006f89ca5cdd69b50f952d00361980b2fe350be17883b762ce67151a111ad0a0d7b714e3562e6a2d45bede013308f780bad86
7
- data.tar.gz: 8403c78e6ea124d31d38e87a6fbe2731f957acc8974337586c8c340ab847360f8426ce05b770740c3bd7ab858cb8c6d99213b59bb82bdd00e7cf2824987428c9
6
+ metadata.gz: c4804e1b46845546e655da89afb6a5f37909226001645ce0117b2a6cc4bb29992a818c900541eb7e9bd49934feeb208eabf1519c344fac24e481b6a65a995d34
7
+ data.tar.gz: 5498aca686ae447b04c983aca955e3008de5e83f8c63105001ec7ceb59858bf3904c91e71d88ba2d15847efa7a29408204ac75caaf92e9b66c7781153f1feac7
@@ -0,0 +1,81 @@
1
+ module StructuraidCore
2
+ module DesignCodes
3
+ module ACI31819
4
+ module RC
5
+ module Footings
6
+ class PunchingShearCapacity
7
+ COLUMN_LOCATION_FACTORS = {
8
+ interior: 40,
9
+ border: 30,
10
+ corner: 20
11
+ }.freeze
12
+
13
+ include DesignCodes::Utils::CodeRequirement
14
+ use_schema DesignCodes::Schemas::RC::Footings::PunchingShearCapacitySchema
15
+
16
+ # ACI 318-19 22.6.5.2
17
+ def call
18
+ [
19
+ basic_shear_capacity,
20
+ shear_capacity_modified_by_column_size,
21
+ shear_capacity_modified_by_column_location
22
+ ].min
23
+ end
24
+
25
+ private
26
+
27
+ def basic_shear_capacity
28
+ @basic_shear_capacity ||= 0.33 * Math.sqrt(design_compression_strength) *
29
+ light_concrete_modification_factor *
30
+ critical_section_perimeter *
31
+ effective_height *
32
+ size_effect_factor
33
+ end
34
+
35
+ def shear_capacity_modified_by_column_size
36
+ @shear_capacity_modified_by_column_size ||= 0.17 * Math.sqrt(design_compression_strength) *
37
+ light_concrete_modification_factor *
38
+ critical_section_perimeter *
39
+ effective_height *
40
+ (1 + 2 / column_aspect_ratio) *
41
+ size_effect_factor
42
+ end
43
+
44
+ def shear_capacity_modified_by_column_location
45
+ @shear_capacity_modified_by_column_location ||= 0.083 * Math.sqrt(design_compression_strength) *
46
+ light_concrete_modification_factor *
47
+ critical_section_perimeter *
48
+ effective_height *
49
+ column_location_factor *
50
+ size_effect_factor
51
+ end
52
+
53
+ def column_aspect_ratio
54
+ @column_aspect_ratio ||= column_sizes.max / column_sizes.min
55
+ end
56
+
57
+ def column_sizes
58
+ @column_sizes ||= [column_section_width.to_f, column_section_height.to_f]
59
+ end
60
+
61
+ def column_location_factor
62
+ unless COLUMN_LOCATION_FACTORS.keys.include?(column_location)
63
+ raise DesignCodes::UnrecognizedValueError.new('column_location', column_location)
64
+ end
65
+
66
+ @column_location_factor ||= COLUMN_LOCATION_FACTORS[column_location].to_f *
67
+ effective_height / critical_section_perimeter + 2
68
+ end
69
+
70
+ def size_effect_factor
71
+ @size_effect_factor ||= [
72
+ 1.0,
73
+ Math.sqrt(2 / (1 + 0.004 * effective_height))
74
+ ].min
75
+ end
76
+ end
77
+ end
78
+ end
79
+ end
80
+ end
81
+ end
@@ -0,0 +1,71 @@
1
+ module StructuraidCore
2
+ module DesignCodes
3
+ module NSR10
4
+ module RC
5
+ module Footings
6
+ class PunchingShearCapacity
7
+ COLUMN_LOCATION_FACTORS = {
8
+ interior: 40,
9
+ border: 30,
10
+ corner: 20
11
+ }.freeze
12
+
13
+ include DesignCodes::Utils::CodeRequirement
14
+ use_schema DesignCodes::Schemas::RC::Footings::PunchingShearCapacitySchema
15
+
16
+ # NSR-10 C.11.11.2.1
17
+ def call
18
+ [
19
+ basic_shear_capacity,
20
+ shear_capacity_modified_by_column_size,
21
+ shear_capacity_modified_by_column_location
22
+ ].min
23
+ end
24
+
25
+ private
26
+
27
+ def basic_shear_capacity
28
+ @basic_shear_capacity ||= 0.33 * Math.sqrt(design_compression_strength) *
29
+ light_concrete_modification_factor *
30
+ critical_section_perimeter *
31
+ effective_height
32
+ end
33
+
34
+ def shear_capacity_modified_by_column_size
35
+ @shear_capacity_modified_by_column_size ||= 0.17 * Math.sqrt(design_compression_strength) *
36
+ light_concrete_modification_factor *
37
+ critical_section_perimeter *
38
+ effective_height *
39
+ (1 + 2 / column_aspect_ratio)
40
+ end
41
+
42
+ def shear_capacity_modified_by_column_location
43
+ @shear_capacity_modified_by_column_location ||= 0.083 * Math.sqrt(design_compression_strength) *
44
+ light_concrete_modification_factor *
45
+ critical_section_perimeter *
46
+ effective_height *
47
+ column_location_factor
48
+ end
49
+
50
+ def column_aspect_ratio
51
+ @column_aspect_ratio ||= column_sizes.max / column_sizes.min
52
+ end
53
+
54
+ def column_sizes
55
+ @column_sizes ||= [column_section_width.to_f, column_section_height.to_f]
56
+ end
57
+
58
+ def column_location_factor
59
+ unless COLUMN_LOCATION_FACTORS.keys.include?(column_location)
60
+ raise DesignCodes::UnrecognizedValueError.new('column_location', column_location)
61
+ end
62
+
63
+ @column_location_factor ||= COLUMN_LOCATION_FACTORS[column_location].to_f *
64
+ effective_height / critical_section_perimeter + 2
65
+ end
66
+ end
67
+ end
68
+ end
69
+ end
70
+ end
71
+ end
@@ -0,0 +1,25 @@
1
+ module StructuraidCore
2
+ module DesignCodes
3
+ module Schemas
4
+ module RC
5
+ module Footings
6
+ class PunchingShearCapacitySchema
7
+ include DesignCodes::Utils::SchemaDefinition
8
+
9
+ required_params %i[
10
+ column_section_width
11
+ column_section_height
12
+ design_compression_strength
13
+ critical_section_perimeter
14
+ effective_height
15
+ light_concrete_modification_factor
16
+ column_location
17
+ ]
18
+
19
+ optional_params []
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
@@ -18,6 +18,9 @@ module StructuraidCore
18
18
  def call(params = {})
19
19
  schema_klass.validate!(params)
20
20
  sanitized_params = schema_klass.structurize(params)
21
+ sanitized_params.members.each do |param_name|
22
+ define_method(param_name) { sanitized_params[param_name] }
23
+ end
21
24
 
22
25
  obj = new(sanitized_params)
23
26
  obj.call
@@ -0,0 +1,9 @@
1
+ module StructuraidCore
2
+ module DesignCodes
3
+ class UnrecognizedValueError < StandardError
4
+ def initialize(name, value)
5
+ super("#{value} for #{name} param couldnt be recognized")
6
+ end
7
+ end
8
+ end
9
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module StructuraidCore
4
- VERSION = '0.1.1'
4
+ VERSION = '0.1.2'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: structuraid_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pradaing
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-03-14 00:00:00.000000000 Z
11
+ date: 2023-03-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: byebug
@@ -144,11 +144,14 @@ files:
144
144
  - lib/structuraid_core/db/base.rb
145
145
  - lib/structuraid_core/db/rebars.yml
146
146
  - lib/structuraid_core/design_codes/aci_318_19/rc/elastic_modulus.rb
147
+ - lib/structuraid_core/design_codes/aci_318_19/rc/footings/punching_shear_capacity.rb
147
148
  - lib/structuraid_core/design_codes/base.rb
148
149
  - lib/structuraid_core/design_codes/nsr_10/rc/elastic_modulus.rb
150
+ - lib/structuraid_core/design_codes/nsr_10/rc/footings/punching_shear_capacity.rb
149
151
  - lib/structuraid_core/design_codes/resolver.rb
150
152
  - lib/structuraid_core/design_codes/schemas/empty_schema.rb
151
153
  - lib/structuraid_core/design_codes/schemas/rc/elastic_modulus_schema.rb
154
+ - lib/structuraid_core/design_codes/schemas/rc/footings/punching_shear_capacity_schema.rb
152
155
  - lib/structuraid_core/design_codes/utils/code_requirement.rb
153
156
  - lib/structuraid_core/design_codes/utils/schema_definition.rb
154
157
  - lib/structuraid_core/elements/base.rb
@@ -170,6 +173,7 @@ files:
170
173
  - lib/structuraid_core/errors/base.rb
171
174
  - lib/structuraid_core/errors/design_codes/missing_param_error.rb
172
175
  - lib/structuraid_core/errors/design_codes/unknown_design_code_error.rb
176
+ - lib/structuraid_core/errors/design_codes/unrecognized_value_error.rb
173
177
  - lib/structuraid_core/errors/engineering/analysis/section_direction_error.rb
174
178
  - lib/structuraid_core/errors/reinforcement/empty_layers.rb
175
179
  - lib/structuraid_core/errors/reinforcement/invalid_distribution_direction.rb
@@ -182,7 +186,6 @@ files:
182
186
  - lib/structuraid_core/materials/steel.rb
183
187
  - lib/structuraid_core/version.rb
184
188
  - sig/structuraid_core.rbs
185
- - structuraid_core.gemspec
186
189
  homepage: https://github.com/PradaIng/structuraid-core
187
190
  licenses:
188
191
  - MIT
@@ -190,7 +193,7 @@ metadata:
190
193
  homepage_uri: https://github.com/PradaIng/structuraid-core
191
194
  source_code_uri: https://github.com/PradaIng/structuraid-core
192
195
  changelog_uri: https://github.com/PradaIng/structuraid-core/blob/main/CHANGELOG.md
193
- post_install_message:
196
+ post_install_message:
194
197
  rdoc_options: []
195
198
  require_paths:
196
199
  - lib
@@ -205,8 +208,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
205
208
  - !ruby/object:Gem::Version
206
209
  version: '0'
207
210
  requirements: []
208
- rubygems_version: 3.3.7
209
- signing_key:
211
+ rubygems_version: 3.3.26
212
+ signing_key:
210
213
  specification_version: 4
211
214
  summary: Gem with core utilities and functionality to design building structures
212
215
  test_files: []
@@ -1,50 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative 'lib/structuraid_core/version'
4
-
5
- Gem::Specification.new do |spec|
6
- spec.name = 'structuraid_core'
7
- spec.version = StructuraidCore::VERSION
8
- spec.authors = ['Pradaing']
9
- spec.email = ['engineering@pradic.co']
10
-
11
- spec.summary = 'Gem with core utilities and functionality to design building structures'
12
-
13
- description = <<-DESCRIPTION
14
- structuraid_core is a gem that offers a set of functionalities to assist in the design building structures.
15
- DESCRIPTION
16
- spec.description = description.strip
17
-
18
- spec.homepage = 'https://github.com/PradaIng/structuraid-core'
19
- spec.license = 'MIT'
20
- spec.required_ruby_version = '>= 3.1.2'
21
-
22
- # spec.metadata["allowed_push_host"] = "TODO: Set to your gem server 'https://example.com'"
23
- spec.metadata['homepage_uri'] = spec.homepage
24
- spec.metadata['source_code_uri'] = spec.homepage
25
- spec.metadata['changelog_uri'] = 'https://github.com/PradaIng/structuraid-core/blob/main/CHANGELOG.md'
26
-
27
- # Specify which files should be added to the gem when it is released.
28
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
29
- spec.files = Dir.chdir(__dir__) do
30
- `git ls-files -z`.split("\x0").reject do |f|
31
- (f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
32
- end
33
- end
34
- spec.bindir = 'exe'
35
- spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
36
- spec.require_paths = ['lib']
37
-
38
- spec.add_development_dependency 'byebug', '~> 11.1.3'
39
- spec.add_development_dependency 'guard-rspec', '~> 4.7.3'
40
- spec.add_development_dependency 'rspec', '~> 3.11.0'
41
- spec.add_development_dependency 'rubocop', '~> 1.41.1'
42
- spec.add_development_dependency 'rubocop-rspec', '~> 2.16.0'
43
- spec.add_development_dependency 'simplecov', '~> 0.22.0'
44
-
45
- spec.add_dependency 'rake', '~> 13.0.6'
46
- spec.add_dependency 'require_all', '~> 3.0.0'
47
-
48
- # For more information and examples about making a new gem, check out our
49
- # guide at: https://bundler.io/guides/creating_gem.html
50
- end