original_docstring: Normalize the node coordinates to mean 0 and mean length of 1.
docstring: Normalize the node coordinates to mean 0 and mean length of 1.
docstring_tokens: Normalize the node coordinates to mean 0 and mean length of 1 .
code: def normalize(self) -> "Domain":
          """Normalize the node coordinates to mean 0 and mean length of 1."""
          mean = self.x.mean(axis=0, keepdims=True)
          std = np.linalg.norm(self.x - mean, axis=-1).mean()
          x = (self.x - mean) / std
          mesh = self.mesh
          if mesh is not None:
              mesh = replace(mesh, doflocs=x.T)
          return replace(self, x=x, mesh=mesh)
code_tokens: def normalize ( self ) -> "Domain" : mean = self . x . mean ( axis = 0 , keepdims = True ) std = np . linalg . norm ( self . x - mean , axis = - 1 ) . mean ( ) x = ( self . x - mean ) / std mesh = self . mesh if mesh is not None : mesh = replace ( mesh , doflocs = x . T ) return replace ( self , x = x , mesh = mesh )
short_docstring: Normalize the node coordinates to mean 0 and mean length of 1.
short_docstring_tokens: Normalize the node coordinates to mean 0 and mean length of 1 .
comment: """Normalize the node coordinates to mean 0 and mean length of 1."""