Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timber Connention Design #321

Closed
madil4 opened this issue Apr 23, 2024 · 1 comment · Fixed by #325
Closed

Timber Connention Design #321

madil4 opened this issue Apr 23, 2024 · 1 comment · Fixed by #325
Assignees

Comments

@madil4
Copy link
Owner

madil4 commented Apr 23, 2024

Here is the missing part that we brainstormed about in our last meeting. We will create a higher-level function (design per nodes). This function will take all the nodes and elements, along with their associated analysis/design results. It will then determine which elements are connected to the connection node under consideration. Subsequently, it will pass the filtered inputs to a lower-level function for each element, matching your architecture in Python/Typescript.

I've highlighted the main part of the function for clarity. You can implement and test this function in isolation. Unfortunately, I don't yet have documentation about Awatif's architecture as a whole, but I'm working on it. Feel free to ask if you want to understand the big picture.

Also, feel free to change the naming or anything if you think it is better, nothing is concrete yet.

// in awatif-design/src/timber/ConnectionTimberDesign.ts

import {
  AnalysisInput,
  AnalysisOutput,
  Element,
  Node,
} from "../../../../awatif-data-structure/src";

export type ConnectionTimberDesignInput = {
  node: number;
  ConnectionTimberDesign: {
    serviceClass: number;
    sheetGrade: string;
    ...others
  };
};

export type ConnectionTimberDesignOutput = {
  node: number;
  ConnectionTimberDesign: {
    utilizationFactor: number;
    designPerElements: { gamma: number,fastenerCheck:number, ...others }[];
  };
};

export function ConnectionTimberDesign(
  nodes: Node[],
  elements: Element[],
  analysisInputs: AnalysisInput[],
  analysisOutputs: AnalysisOutput[],
  designInput: ConnectionTimberDesignInput,
): ConnectionTimberDesignOutput {
  // from the nodes and elements list you can know which elements are connected to the connection
  const connectionElements = [0,2,3];

  // loop through the elements and compute the outputs of each element as you did in Python and Typescript
  const designPerElements = []
  connectionElements.forEach((index)=>{
    // you can get the axial force by searching in the analysisOutputs using the element index
    // similarly you can get serviceClass in designInput
    const designOutput = frameConnectionTimberDesign(axialForces,width,serviceClass,...otherInputs,)

    designPerElements.push(designOutput)
  })

  return {
    node: 1,
    ConnectionTimberDesign: {
      utilizationFactor: 0.89,
      designPerElements: designPerElements
    }
  }
}

// a separate function to design the connection per element as you did in Python and Typescript 
function frameConnectionTimberDesign() {

}
@madil4
Copy link
Owner Author

madil4 commented Apr 30, 2024

I forgot to mention an important logic regarding the connection design. The 'design' function we talked about yesterday is responsible for filtering the analysis input/output and passing them to the sub-functions. We need to adjust this function so it checks if the design function has an element or node. If it is an element then filter the input as I did for the member design, if it is a node then don't filter the analysis inputs/outputs just pass them along with the nodes and elements. Here is a rough example:

// in awatif-design/src/design.ts
  designFunctions.forEach((designFunction) => {
    designInputs.forEach((designInput) => {
      if (designFunction.name in designInput) {
        const element = designInput.element;
        const node = designInput.node;

        if (element) {
          const analysisInput = analysisInputs.find(
            (i) => (i as any).element == element
          );
          const analysisOutput = analysisOutputs["default"].find(
            (i) => (i as any).element == element
          );
  
          if (analysisInput && analysisOutput) {
            designOutputs.push(
              designFunction(analysisInput, analysisOutput, designInput)
            );
          }
       }

      if (node) {
            designOutputs.push(
              designFunction(nodes, elements, analysisInputs, analysisOutputs, designInput)
            );
      }

      }
    });
  });

calmense added a commit that referenced this issue May 1, 2024
calmense added a commit that referenced this issue May 4, 2024
calmense added a commit that referenced this issue May 6, 2024
madil4 pushed a commit that referenced this issue May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants