Skip to content

Commit

Permalink
Updates for macro-micro call
Browse files Browse the repository at this point in the history
  • Loading branch information
kalupaika committed Jan 17, 2024
1 parent c6260fe commit dc01332
Show file tree
Hide file tree
Showing 15 changed files with 5,229 additions and 777 deletions.
337 changes: 154 additions & 183 deletions CalculiX.h
100644 → 100755

Large diffs are not rendered by default.

261 changes: 184 additions & 77 deletions adapter/CCXHelpers.c
100644 → 100755

Large diffs are not rendered by default.

61 changes: 15 additions & 46 deletions adapter/CCXHelpers.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@
*/
enum xloadVariable { DFLUX,
FILM_H,
FILM_T,
PRESSUREDLOAD };
FILM_T };

/**
* @brief Type of coupling data
Expand All @@ -47,22 +46,23 @@ enum CouplingDataType { TEMPERATURE,
SINK_TEMPERATURE,
HEAT_TRANSFER_COEFF,
FORCES,
PRESSURE,
DISPLACEMENTS,
DISPLACEMENTDELTAS,
VELOCITIES,
POSITIONS };

/**
* @brief Type of element used for faces mesh, where we assume only one type of element is used.
* TETRAHEDRA - C3D4 or C3D10 element
* HEXAHEDRA - C3D8 or C3D20 elment
* INVALID_ELEMENT - Anything else
*/
enum ElemType { TETRAHEDRA,
HEXAHEDRA,
INVALID_ELEMENT,
};
POSITIONS,
RVE_ID,
STRAIN_NORM,
STRAIN_SHEAR,
STRESS_NORM,
STRESS_SHEAR,
MATERTIAL_TANGENT_1,
MATERTIAL_TANGENT_2,
MATERTIAL_TANGENT_3,
MATERTIAL_TANGENT_4,
MATERTIAL_TANGENT_5,
MATERTIAL_TANGENT_6,
MATERTIAL_TANGENT_7,
};

/**
* @brief Returns node set name with internal CalculiX format
Expand Down Expand Up @@ -180,18 +180,6 @@ void getNodeDisplacementDeltas(ITG *nodes, ITG numNodes, int dim, double *v, dou
*/
void getTetraFaceCenters(ITG *elements, ITG *faces, ITG numElements, ITG *kon, ITG *ipkon, double *co, double *faceCenters);

/**
* @brief Computes the center of one of the faces of a hexahedral element
* @param elements: input list of hexahedral elements
* @param faces: input list of local face IDs
* @param numElements: number of input elements
* @param kon: CalculiX variable
* @param ipkon: CalculiX variable
* @param co: CalculiX array with the coordinates of all the nodes
* @param faceCenters: output array with the face centers of the input element faces
*/
void getHexaFaceCenters(ITG *elements, ITG *faces, ITG numElements, ITG *kon, ITG *ipkon, double *co, double *faceCenters);

/**
* @brief Gets a list of node IDs from a list of input element faces
* @param elements: list of element IDs
Expand Down Expand Up @@ -278,15 +266,6 @@ void setFaceHeatTransferCoefficients(double *coefficients, ITG numFaces, int *xl
*/
void setFaceSinkTemperatures(double *sinkTemperatures, ITG numFaces, int *xloadIndices, double *xload);

/**
* @brief Calls setXload to update the pressure at the specified indices
* @param pressure: values for the pressure
* @param numFaces: number of faces
* @param xloadIndices: indices of the xload array where the values must be updated
* @param xload: CalculiX array for the loads
*/
void setFacePressure(double *pressure, int numFaces, int *xloadIndices, double *xload);

/**
* @brief Modifies the values of the temperature boundary condition
* @param temperatures: temperature values to apply
Expand Down Expand Up @@ -434,11 +413,6 @@ void missingTemperatureBCError();
*/
void missingForceError();

/**
* @brief Terminate program if pressure faces are not defined (e.g. missing interface.dlo file)
*/
void missingPressureError();

/**
* @brief Terminate program if displacement Dirichlet BC are not defined for the interface in .inp file. (e.g. missing line under *BOUNDARY)
*/
Expand All @@ -459,9 +433,4 @@ void missingFilmBCError();
*/
void unreachableError();

/**
* @brief Terminate program if the CalculiX ELement Type is not supported for this type of analysis.
*/
void supportedElementError();

#endif // CCXHELPERS_H
5 changes: 5 additions & 0 deletions adapter/ConfigReader.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ void ConfigReader_Read(char const *configFilename, char const *participantName,
interface.facesMeshName = strdup(config["participants"][participantName]["interfaces"][i]["mesh"].as<std::string>().c_str());
}


if (config["participants"][participantName]["interfaces"][i]["elements"]) {
interface.elementsMeshName = strdup(config["participants"][participantName]["interfaces"][i]["elements"].as<std::string>().c_str());
}

std::string patchName = config["participants"][participantName]["interfaces"][i]["patch"].as<std::string>();
std::transform(patchName.begin(), patchName.end(), patchName.begin(), toupper);
interface.patchName = strdup(patchName.c_str());
Expand Down
3 changes: 2 additions & 1 deletion adapter/ConfigReader.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
typedef struct InterfaceConfig {
char * facesMeshName;
char * nodesMeshName;
char * elementsMeshName;
char * patchName;
int map;
int numWriteData;
Expand Down Expand Up @@ -43,7 +44,7 @@ void ConfigReader_Read(char const *configFilename, char const *participantName,
* @precondition adapterConfig points to an initialized instance of adapterConfig.
* @precondition ConfigReader_Read was called on adapterConfig.
* @postcondition all memory held by the struct adapterConfig is freed
* @note This function does not free the pointer adapterConfig
* @note This function does not free the pointer adapterConfig
*/
void AdapterConfig_Free(AdapterConfig *adapterConfig);

Expand Down
Empty file modified adapter/ConfigReader.hpp
100644 → 100755
Empty file.
Loading

0 comments on commit dc01332

Please sign in to comment.