Skip to content

Commit

Permalink
Merge pull request #107 from simbilod/48-separate-cad-definition-and-…
Browse files Browse the repository at this point in the history
…meshing

48 separate cad definition and meshing
  • Loading branch information
simbilod authored Jan 2, 2025
2 parents 25230b1 + 5cfcc34 commit e14cf8e
Show file tree
Hide file tree
Showing 11 changed files with 515 additions and 77 deletions.
1 change: 1 addition & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- importing gds function and example [PR#102](https://github.com/simbilod/meshwell/pull/102)
- refactor meshing into more manageable chunks, fixing [issue#87](https://github.com/simbilod/meshwell/issues/87) [PR#105](https://github.com/simbilod/meshwell/pull/105) [PR#106](https://github.com/simbilod/meshwell/pull/106)
- refactor meshing into CAD + meshing to checkpoint [PR#107](https://github.com/simbilod/meshwell/pull/107)

## 1.3.8

Expand Down
2 changes: 1 addition & 1 deletion meshwell/gmsh_entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class GMSH_entity(BaseModel):
@validator("physical_name", pre=True, always=True)
def _set_physical_name(cls, physical_name: Optional[str | tuple[str]]):
if isinstance(physical_name, str):
return [physical_name]
return (physical_name,)
else:
return physical_name

Expand Down
19 changes: 19 additions & 0 deletions meshwell/labeledentity.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,25 @@ class LabeledEntities(BaseModel):

model_config = ConfigDict(arbitrary_types_allowed=True)

def to_dict(self) -> dict:
"""Convert entity to dictionary representation.
Returns:
Dictionary containing serializable entity data
"""
return {
"index": self.index,
"dimtags": self.dimtags,
"physical_name": self.physical_name,
"resolutions": [r.model_dump() for r in self.resolutions]
if self.resolutions
else None,
"keep": self.keep,
"boundaries": self.boundaries,
"interfaces": self.interfaces,
"mesh_edge_name_interfaces": self.mesh_edge_name_interfaces,
}

def _fuse_self(self, dimtags: List[Union[int, str]]) -> List[Union[int, str]]:
if len(dimtags) == 0:
return []
Expand Down
Loading

0 comments on commit e14cf8e

Please sign in to comment.